SCIP Doxygen Documentation
Loading...
Searching...
No Matches
cmain.c
Go to the documentation of this file.
1
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2
/* */
3
/* This file is part of the program and library */
4
/* SCIP --- Solving Constraint Integer Programs */
5
/* */
6
/* Copyright (c) 2002-2024 Zuse Institute Berlin (ZIB) */
7
/* */
8
/* Licensed under the Apache License, Version 2.0 (the "License"); */
9
/* you may not use this file except in compliance with the License. */
10
/* You may obtain a copy of the License at */
11
/* */
12
/* http://www.apache.org/licenses/LICENSE-2.0 */
13
/* */
14
/* Unless required by applicable law or agreed to in writing, software */
15
/* distributed under the License is distributed on an "AS IS" BASIS, */
16
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17
/* See the License for the specific language governing permissions and */
18
/* limitations under the License. */
19
/* */
20
/* You should have received a copy of the Apache-2.0 license */
21
/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22
/* */
23
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25
/**@file Binpacking/src/cmain.c
26
* @brief Main file for binpacking pricing example
27
* @author Timo Berthold
28
* @author Stefan Heinz
29
*
30
* This the file contains the \ref main() main function of the projects. This includes all the default plugins of
31
* \SCIP and the once which belong to that projects. After that is starts the interactive shell of \SCIP or processes
32
* the shell arguments if given.
33
*/
34
#include <stdio.h>
35
36
#include "
scip/scip.h
"
37
#include "
scip/scipshell.h
"
38
#include "
scip/scipdefplugins.h
"
39
40
#include "
branch_ryanfoster.h
"
41
#include "
cons_samediff.h
"
42
#include "
pricer_binpacking.h
"
43
#include "
reader_bpa.h
"
44
45
/** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
46
* and frees the SCIP instance
47
*/
48
static
49
SCIP_RETCODE
runShell
(
50
int
argc,
/**< number of shell parameters */
51
char
** argv,
/**< array with shell parameters */
52
const
char
* defaultsetname
/**< name of default settings file */
53
)
54
{
55
SCIP
*
scip
=
NULL
;
56
57
/*********
58
* Setup *
59
*********/
60
61
/* initialize SCIP */
62
SCIP_CALL
(
SCIPcreate
(&
scip
) );
63
64
/* we explicitly enable the use of a debug solution for this main SCIP instance */
65
SCIPenableDebugSol
(
scip
);
66
67
/* include binpacking reader */
68
SCIP_CALL
(
SCIPincludeReaderBpa
(
scip
) );
69
70
/* include binpacking branching and branching data */
71
SCIP_CALL
(
SCIPincludeBranchruleRyanFoster
(
scip
) );
72
SCIP_CALL
(
SCIPincludeConshdlrSamediff
(
scip
) );
73
74
/* include binpacking pricer */
75
SCIP_CALL
(
SCIPincludePricerBinpacking
(
scip
) );
76
77
/* include default SCIP plugins */
78
SCIP_CALL
(
SCIPincludeDefaultPlugins
(
scip
) );
79
80
/* for column generation instances, disable restarts */
81
SCIP_CALL
(
SCIPsetIntParam
(
scip
,
"presolving/maxrestarts"
,0) );
82
83
/* turn off all separation algorithms */
84
SCIP_CALL
(
SCIPsetSeparating
(
scip
,
SCIP_PARAMSETTING_OFF
,
TRUE
) );
85
86
/**********************************
87
* Process command line arguments *
88
**********************************/
89
SCIP_CALL
(
SCIPprocessShellArguments
(
scip
, argc, argv, defaultsetname) );
90
91
/********************
92
* Deinitialization *
93
********************/
94
95
SCIP_CALL
(
SCIPfree
(&
scip
) );
96
97
BMScheckEmptyMemory
();
98
99
return
SCIP_OKAY
;
100
}
101
102
int
103
main
(
104
int
argc,
105
char
** argv
106
)
107
{
108
SCIP_RETCODE
retcode;
109
110
retcode =
runShell
(argc, argv,
"scip.set"
);
111
if
( retcode !=
SCIP_OKAY
)
112
{
113
SCIPprintError
(retcode);
114
return
-1;
115
}
116
117
return
0;
118
}
119
main
int main(int argc, char **argv)
Definition
cmain.c:111
runShell
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition
cmain.c:49
SCIPincludeBranchruleRyanFoster
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Definition
branch_ryanfoster.c:257
branch_ryanfoster.h
Ryan/Foster branching rule.
SCIPincludeConshdlrSamediff
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
Definition
cons_samediff.c:533
cons_samediff.h
Constraint handler stores the local branching decision data.
NULL
#define NULL
Definition
def.h:266
TRUE
#define TRUE
Definition
def.h:93
SCIP_CALL
#define SCIP_CALL(x)
Definition
def.h:373
SCIPenableDebugSol
void SCIPenableDebugSol(SCIP *scip)
Definition
scip_debug.c:57
SCIPfree
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition
scip_general.c:349
SCIPcreate
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition
scip_general.c:317
SCIPprintError
void SCIPprintError(SCIP_RETCODE retcode)
Definition
scip_general.c:222
SCIPsetIntParam
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition
scip_param.c:487
SCIPsetSeparating
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition
scip_param.c:979
SCIP_OKAY
return SCIP_OKAY
Definition
heur_actconsdiving.c:235
BMScheckEmptyMemory
#define BMScheckEmptyMemory()
Definition
memory.h:155
scip
Definition
objbenders.h:44
SCIPincludePricerBinpacking
SCIP_RETCODE SCIPincludePricerBinpacking(SCIP *scip)
Definition
pricer_binpacking.c:715
pricer_binpacking.h
Binpacking variable pricer.
SCIPincludeReaderBpa
SCIP_RETCODE SCIPincludeReaderBpa(SCIP *scip)
Definition
reader_bpa.c:257
reader_bpa.h
Binpacking problem reader file reader.
scip.h
SCIP callable library.
SCIPincludeDefaultPlugins
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
Definition
scipdefplugins.c:37
scipdefplugins.h
default SCIP plugins
SCIPprocessShellArguments
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition
scipshell.c:273
scipshell.h
SCIP command line interface.
SCIP_PARAMSETTING_OFF
@ SCIP_PARAMSETTING_OFF
Definition
type_paramset.h:63
SCIP_RETCODE
enum SCIP_Retcode SCIP_RETCODE
Definition
type_retcode.h:63
SCIP
struct Scip SCIP
Definition
type_scip.h:39
examples
Binpacking
src
cmain.c
© 2002-2024 by Zuse Institute Berlin (ZIB),
Imprint
Generated by
1.13.2