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 Ringpacking/src/cmain.c
26 * @brief Main file for ringpacking pricing example
27 * @author Benjamin Mueller
28 *
29 * This the file contains the \ref main() main function of the projects. This includes all the default plugins of
30 * \SCIP and the ones which belong to that projects. After that is starts the interactive shell of \SCIP or processes
31 * the shell arguments if given.
32 */
33#include <stdio.h>
34
35#include "scip/scip.h"
36#include "scip/scipshell.h"
37#include "scip/scipdefplugins.h"
38
39#include "cons_rpa.h"
40#include "reader_rpa.h"
41#include "pricer_rpa.h"
42
43#define DEFAULT_TEXFILENAME "" /**< filename for tex output for the best found solution (\"\": disable) */
44
45/** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
46 * and frees the SCIP instance
47 */
48static
50 int argc, /**< number of shell parameters */
51 char** argv, /**< array with shell parameters */
52 const char* defaultsetname /**< name of default settings file */
53 )
54{
55 SCIP* scip = NULL;
56
57 /*********
58 * Setup *
59 *********/
60
61 /* initialize SCIP */
63
64 /* we explicitly enable the use of a debug solution for this main SCIP instance */
66
67 /* include default SCIP plugins */
69
70 /* include reader for ringpacking instances */
72
73 /* include ringpacking constraint handler */
75
76 /* include ringpacking pricer */
78
79 /* for column generation instances, disable restarts */
80 SCIP_CALL( SCIPsetIntParam(scip,"presolving/maxrestarts",0) );
81
82 /* turn off all separation algorithms */
84
85 /*
86 * miscellaneous parameters
87 */
88
90 "ringpacking/texfilename",
91 "filename for tex output for the best found solution (\"\": disable)",
93
94 /**********************************
95 * Process command line arguments *
96 **********************************/
97 SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
98
99 /********************
100 * Deinitialization *
101 ********************/
102
104
106
107 return SCIP_OKAY;
108}
109
110int
112 int argc,
113 char** argv
114 )
115{
116 SCIP_RETCODE retcode;
117
118 retcode = runShell(argc, argv, "scip.set");
119 if( retcode != SCIP_OKAY )
120 {
121 SCIPprintError(retcode);
122 return -1;
123 }
124
125 return 0;
126}
int main(int argc, char **argv)
Definition: cmain.c:111
#define DEFAULT_TEXFILENAME
Definition: cmain.c:43
static SCIP_RETCODE runShell(int argc, char **argv, const char *defaultsetname)
Definition: cmain.c:49
constraint handler for ringpacking
#define NULL
Definition: def.h:267
#define TRUE
Definition: def.h:93
#define FALSE
Definition: def.h:94
#define SCIP_CALL(x)
Definition: def.h:374
SCIP_RETCODE SCIPincludeConshdlrRpa(SCIP *scip)
Definition: cons_rpa.c:686
void SCIPenableDebugSol(SCIP *scip)
Definition: scip_debug.c:57
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:339
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:307
void SCIPprintError(SCIP_RETCODE retcode)
Definition: scip_general.c:221
SCIP_RETCODE SCIPaddStringParam(SCIP *scip, const char *name, const char *desc, char **valueptr, SCIP_Bool isadvanced, const char *defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:194
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
Definition: scip_param.c:487
SCIP_RETCODE SCIPsetSeparating(SCIP *scip, SCIP_PARAMSETTING paramsetting, SCIP_Bool quiet)
Definition: scip_param.c:979
#define BMScheckEmptyMemory()
Definition: memory.h:155
SCIP_RETCODE SCIPincludePricerRpa(SCIP *scip)
Definition: pricer_rpa.c:920
Ringpacking variable pricer.
SCIP_RETCODE SCIPincludeReaderRpa(SCIP *scip)
Definition: reader_rpa.c:284
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
SCIP command line interface.
@ SCIP_PARAMSETTING_OFF
Definition: type_paramset.h:63
@ SCIP_OKAY
Definition: type_retcode.h:42
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63