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 SCFLP/src/cmain.c
26
* @brief Main file for capacitated facility location example
27
* @author Stephen J. Maher
28
*
29
* This the file contains the \ref main() main function of the projects. This includes all the default plugins of
30
* \SCIP and the once which belong to that projects. After that is starts the interactive shell of \SCIP or processes
31
* the shell arguments if given.
32
*/
33
#include <stdio.h>
34
35
#include "
scip/scip.h
"
36
#include "
scip/scipshell.h
"
37
#include "
scip/scipdefplugins.h
"
38
#include "
scip/cons_benders.h
"
39
#include "
scip/cons_benderslp.h
"
40
#include "
scip/benders_default.h
"
41
42
#include "
reader_scflp.h
"
43
44
/** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
45
* and frees the SCIP instance
46
*/
47
static
48
SCIP_RETCODE
runShell
(
49
int
argc,
/**< number of shell parameters */
50
char
** argv,
/**< array with shell parameters */
51
const
char
* defaultsetname
/**< name of default settings file */
52
)
53
{
54
SCIP
*
scip
=
NULL
;
55
56
/*********
57
* Setup *
58
*********/
59
60
/* initialize SCIP */
61
SCIP_CALL
(
SCIPcreate
(&
scip
) );
62
63
/* include SCFLP reader */
64
SCIP_CALL
(
SCIPincludeReaderScflp
(
scip
) );
65
66
/* include default SCIP plugins */
67
SCIP_CALL
(
SCIPincludeDefaultPlugins
(
scip
) );
68
69
/* for Benders' decomposition instances restarts must be disabled */
70
SCIP_CALL
(
SCIPsetIntParam
(
scip
,
"presolving/maxrestarts"
,0) );
71
72
/* activating the trysol heuristic so that solutions checked by the Benders' decomposition subproblems are added to
73
* the main SCIP
74
*/
75
SCIP_CALL
(
SCIPsetIntParam
(
scip
,
"heuristics/trysol/freq"
, 1) );
76
77
/**********************************
78
* Process command line arguments *
79
**********************************/
80
SCIP_CALL
(
SCIPprocessShellArguments
(
scip
, argc, argv, defaultsetname) );
81
82
/********************
83
* Deinitialization *
84
********************/
85
86
SCIP_CALL
(
SCIPfree
(&
scip
) );
87
88
BMScheckEmptyMemory
();
89
90
return
SCIP_OKAY
;
91
}
92
93
int
94
main
(
95
int
argc,
96
char
** argv
97
)
98
{
99
SCIP_RETCODE
retcode;
100
101
retcode =
runShell
(argc, argv,
"scip.set"
);
102
if
( retcode !=
SCIP_OKAY
)
103
{
104
SCIPprintError
(retcode);
105
return
-1;
106
}
107
108
return
0;
109
}
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
benders_default.h
default Benders' decomposition plugin
cons_benders.h
constraint handler for Benders' decomposition
cons_benderslp.h
constraint handler for benderslp decomposition
NULL
#define NULL
Definition
def.h:266
SCIP_CALL
#define SCIP_CALL(x)
Definition
def.h:373
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
SCIP_OKAY
return SCIP_OKAY
Definition
heur_actconsdiving.c:235
BMScheckEmptyMemory
#define BMScheckEmptyMemory()
Definition
memory.h:155
scip
Definition
objbenders.h:44
SCIPincludeReaderScflp
SCIP_RETCODE SCIPincludeReaderScflp(SCIP *scip)
Definition
reader_scflp.c:475
reader_scflp.h
SCFLP 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
Definition
struct_scip.h:70
SCIP_RETCODE
enum SCIP_Retcode SCIP_RETCODE
Definition
type_retcode.h:63
examples
SCFLP
src
cmain.c
© 2002-2024 by Zuse Institute Berlin (ZIB),
Imprint
Generated by
1.12.0