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-2017 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 email to scip@zib.de. */
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 
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip.c:5158
#define BMScheckEmptyMemory()
Definition: memory.h:137
Ryan/Foster branching rule.
SCIP_RETCODE SCIPincludeReaderBpa(SCIP *scip)
Definition: reader_bpa.c:249
SCIP_RETCODE SCIPincludePricerBinpacking(SCIP *scip)
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Constraint handler stores the local branching decision data.
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:40
Binpacking variable pricer.
#define TRUE
Definition: def.h:63
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
int main(int argc, char **argv)
Definition: cmain.c:94
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip.c:748
SCIP command line interface.
#define SCIP_CALL(x)
Definition: def.h:350
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip.c:4688
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:149
Binpacking problem reader file reader.
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip.c:676
default SCIP plugins
SCIP callable library.
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip.c:780
void SCIPenableDebugSol(SCIP *scip)
Definition: scip.c:1162