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
LOP
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 LOP/src/cmain.c
17
* @brief main file for linear ordering example
18
* @author Marc Pfetsch
19
*/
20
21
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22
23
#include <string.h>
24
25
#include <
scip/scip.h
>
26
#include <
scip/scipdefplugins.h
>
27
28
#include "
cons_lop.h
"
29
#include "
reader_lop.h
"
30
31
/** define macro to print error message and exit */
32
#define SCIP_CALL_ERROR(x) do \
33
{ \
34
SCIP_RETCODE _restat_; \
35
if( (_restat_ = (x)) != SCIP_OKAY ) \
36
{ \
37
SCIPprintError(_restat_); \
38
return -1; \
39
} \
40
} \
41
while( FALSE )
42
43
44
/** main function, which starts the solution of the linear ordering problem */
45
int
main
(
46
int
argc,
/**< number of arguments from the shell */
47
char
** argv
/**< array of shell arguments */
48
)
49
{
50
SCIP
*
scip
=
NULL
;
51
52
/* initialize SCIP */
53
SCIP_CALL_ERROR
(
SCIPcreate
(&scip) );
54
55
/* output version information */
56
SCIPinfoMessage
(scip,
NULL
,
"Solving the linear ordering problem using SCIP.\n"
);
57
SCIPinfoMessage
(scip,
NULL
,
"\n"
);
58
59
/* include default SCIP plugins */
60
SCIP_CALL_ERROR
(
SCIPincludeDefaultPlugins
(scip) );
61
62
/* include linear ordering constraint handler */
63
SCIP_CALL_ERROR
(
SCIPincludeConshdlrLOP
(scip) );
64
65
/* include linear ordering file reader */
66
SCIP_CALL_ERROR
(
SCIPincludeReaderLOP
(scip) );
67
68
/* Process command line arguments */
69
SCIP_CALL_ERROR
(
SCIPprocessShellArguments
(scip, argc, argv,
"scip.set"
) );
70
71
/* free SCIP */
72
SCIP_CALL_ERROR
(
SCIPfree
(&scip) );
73
74
BMScheckEmptyMemory
();
75
76
return
0;
77
}
BMScheckEmptyMemory
#define BMScheckEmptyMemory()
Definition:
memory.h:114
Scip
Definition:
struct_scip.h:58
main
int main(int argc, char **argv)
Definition:
cmain.c:94
SCIPcreate
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition:
scip.c:696
SCIPinfoMessage
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition:
scip.c:1336
SCIPincludeReaderLOP
SCIP_RETCODE SCIPincludeReaderLOP(SCIP *scip)
Definition:
reader_lop.c:263
cons_lop.h
constraint handler for linear ordering constraints
NULL
#define NULL
Definition:
lpi_spx1.cpp:137
SCIPincludeDefaultPlugins
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
Definition:
scipdefplugins.c:27
SCIPprocessShellArguments
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition:
scipshell.c:148
SCIPincludeConshdlrLOP
SCIP_RETCODE SCIPincludeConshdlrLOP(SCIP *scip)
Definition:
cons_lop.c:1159
reader_lop.h
linear ordering file reader
scip
Definition:
objbranchrule.h:33
scipdefplugins.h
default SCIP plugins
scip.h
SCIP callable library.
SCIPfree
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition:
scip.c:774
SCIP_CALL_ERROR
#define SCIP_CALL_ERROR(x)
Definition:
cmain.c:32