SCIP Doxygen Documentation
Loading...
Searching...
No Matches
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-2025 Zuse Institute Berlin (ZIB) */
7
/* */
8
/* Licensed under the Apache License, Version 2.0 (the "License"); */
9
/* you may not use this file except in compliance with the License. */
10
/* You may obtain a copy of the License at */
11
/* */
12
/* http://www.apache.org/licenses/LICENSE-2.0 */
13
/* */
14
/* Unless required by applicable law or agreed to in writing, software */
15
/* distributed under the License is distributed on an "AS IS" BASIS, */
16
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17
/* See the License for the specific language governing permissions and */
18
/* limitations under the License. */
19
/* */
20
/* You should have received a copy of the Apache-2.0 license */
21
/* along with SCIP; see the file LICENSE. If not visit scipopt.org. */
22
/* */
23
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24
25
/**@file examples/LOP/src/cmain.c
26
* @brief main file for linear ordering example
27
* @author Marc Pfetsch
28
*/
29
30
/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
31
32
#include <string.h>
33
34
#include <
scip/scip.h
>
35
#include <
scip/scipdefplugins.h
>
36
37
#include "
cons_lop.h
"
38
#include "
reader_lop.h
"
39
40
/** define macro to print error message and exit */
41
#define SCIP_CALL_ERROR(x) do \
42
{ \
43
SCIP_RETCODE _restat_; \
44
if( (_restat_ = (x)) != SCIP_OKAY ) \
45
{ \
46
SCIPprintError(_restat_); \
47
return -1; \
48
} \
49
} \
50
while( FALSE )
51
52
53
/** main function, which starts the solution of the linear ordering problem */
54
int
main
(
55
int
argc,
/**< number of arguments from the shell */
56
char
** argv
/**< array of shell arguments */
57
)
58
{
59
SCIP
*
scip
=
NULL
;
60
61
/* initialize SCIP */
62
SCIP_CALL_ERROR
(
SCIPcreate
(&
scip
) );
63
64
/* output version information */
65
SCIPinfoMessage
(
scip
,
NULL
,
"Solving the linear ordering problem using SCIP.\n"
);
66
SCIPinfoMessage
(
scip
,
NULL
,
"\n"
);
67
68
/* include default SCIP plugins */
69
SCIP_CALL_ERROR
(
SCIPincludeDefaultPlugins
(
scip
) );
70
71
/* include linear ordering constraint handler */
72
SCIP_CALL_ERROR
(
SCIPincludeConshdlrLOP
(
scip
) );
73
74
/* include linear ordering file reader */
75
SCIP_CALL_ERROR
(
SCIPincludeReaderLOP
(
scip
) );
76
77
/* Process command line arguments */
78
SCIP_CALL_ERROR
(
SCIPprocessShellArguments
(
scip
, argc, argv,
"scip.set"
) );
79
80
/* free SCIP */
81
SCIP_CALL_ERROR
(
SCIPfree
(&
scip
) );
82
83
BMScheckEmptyMemory
();
84
85
return
0;
86
}
main
int main(int argc, char **argv)
Definition
cmain.c:111
SCIPincludeConshdlrLOP
SCIP_RETCODE SCIPincludeConshdlrLOP(SCIP *scip)
Definition
cons_lop.c:1176
cons_lop.h
constraint handler for linear ordering constraints
NULL
#define NULL
Definition
def.h:266
SCIP_CALL_ERROR
#define SCIP_CALL_ERROR(x)
Definition
cmain.c:41
SCIPfree
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition
scip_general.c:349
SCIPcreate
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition
scip_general.c:317
SCIPinfoMessage
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition
scip_message.c:208
BMScheckEmptyMemory
#define BMScheckEmptyMemory()
Definition
memory.h:155
scip
Definition
objbenders.h:44
SCIPincludeReaderLOP
SCIP_RETCODE SCIPincludeReaderLOP(SCIP *scip)
Definition
reader_lop.c:348
reader_lop.h
linear ordering file reader
scip.h
SCIP callable library.
SCIPincludeDefaultPlugins
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
Definition
scipdefplugins.c:37
scipdefplugins.h
default SCIP plugins
SCIPprocessShellArguments
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition
scipshell.c:273
SCIP
struct Scip SCIP
Definition
type_scip.h:39
examples
LOP
src
cmain.c
© 2002-2025 by Zuse Institute Berlin (ZIB),
Imprint
Generated by
1.14.0