Toggle navigation
SCIP Optimization Suite
SCIP
SoPlex
ZIMPL
UG
GCG
Documentation
SCIP 9.2.0
SCIP 8.1.0
SCIP 7.0.3
SCIP 6.0.2
SCIP 5.0.1
SCIP 4.0.1
SCIP 3.2.1
SCIP
Solving Constraint Integer Programs
examples
Binpacking
src
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
40
SCIP_RETCODE
runShell
(
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 */
59
SCIP_CALL
(
SCIPincludeReaderBpa
(scip) );
60
61
/* include binpacking branching and branching data */
62
SCIP_CALL
(
SCIPincludeBranchruleRyanFoster
(scip) );
63
SCIP_CALL
(
SCIPincludeConshdlrSamediff
(scip) );
64
65
/* include binpacking pricer */
66
SCIP_CALL
(
SCIPincludePricerBinpacking
(scip) );
67
68
/* include default SCIP plugins */
69
SCIP_CALL
(
SCIPincludeDefaultPlugins
(scip) );
70
71
/* for column generation instances, disable restarts */
72
SCIP_CALL
(
SCIPsetIntParam
(scip,
"presolving/maxrestarts"
,0) );
73
74
/* turn off all separation algorithms */
75
SCIP_CALL
(
SCIPsetSeparating
(scip,
SCIP_PARAMSETTING_OFF
,
TRUE
) );
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
88
BMScheckEmptyMemory
();
89
90
return
SCIP_OKAY
;
91
}
92
93
int
94
main
(
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
SCIPsetSeparating
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition:
scip.c:5158
BMScheckEmptyMemory
#define BMScheckEmptyMemory()
Definition:
memory.h:137
branch_ryanfoster.h
Ryan/Foster branching rule.
Scip
Definition:
struct_scip.h:58
SCIPincludeReaderBpa
SCIP_RETCODE SCIPincludeReaderBpa(SCIP *scip)
Definition:
reader_bpa.c:249
SCIPincludePricerBinpacking
SCIP_RETCODE SCIPincludePricerBinpacking(SCIP *scip)
Definition:
pricer_binpacking.c:717
SCIPincludeBranchruleRyanFoster
SCIP_RETCODE SCIPincludeBranchruleRyanFoster(SCIP *scip)
Definition:
branch_ryanfoster.c:253
cons_samediff.h
Constraint handler stores the local branching decision data.
runShell
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition:
cmain.c:40
pricer_binpacking.h
Binpacking variable pricer.
TRUE
#define TRUE
Definition:
def.h:63
SCIP_RETCODE
enum SCIP_Retcode SCIP_RETCODE
Definition:
type_retcode.h:53
main
int main(int argc, char **argv)
Definition:
cmain.c:94
SCIPcreate
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition:
scip.c:748
scipshell.h
SCIP command line interface.
SCIP_PARAMSETTING_OFF
Definition:
type_paramset.h:54
SCIP_OKAY
Definition:
type_retcode.h:33
SCIP_CALL
#define SCIP_CALL(x)
Definition:
def.h:350
SCIPincludeDefaultPlugins
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
Definition:
scipdefplugins.c:27
SCIPincludeConshdlrSamediff
SCIP_RETCODE SCIPincludeConshdlrSamediff(SCIP *scip)
Definition:
cons_samediff.c:526
SCIPsetIntParam
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition:
scip.c:4688
SCIPprocessShellArguments
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition:
scipshell.c:149
reader_bpa.h
Binpacking problem reader file reader.
SCIPprintError
void SCIPprintError(SCIP_RETCODE retcode)
Definition:
scip.c:676
scip
Definition:
objbranchrule.h:33
scipdefplugins.h
default SCIP plugins
scip.h
SCIP callable library.
SCIPfree
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition:
scip.c:780
SCIPenableDebugSol
void SCIPenableDebugSol(SCIP *scip)
Definition:
scip.c:1162