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-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file SCFLP/src/cmain.c
17  * @brief Main file for capacitated facility location example
18  * @author Stephen J. Maher
19  *
20  * This the file contains the \ref main() main function of the projects. This includes all the default plugins of
21  * \SCIP and the once which belong to that projects. After that is starts the interactive shell of \SCIP or processes
22  * the shell arguments if given.
23  */
24 #include <stdio.h>
25 
26 #include "scip/scip.h"
27 #include "scip/scipshell.h"
28 #include "scip/scipdefplugins.h"
29 #include "scip/cons_benders.h"
30 #include "scip/cons_benderslp.h"
31 #include "scip/benders_default.h"
32 
33 #include "reader_scflp.h"
34 
35 /** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
36  * and frees the SCIP instance
37  */
38 static
40  int argc, /**< number of shell parameters */
41  char** argv, /**< array with shell parameters */
42  const char* defaultsetname /**< name of default settings file */
43  )
44 {
45  SCIP* scip = NULL;
46 
47  /*********
48  * Setup *
49  *********/
50 
51  /* initialize SCIP */
52  SCIP_CALL( SCIPcreate(&scip) );
53 
54  /* include SCFLP reader */
56 
57  /* include default SCIP plugins */
59 
60  /* for Benders' decomposition instances restarts must be disabled */
61  SCIP_CALL( SCIPsetIntParam(scip,"presolving/maxrestarts",0) );
62 
63  /* turn off all separation algorithms */
66  SCIP_CALL( SCIPsetIntParam(scip, "propagating/maxrounds", 0) );
67  SCIP_CALL( SCIPsetIntParam(scip, "propagating/maxroundsroot", 0) );
68 
69  SCIP_CALL( SCIPsetIntParam(scip, "heuristics/trysol/freq", 1) );
70 
71  /**********************************
72  * Process command line arguments *
73  **********************************/
74  SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
75 
76  /********************
77  * Deinitialization *
78  ********************/
79 
80  SCIP_CALL( SCIPfree(&scip) );
81 
83 
84  return SCIP_OKAY;
85 }
86 
87 int
89  int argc,
90  char** argv
91  )
92 {
93  SCIP_RETCODE retcode;
94 
95  retcode = runShell(argc, argv, "scip.set");
96  if( retcode != SCIP_OKAY )
97  {
98  SCIPprintError(retcode);
99  return -1;
100  }
101 
102  return 0;
103 }
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:210
constraint handler for Benders&#39; decomposition
#define NULL
Definition: def.h:253
#define BMScheckEmptyMemory()
Definition: memory.h:145
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:39
int main(int argc, char **argv)
Definition: cmain.c:102
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:282
SCIP command line interface.
SCFLP problem reader file reader.
#define SCIP_CALL(x)
Definition: def.h:365
SCIP_RETCODE SCIPsetPresolving(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:940
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPincludeReaderScflp(SCIP *scip)
Definition: reader_scflp.c:463
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:147
constraint handler for benderslp decomposition
default Benders&#39; decomposition plugin
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:314
default SCIP plugins
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:496
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:966
SCIP callable library.