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-2020 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 scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file Ringpacking/src/cmain.c
17  * @brief Main file for ringpacking pricing example
18  * @author Benjamin Mueller
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 ones 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 
30 #include "cons_rpa.h"
31 #include "reader_rpa.h"
32 #include "pricer_rpa.h"
33 
34 #define DEFAULT_TEXFILENAME "" /**< filename for tex output for the best found solution (\"\": disable) */
35 
36 /** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
37  * and frees the SCIP instance
38  */
39 static
41  int argc, /**< number of shell parameters */
42  char** argv, /**< array with shell parameters */
43  const char* defaultsetname /**< name of default settings file */
44  )
45 {
46  SCIP* scip = NULL;
47 
48  /*********
49  * Setup *
50  *********/
51 
52  /* initialize SCIP */
53  SCIP_CALL( SCIPcreate(&scip) );
54 
55  /* we explicitly enable the use of a debug solution for this main SCIP instance */
56  SCIPenableDebugSol(scip);
57 
58  /* include default SCIP plugins */
60 
61  /* include reader for ringpacking instances */
63 
64  /* include ringpacking constraint handler */
66 
67  /* include ringpacking pricer */
69 
70  /* for column generation instances, disable restarts */
71  SCIP_CALL( SCIPsetIntParam(scip,"presolving/maxrestarts",0) );
72 
73  /* turn off all separation algorithms */
75 
76  /*
77  * miscellaneous parameters
78  */
79 
81  "ringpacking/texfilename",
82  "filename for tex output for the best found solution (\"\": disable)",
84 
85  /**********************************
86  * Process command line arguments *
87  **********************************/
88  SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
89 
90  /********************
91  * Deinitialization *
92  ********************/
93 
94  SCIP_CALL( SCIPfree(&scip) );
95 
97 
98  return SCIP_OKAY;
99 }
100 
101 int
103  int argc,
104  char** argv
105  )
106 {
107  SCIP_RETCODE retcode;
108 
109  retcode = runShell(argc, argv, "scip.set");
110  if( retcode != SCIP_OKAY )
111  {
112  SCIPprintError(retcode);
113  return -1;
114  }
115 
116  return 0;
117 }
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:211
#define BMScheckEmptyMemory()
Definition: memory.h:147
#define FALSE
Definition: def.h:73
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
SCIP_RETCODE SCIPincludeReaderRpa(SCIP *scip)
Definition: reader_rpa.c:275
int main(int argc, char **argv)
Definition: cmain.c:102
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:283
SCIP_RETCODE SCIPincludeConshdlrRpa(SCIP *scip)
Definition: cons_rpa.c:678
SCIP command line interface.
void SCIPenableDebugSol(SCIP *scip)
Definition: scip_debug.c:48
#define NULL
Definition: lpi_spx1.cpp:155
#define SCIP_CALL(x)
Definition: def.h:364
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:185
constraint handler for ringpacking
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPincludePricerRpa(SCIP *scip)
Definition: pricer_rpa.c:911
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:40
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:148
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:315
#define DEFAULT_TEXFILENAME
Definition: cmain.c:34
Ringpacking variable pricer.
default SCIP plugins
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:503
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:974
SCIP callable library.