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-2018 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 scip.zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file examples/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 */
61 
62  /* include linear ordering constraint handler */
64 
65  /* include linear ordering file reader */
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 
75 
76  return 0;
77 }
#define NULL
Definition: def.h:239
#define BMScheckEmptyMemory()
Definition: memory.h:137
#define SCIP_CALL_ERROR(x)
Definition: cmain.c:32
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:339
int main(int argc, char **argv)
Definition: cmain.c:102
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:279
SCIP_RETCODE SCIPincludeReaderLOP(SCIP *scip)
Definition: reader_lop.c:263
constraint handler for linear ordering constraints
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:147
SCIP_RETCODE SCIPincludeConshdlrLOP(SCIP *scip)
Definition: cons_lop.c:1159
linear ordering file reader
default SCIP plugins
SCIP callable library.
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:371