Scippy

SCIP

Solving Constraint Integer Programs

scipshell.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 scipshell.c
26 * @ingroup OTHER_CFILES
27 * @brief SCIP command line interface
28 * @author Tobias Achterberg
29 */
30
31/*--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32
33#include <stdio.h>
34#include <string.h>
35#include <ctype.h>
36
37#include "scip/scip.h"
38#include "scip/scipdefplugins.h"
39#include "scip/scipshell.h"
41#include "scip/reader_nl.h"
42#include "scip/rational.h"
43
44/*
45 * Message Handler
46 */
47
48static
50 SCIP* scip, /**< SCIP data structure */
51 const char* filename /**< parameter file name */
52 )
53{
54 if( SCIPfileExists(filename) )
55 {
56 SCIPinfoMessage(scip, NULL, "reading user parameter file <%s>\n", filename);
57 SCIP_CALL( SCIPreadParams(scip, filename) );
58 }
59 else
60 SCIPinfoMessage(scip, NULL, "user parameter file <%s> not found - using default parameters\n", filename);
61
62 return SCIP_OKAY;
63}
64
65static
67 SCIP* scip, /**< SCIP data structure */
68 const char* filename /**< input file name */
69 )
70{
71 SCIP_RETCODE retcode;
72 SCIP_Bool outputorigsol = FALSE;
73
74 /********************
75 * Problem Creation *
76 ********************/
77
78 /** @note The message handler should be only fed line by line such the message has the chance to add string in front
79 * of each message
80 */
82 SCIPinfoMessage(scip, NULL, "read problem <%s>\n", filename);
83 SCIPinfoMessage(scip, NULL, "============\n");
85
86 retcode = SCIPreadProb(scip, filename, NULL);
87
88 switch( retcode )
89 {
90 case SCIP_NOFILE:
91 SCIPinfoMessage(scip, NULL, "file <%s> not found\n", filename);
92 return SCIP_OKAY;
94 SCIPinfoMessage(scip, NULL, "no reader for input file <%s> available\n", filename);
95 return SCIP_OKAY;
96 case SCIP_READERROR:
97 SCIPinfoMessage(scip, NULL, "error reading file <%s>\n", filename);
98 return SCIP_OKAY;
99 default:
100 SCIP_CALL( retcode );
101 } /*lint !e788*/
102
103 /*******************
104 * Problem Solving *
105 *******************/
106
107 /* solve problem */
108 SCIPinfoMessage(scip, NULL, "\nsolve problem\n");
109 SCIPinfoMessage(scip, NULL, "=============\n\n");
110
112
113 /*******************
114 * Solution Output *
115 *******************/
116
117 SCIP_CALL( SCIPgetBoolParam(scip, "misc/outputorigsol", &outputorigsol) );
118 if ( outputorigsol )
119 {
120 SCIP_SOL* bestsol;
121
122 SCIPinfoMessage(scip, NULL, "\nprimal solution (original space):\n");
123 SCIPinfoMessage(scip, NULL, "=================================\n\n");
124
125 bestsol = SCIPgetBestSol(scip);
126 if ( bestsol == NULL )
127 SCIPinfoMessage(scip, NULL, "no solution available\n");
128 else
129 {
130 SCIP_SOL* origsol;
131
132 SCIP_CALL( SCIPcreateSolCopy(scip, &origsol, bestsol) );
133 SCIP_CALL( SCIPretransformSol(scip, origsol) );
134 if( SCIPisExact(scip) && SCIPsolIsExact(bestsol) )
135 {
137 }
138 else
139 {
140 SCIP_CALL( SCIPprintSol(scip, origsol, NULL, FALSE) );
141 }
142 SCIP_CALL( SCIPfreeSol(scip, &origsol) );
143 }
144 }
145 else
146 {
147 SCIPinfoMessage(scip, NULL, "\nprimal solution (transformed space):\n");
148 SCIPinfoMessage(scip, NULL, "====================================\n\n");
149
151 }
152
153 /**************
154 * Statistics *
155 **************/
156
157 SCIPinfoMessage(scip, NULL, "\nStatistics\n");
158 SCIPinfoMessage(scip, NULL, "==========\n\n");
159
161
162 return SCIP_OKAY;
163}
164
165/** runs SCIP as if it was called by AMPL */
166static
168 SCIP* scip, /**< SCIP data structure */
169 char* nlfilename, /**< name of .nl file, without the .nl */
170 SCIP_Bool interactive, /**< whether to start SCIP shell instead of solve only */
171 const char* defaultsetname /**< name of default settings file */
172 )
173{
174#ifdef SCIP_WITH_AMPL
175 char fullnlfilename[SCIP_MAXSTRLEN];
176 char* logfile;
177 SCIP_Bool printstat;
178 const char* constoptions;
179 size_t nlfilenamelen;
180
181 SCIP_CALL( SCIPaddBoolParam(scip, "display/statistics",
182 "whether to print statistics on a solve",
183 &printstat, FALSE, FALSE, NULL, NULL) );
184
185 SCIP_CALL( SCIPaddStringParam(scip, "display/logfile",
186 "name of file to write SCIP log to (additionally to writing to stdout)",
187 NULL, FALSE, "", NULL, NULL) );
188
190 SCIPinfoMessage(scip, NULL, "\n");
191
193 SCIPinfoMessage(scip, NULL, "\n");
194
195 constoptions = getenv("scip_options");
196 if( constoptions != NULL )
197 {
198 /* parse and apply options from scip_options env variable */
199 size_t optionslen;
200 char* options;
201 char* optname;
202 char* optval;
203
204 optionslen = strlen(constoptions);
205 SCIP_CALL( SCIPduplicateBufferArray(scip, &options, constoptions, optionslen+1) );
206
207 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, "applying scip_options:\n");
208
209 optname = strtok(options, " ");
210 optval = strtok(NULL, " ");
211 while( optname != NULL && optval != NULL )
212 {
213 SCIPverbMessage(scip, SCIP_VERBLEVEL_HIGH, NULL, " %s = %s\n", optname, optval);
214 SCIP_CALL( SCIPsetParam(scip, optname, optval) );
215
216 optname = strtok(NULL, " ");
217 optval = strtok(NULL, " ");
218 }
219
220 SCIPfreeBufferArray(scip, &options);
221 }
222
223 if( defaultsetname != NULL )
224 {
225 if( SCIPfileExists(defaultsetname) )
226 {
227 SCIPinfoMessage(scip, NULL, "reading user parameter file <%s>\n", defaultsetname);
228 SCIPinfoMessage(scip, NULL, "===========================\n\n");
229 SCIP_CALL( SCIPreadParams(scip, defaultsetname) );
231 SCIPinfoMessage(scip, NULL, "\n");
232 }
233 else
234 {
235 SCIPinfoMessage(scip, NULL, "user parameter file <%s> not found - using default parameters\n", defaultsetname);
236 }
237 }
238
239 SCIP_CALL( SCIPgetStringParam(scip, "display/logfile", &logfile) );
240 if( *logfile )
242
243 /* AMPL calls solver with file without .nl extension, but others (Pyomo) may not
244 * so add .nl only if not already present
245 */
246 nlfilenamelen = strlen(nlfilename);
247 if( nlfilenamelen > 3 && strcmp(nlfilename + (nlfilenamelen-3), ".nl") == 0 )
248 (void) SCIPsnprintf(fullnlfilename, SCIP_MAXSTRLEN, "%s", nlfilename);
249 else
250 (void) SCIPsnprintf(fullnlfilename, SCIP_MAXSTRLEN, "%s.nl", nlfilename);
251 SCIPinfoMessage(scip, NULL, "read problem <%s>\n", fullnlfilename);
252 SCIPinfoMessage(scip, NULL, "============\n\n");
253
254 SCIP_CALL( SCIPreadProb(scip, fullnlfilename, "nl") );
255
256 if( interactive )
257 {
259 }
260 else
261 {
262 SCIPinfoMessage(scip, NULL, "\nsolve problem\n");
263 SCIPinfoMessage(scip, NULL, "=============\n\n");
264
266 }
267
268 SCIP_CALL( SCIPgetBoolParam(scip, "display/statistics", &printstat) );
269 if( printstat )
270 {
271 SCIPinfoMessage(scip, NULL, "\nStatistics\n");
272 SCIPinfoMessage(scip, NULL, "==========\n\n");
273
275 }
276
278
279 return SCIP_OKAY;
280
281#else /* SCIP_WITH_AMPL */
282 SCIPerrorMessage("SCIP has been compiled without AMPL support.\n");
283 return SCIP_PLUGINNOTFOUND;
284#endif
285}
286
287/** evaluates command line parameters and runs SCIP appropriately in the given SCIP instance */
289 SCIP* scip, /**< SCIP data structure */
290 int argc, /**< number of shell parameters */
291 char** argv, /**< array with shell parameters */
292 const char* defaultsetname /**< name of default settings file */
293 )
294{ /*lint --e{850}*/
295 char* probname = NULL;
296 char* settingsname = NULL;
297 char* logname = NULL;
298 int randomseed;
299 SCIP_Bool randomseedread;
300 SCIP_Bool quiet;
301 SCIP_Bool paramerror;
303 SCIP_Bool onlyversion;
304 SCIP_Real primalreference = SCIP_UNKNOWN;
305 SCIP_Real dualreference = SCIP_UNKNOWN;
306 SCIP_RATIONAL* primalreferencerational = NULL;
307 SCIP_RATIONAL* dualreferencerational = NULL;
308 const char* dualrefstring;
309 const char* primalrefstring;
310 int i;
311
312 /********************
313 * Parse parameters *
314 ********************/
315
316 /* recognize and handle case where we were called from AMPL first */
317 if( argc >= 3 && strcmp(argv[2], "-AMPL") == 0 )
318 {
319 /* check for optional argument -i after -AMPL */
320 interactive = argc >= 4 && strcmp(argv[3], "-i") == 0;
321
322 SCIP_CALL( fromAmpl(scip, argv[1], interactive, defaultsetname) );
323
324 return SCIP_OKAY;
325 }
326
327 quiet = FALSE;
328 paramerror = FALSE;
330 onlyversion = FALSE;
331 randomseedread = FALSE;
332 randomseed = 0;
333 primalrefstring = NULL;
334 dualrefstring = NULL;
335
336 for( i = 1; i < argc; ++i )
337 {
338 if( strcmp(argv[i], "-l") == 0 )
339 {
340 i++;
341 if( i < argc )
342 logname = argv[i];
343 else
344 {
345 printf("missing log filename after parameter '-l'\n");
346 paramerror = TRUE;
347 }
348 }
349 else if( strcmp(argv[i], "-q") == 0 )
350 quiet = TRUE;
351 else if( strcmp(argv[i], "-v") == 0 )
352 onlyversion = TRUE;
353 else if( strcmp(argv[i], "--version") == 0 )
354 onlyversion = TRUE;
355 else if( strcmp(argv[i], "-s") == 0 )
356 {
357 i++;
358 if( i < argc )
359 settingsname = argv[i];
360 else
361 {
362 printf("missing settings filename after parameter '-s'\n");
363 paramerror = TRUE;
364 }
365 }
366 else if( strcmp(argv[i], "-f") == 0 )
367 {
368 i++;
369 if( i < argc )
370 probname = argv[i];
371 else
372 {
373 printf("missing problem filename after parameter '-f'\n");
374 paramerror = TRUE;
375 }
376 }
377 else if( strcmp(argv[i], "-c") == 0 )
378 {
379 i++;
380 if( i < argc )
381 {
384 }
385 else
386 {
387 printf("missing command line after parameter '-c'\n");
388 paramerror = TRUE;
389 }
390 }
391 else if( strcmp(argv[i], "-b") == 0 )
392 {
393 i++;
394 if( i < argc )
395 {
396 SCIP_FILE* file;
397
398 file = SCIPfopen(argv[i], "r");
399 if( file == NULL )
400 {
401 printf("cannot read command batch file <%s>\n", argv[i]);
402 SCIPprintSysError(argv[i]);
403 paramerror = TRUE;
404 }
405 else
406 {
407 while( !SCIPfeof(file) )
408 {
409 char buffer[SCIP_MAXSTRLEN];
410
411 (void)SCIPfgets(buffer, (int) sizeof(buffer), file);
412 if( buffer[0] != '\0' )
413 {
415 }
416 }
417 SCIPfclose(file);
419 }
420 }
421 else
422 {
423 printf("missing command batch filename after parameter '-b'\n");
424 paramerror = TRUE;
425 }
426 }
427 else if( strcmp(argv[i], "-r") == 0 )
428 {
429 /*read a random seed from the command line */
430 i++;
431 if( i < argc && isdigit((unsigned char)argv[i][0]) )
432 {
433 randomseed = atoi(argv[i]);
434 randomseedread = TRUE;
435 }
436 else
437 {
438 printf("Random seed parameter '-r' followed by something that is not an integer\n");
439 paramerror = TRUE;
440 }
441 }
442 else if( strcmp(argv[i], "-o") == 0 )
443 {
444 if( i >= argc - 2 )
445 {
446 printf("wrong usage of reference objective parameter '-o': -o <primref> <dualref>\n");
447 paramerror = TRUE;
448 }
449 else
450 {
451 /* do not parse the strings directly, the settings could still influence the value of +-infinity */
452 primalrefstring = argv[i + 1];
453 dualrefstring = argv[i+2];
454 }
455 i += 2;
456 }
457 else
458 {
459 printf("invalid parameter <%s>\n", argv[i]);
460 paramerror = TRUE;
461 }
462 }
463
464 if( interactive && probname != NULL )
465 {
466 printf("cannot mix batch mode '-c' and '-b' with file mode '-f'\n");
467 paramerror = TRUE;
468 }
469
470 if( !paramerror )
471 {
472 /***********************************
473 * create log file message handler *
474 ***********************************/
475
476 if( quiet )
477 {
479 }
480
481 if( logname != NULL )
482 {
484 }
485
486 /***********************************
487 * Version and library information *
488 ***********************************/
489
491 SCIPinfoMessage(scip, NULL, "\n");
492
494 SCIPinfoMessage(scip, NULL, "\n");
495
496 if( onlyversion )
497 {
499 SCIPinfoMessage(scip, NULL, "\n");
500 return SCIP_OKAY;
501 }
502
503 /*****************
504 * Load settings *
505 *****************/
506
507 if( settingsname != NULL )
508 {
509 SCIP_CALL( readParams(scip, settingsname) );
510 }
511 else if( defaultsetname != NULL )
512 {
513 SCIP_CALL( readParams(scip, defaultsetname) );
514 }
515
516 /************************************
517 * Change random seed, if specified *
518 ***********************************/
519 if( randomseedread )
520 {
521 SCIP_CALL( SCIPsetIntParam(scip, "randomization/randomseedshift", randomseed) );
522 }
523
524 /**************
525 * Start SCIP *
526 **************/
527
528 if( probname != NULL )
529 {
530 SCIP_Bool validatesolve = FALSE;
531
532 if( primalrefstring != NULL && dualrefstring != NULL )
533 {
534 char *endptr;
535 if( !SCIPisExact(scip) )
536 {
537 if( ! SCIPparseReal(scip, primalrefstring, &primalreference, &endptr) ||
538 ! SCIPparseReal(scip, dualrefstring, &dualreference, &endptr) )
539 {
540 printf("error parsing primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
541 return SCIP_ERROR;
542 }
543 else
544 validatesolve = TRUE;
545 }
546 else
547 {
548 SCIP_Bool error;
549
550 SCIP_CALL( SCIPrationalCreateBlock(SCIPblkmem(scip), &primalreferencerational) );
551 SCIP_CALL( SCIPrationalCreateBlock(SCIPblkmem(scip), &dualreferencerational) );
552
553 error = !SCIPparseRational(scip, primalrefstring, primalreferencerational, &endptr) ||
554 !SCIPparseRational(scip, primalrefstring, dualreferencerational, &endptr);
555 if( error )
556 {
557 printf("error parsing exact primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
558 return SCIP_ERROR;
559 }
560 else
561 validatesolve = TRUE;
562 }
563 }
564 SCIP_CALL( fromCommandLine(scip, probname) );
565
566 /* validate the solve */
567 if( validatesolve )
568 {
569 if( !SCIPisExact(scip) )
570 {
571 SCIP_CALL( SCIPvalidateSolve(scip, primalreference, dualreference, SCIPfeastol(scip), FALSE, NULL, NULL, NULL) );
572 }
573 else
574 {
575 SCIP_CALL( SCIPvalidateSolveExact(scip, primalreferencerational, dualreferencerational, FALSE, NULL, NULL, NULL) );
576 SCIPrationalFreeBlock(SCIPblkmem(scip), &dualreferencerational);
577 SCIPrationalFreeBlock(SCIPblkmem(scip), &primalreferencerational);
578 }
579 }
580 }
581 else
582 {
583 SCIPinfoMessage(scip, NULL, "\n");
585 }
586 }
587 else
588 {
589 printf("\nsyntax: %s [-l <logfile>] [-q] [-s <settings>] [-r <randseed>] [-f <problem>] [-b <batchfile>] [-c \"command\"]\n"
590 " -v, --version : print version and build options\n"
591 " -l <logfile> : copy output into log file\n"
592 " -q : suppress screen messages\n"
593 " -s <settings> : load parameter settings (.set) file\n"
594 " -f <problem> : load and solve problem file\n"
595 " -o <primref> <dualref> : pass primal and dual objective reference values for validation at the end of the solve\n"
596 " -b <batchfile>: load and execute dialog command batch file (can be used multiple times)\n"
597 " -r <randseed> : nonnegative integer to be used as random seed. "
598 "Has priority over random seed specified through parameter settings (.set) file\n"
599 " -c \"command\" : execute single line of dialog commands (can be used multiple times)\n",
600 argv[0]);
601#ifdef SCIP_WITH_AMPL
602 printf("\nas AMPL solver: %s <.nl-file without the .nl> -AMPL [-i]\n"
603 " -i : start interactive SCIP shell after .nl file has been read\n",
604 argv[0]);
605#endif
606 printf("\n");
607 }
608
609 return SCIP_OKAY;
610}
611
612/** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
613 * and frees the SCIP instance
614 */
616 int argc, /**< number of shell parameters */
617 char** argv, /**< array with shell parameters */
618 const char* defaultsetname /**< name of default settings file */
619 )
620{
621 SCIP* scip = NULL;
622
623 /*********
624 * Setup *
625 *********/
626
627 /* initialize SCIP */
629
630 /* we explicitly enable the use of a debug solution for this main SCIP instance */
632
633 /* include default SCIP plugins */
635
636 /**********************************
637 * Process command line arguments *
638 **********************************/
639
640 SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
641
642 /********************
643 * Deinitialization *
644 ********************/
646
648
649 return SCIP_OKAY;
650}
#define NULL
Definition: def.h:248
#define SCIP_MAXSTRLEN
Definition: def.h:269
#define SCIP_Bool
Definition: def.h:91
#define SCIP_Real
Definition: def.h:156
#define SCIP_UNKNOWN
Definition: def.h:179
#define TRUE
Definition: def.h:93
#define FALSE
Definition: def.h:94
#define SCIP_CALL(x)
Definition: def.h:355
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:397
static SCIP_RETCODE interactive(SCIP *scip)
Definition: cmain.c:99
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
Definition: fileio.c:153
int SCIPfeof(SCIP_FILE *stream)
Definition: fileio.c:227
int SCIPfclose(SCIP_FILE *fp)
Definition: fileio.c:232
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
Definition: fileio.c:200
void SCIPenableDebugSol(SCIP *scip)
Definition: scip_debug.c:58
SCIP_Bool SCIPfileExists(const char *filename)
Definition: misc.c:11057
SCIP_RETCODE SCIPfree(SCIP **scip)
Definition: scip_general.c:402
SCIP_RETCODE SCIPcreate(SCIP **scip)
Definition: scip_general.c:370
SCIP_RETCODE SCIPreadProb(SCIP *scip, const char *filename, const char *extension)
Definition: scip_prob.c:341
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
Definition: scip_message.c:208
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
Definition: scip_message.c:225
void SCIPsetMessagehdlrLogfile(SCIP *scip, const char *filename)
Definition: scip_message.c:96
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
Definition: scip_message.c:108
void SCIPprintBuildOptions(SCIP *scip, FILE *file)
Definition: scip_general.c:201
void SCIPprintVersion(SCIP *scip, FILE *file)
Definition: scip_general.c:169
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
Definition: scip_param.c:250
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 SCIPreadParams(SCIP *scip, const char *filename)
Definition: scip_param.c:772
SCIP_RETCODE SCIPwriteParams(SCIP *scip, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
Definition: scip_param.c:813
SCIP_RETCODE SCIPsetParam(SCIP *scip, const char *name, const char *value)
Definition: scip_param.c:753
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
Definition: scip_param.c:345
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
Definition: scip_param.c:57
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
Definition: scip_dialog.c:242
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
Definition: scip_dialog.c:192
SCIP_Bool SCIPisExact(SCIP *scip)
Definition: scip_exact.c:193
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
Definition: scip_general.c:825
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:57
#define SCIPfreeBufferArray(scip, ptr)
Definition: scip_mem.h:136
#define SCIPduplicateBufferArray(scip, ptr, source, num)
Definition: scip_mem.h:132
SCIP_RETCODE SCIPrationalCreateBlock(BMS_BLKMEM *blkmem, SCIP_RATIONAL **rational)
Definition: rational.cpp:108
void SCIPrationalFreeBlock(BMS_BLKMEM *mem, SCIP_RATIONAL **rational)
Definition: rational.cpp:461
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition: scip_sol.c:2981
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
Definition: scip_sol.c:884
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
Definition: scip_sol.c:3047
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
Definition: scip_sol.c:1252
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip_sol.c:2349
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition: scip_sol.c:3182
SCIP_RETCODE SCIPprintSolExact(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition: scip_sol.c:2424
SCIP_Bool SCIPsolIsExact(SCIP_SOL *sol)
Definition: sol.c:4150
SCIP_RETCODE SCIPsolve(SCIP *scip)
Definition: scip_solve.c:2635
SCIP_RETCODE SCIPprintStatistics(SCIP *scip, FILE *file)
SCIP_Bool SCIPparseRational(SCIP *scip, const char *str, SCIP_RATIONAL *value, char **endptr)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
SCIP_RETCODE SCIPvalidateSolveExact(SCIP *scip, SCIP_RATIONAL *primalreference, SCIP_RATIONAL *dualreference, SCIP_Bool quiet, SCIP_Bool *feasible, SCIP_Bool *primalboundcheck, SCIP_Bool *dualboundcheck)
SCIP_RETCODE SCIPvalidateSolve(SCIP *scip, SCIP_Real primalreference, SCIP_Real dualreference, SCIP_Real reftol, SCIP_Bool quiet, SCIP_Bool *feasible, SCIP_Bool *primalboundcheck, SCIP_Bool *dualboundcheck)
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10827
void SCIPprintSysError(const char *message)
Definition: misc.c:10719
#define BMScheckEmptyMemory()
Definition: memory.h:155
default message handler
struct SCIP_File SCIP_FILE
Definition: pub_fileio.h:43
#define SCIPerrorMessage
Definition: pub_message.h:64
wrapper for rational number arithmetic
SCIP_RETCODE SCIPwriteSolutionNl(SCIP *scip)
Definition: reader_nl.cpp:3255
AMPL .nl file reader and writer.
SCIP callable library.
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
default SCIP plugins
SCIP_RETCODE SCIPrunShell(int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:615
static SCIP_RETCODE fromCommandLine(SCIP *scip, const char *filename)
Definition: scipshell.c:66
static SCIP_RETCODE fromAmpl(SCIP *scip, char *nlfilename, SCIP_Bool interactive, const char *defaultsetname)
Definition: scipshell.c:167
static SCIP_RETCODE readParams(SCIP *scip, const char *filename)
Definition: scipshell.c:49
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
Definition: scipshell.c:288
SCIP command line interface.
@ SCIP_VERBLEVEL_HIGH
Definition: type_message.h:61
@ SCIP_NOFILE
Definition: type_retcode.h:47
@ SCIP_READERROR
Definition: type_retcode.h:45
@ SCIP_PLUGINNOTFOUND
Definition: type_retcode.h:54
@ SCIP_OKAY
Definition: type_retcode.h:42
@ SCIP_ERROR
Definition: type_retcode.h:43
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:63