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-2024 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 */
54int 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 */
63
64 /* output version information */
65 SCIPinfoMessage(scip, NULL, "Solving the linear ordering problem using SCIP.\n");
67
68 /* include default SCIP plugins */
70
71 /* include linear ordering constraint handler */
73
74 /* include linear ordering file reader */
76
77 /* Process command line arguments */
78 SCIP_CALL_ERROR( SCIPprocessShellArguments(scip, argc, argv, "scip.set") );
79
80 /* free SCIP */
82
84
85 return 0;
86}
int main(int argc, char **argv)
Definition: cmain.c:111
SCIP_RETCODE SCIPincludeConshdlrLOP(SCIP *scip)
Definition: cons_lop.c:1176
constraint handler for linear ordering constraints
#define NULL
Definition: def.h:267
#define SCIP_CALL_ERROR(x)
Definition: cmain.c:41
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:339
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:307
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:208
#define BMScheckEmptyMemory()
Definition: memory.h:155
SCIP_RETCODE SCIPincludeReaderLOP(SCIP *scip)
Definition: reader_lop.c:348
linear ordering file reader
SCIP callable library.
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
default SCIP plugins
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:273