Scippy

SCIP

Solving Constraint Integer Programs

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"
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 */
47static
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 */
62
63 /* include SCFLP reader */
65
66 /* include default SCIP plugins */
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
87
89
90 return SCIP_OKAY;
91}
92
93int
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}
int main(int argc, char **argv)
Definition: cmain.c:111
default Benders' decomposition plugin
constraint handler for Benders' decomposition
constraint handler for benderslp decomposition
#define NULL
Definition: def.h:267
#define SCIP_CALL(x)
Definition: def.h:374
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:48
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:339
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:307
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:221
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:487
#define BMScheckEmptyMemory()
Definition: memory.h:155
SCIP_RETCODE SCIPincludeReaderScflp(SCIP *scip)
Definition: reader_scflp.c:475
SCFLP problem reader file reader.
SCIP callable library.
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
default SCIP plugins
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:273
SCIP command line interface.
@ SCIP_OKAY
Definition: type_retcode.h:42
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63