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-2021 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 Binpacking/src/cmain.c
17  * @brief Main file for binpacking pricing example
18  * @author Timo Berthold
19  * @author Stefan Heinz
20  *
21  * This the file contains the \ref main() main function of the projects. This includes all the default plugins of
22  * \SCIP and the once which belong to that projects. After that is starts the interactive shell of \SCIP or processes
23  * the shell arguments if given.
24  */
25 #include <stdio.h>
26 
27 #include "scip/scip.h"
28 #include "scip/scipshell.h"
29 #include "scip/scipdefplugins.h"
30 
31 #include "branch_ryanfoster.h"
32 #include "cons_samediff.h"
33 #include "pricer_binpacking.h"
34 #include "reader_bpa.h"
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 binpacking reader */
60 
61  /* include binpacking branching and branching data */
64 
65  /* include binpacking pricer */
67 
68  /* include default SCIP plugins */
70 
71  /* for column generation instances, disable restarts */
72  SCIP_CALL( SCIPsetIntParam(scip,"presolving/maxrestarts",0) );
73 
74  /* turn off all separation algorithms */
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 
89 
90  return SCIP_OKAY;
91 }
92 
93 int
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 }
110 
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:211
#define BMScheckEmptyMemory()
Definition: memory.h:147
Ryan/Foster branching rule.
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:40
SCIP_RETCODE SCIPincludeReaderBpa(SCIP *scip)
Definition: reader_bpa.c:248
SCIP_RETCODE SCIPincludePricerBinpacking(SCIP *scip)
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Constraint handler stores the local branching decision data.
Binpacking variable pricer.
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
int main(int argc, char **argv)
Definition: cmain.c:102
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:283
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:370
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:148
Binpacking problem reader file reader.
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:315
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.