SCIP Doxygen Documentation
Loading...
Searching...
No Matches
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-2026 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
252 if( interactive )
253 {
254 char readcommand[SCIP_MAXSTRLEN+6];
255
256 (void) SCIPsnprintf(readcommand, (int)sizeof(readcommand), "read %s", fullnlfilename);
257 SCIP_CALL( SCIPaddDialogInputLine(scip, readcommand) );
258
260 }
261 else
262 {
263 SCIPinfoMessage(scip, NULL, "read problem <%s>\n", fullnlfilename);
264 SCIPinfoMessage(scip, NULL, "============\n\n");
265
266 SCIP_CALL( SCIPreadProb(scip, fullnlfilename, "nl") );
267
268 SCIPinfoMessage(scip, NULL, "\nsolve problem\n");
269 SCIPinfoMessage(scip, NULL, "=============\n\n");
270
272 }
273
274 SCIP_CALL( SCIPgetBoolParam(scip, "display/statistics", &printstat) );
275 if( printstat )
276 {
277 SCIPinfoMessage(scip, NULL, "\nStatistics\n");
278 SCIPinfoMessage(scip, NULL, "==========\n\n");
279
281 }
282
284 {
286 }
287
288 return SCIP_OKAY;
289
290#else /* SCIP_WITH_AMPL */
291 SCIPerrorMessage("SCIP has been compiled without AMPL support.\n");
292 return SCIP_PLUGINNOTFOUND;
293#endif
294}
295
296/** evaluates command line parameters and runs SCIP appropriately in the given SCIP instance */
298 SCIP* scip, /**< SCIP data structure */
299 int argc, /**< number of shell parameters */
300 char** argv, /**< array with shell parameters */
301 const char* defaultsetname /**< name of default settings file */
302 )
303{ /*lint --e{850}*/
304 char* probname = NULL;
305 char* settingsname = NULL;
306 char* logname = NULL;
307 int randomseed;
308 SCIP_Bool randomseedread;
309 SCIP_Bool quiet;
310 SCIP_Bool paramerror;
312 SCIP_Bool onlyversion;
313 SCIP_Real primalreference = SCIP_UNKNOWN;
314 SCIP_Real dualreference = SCIP_UNKNOWN;
315 SCIP_RATIONAL* primalreferencerational = NULL;
316 SCIP_RATIONAL* dualreferencerational = NULL;
317 const char* dualrefstring;
318 const char* primalrefstring;
319 int i;
320
321 /********************
322 * Parse parameters *
323 ********************/
324
325 /* recognize and handle case where we were called from AMPL first */
326 if( argc >= 3 && strcmp(argv[2], "-AMPL") == 0 )
327 {
328 /* check for optional argument -i after -AMPL */
329 interactive = argc >= 4 && strcmp(argv[3], "-i") == 0;
330
331 SCIP_CALL( fromAmpl(scip, argv[1], interactive, defaultsetname) );
332
333 return SCIP_OKAY;
334 }
335
336 quiet = FALSE;
337 paramerror = FALSE;
339 onlyversion = FALSE;
340 randomseedread = FALSE;
341 randomseed = 0;
342 primalrefstring = NULL;
343 dualrefstring = NULL;
344
345 for( i = 1; i < argc; ++i )
346 {
347 if( strcmp(argv[i], "-l") == 0 )
348 {
349 i++;
350 if( i < argc )
351 logname = argv[i];
352 else
353 {
354 printf("missing log filename after parameter '-l'\n");
355 paramerror = TRUE;
356 }
357 }
358 else if( strcmp(argv[i], "-q") == 0 )
359 quiet = TRUE;
360 else if( strcmp(argv[i], "-v") == 0 )
361 onlyversion = TRUE;
362 else if( strcmp(argv[i], "--version") == 0 )
363 onlyversion = TRUE;
364 else if( strcmp(argv[i], "-s") == 0 )
365 {
366 i++;
367 if( i < argc )
368 settingsname = argv[i];
369 else
370 {
371 printf("missing settings filename after parameter '-s'\n");
372 paramerror = TRUE;
373 }
374 }
375 else if( strcmp(argv[i], "-f") == 0 )
376 {
377 i++;
378 if( i < argc )
379 probname = argv[i];
380 else
381 {
382 printf("missing problem filename after parameter '-f'\n");
383 paramerror = TRUE;
384 }
385 }
386 else if( strcmp(argv[i], "-c") == 0 )
387 {
388 i++;
389 if( i < argc )
390 {
393 }
394 else
395 {
396 printf("missing command line after parameter '-c'\n");
397 paramerror = TRUE;
398 }
399 }
400 else if( strcmp(argv[i], "-b") == 0 )
401 {
402 i++;
403 if( i < argc )
404 {
405 SCIP_FILE* file;
406
407 file = SCIPfopen(argv[i], "r");
408 if( file == NULL )
409 {
410 printf("cannot read command batch file <%s>\n", argv[i]);
411 SCIPprintSysError(argv[i]);
412 paramerror = TRUE;
413 }
414 else
415 {
416 while( !SCIPfeof(file) )
417 {
418 char buffer[SCIP_MAXSTRLEN];
419
420 (void)SCIPfgets(buffer, (int) sizeof(buffer), file);
421 if( buffer[0] != '\0' )
422 {
424 }
425 }
426 SCIPfclose(file);
428 }
429 }
430 else
431 {
432 printf("missing command batch filename after parameter '-b'\n");
433 paramerror = TRUE;
434 }
435 }
436 else if( strcmp(argv[i], "-r") == 0 )
437 {
438 /*read a random seed from the command line */
439 i++;
440 if( i < argc && isdigit((unsigned char)argv[i][0]) )
441 {
442 randomseed = atoi(argv[i]);
443 randomseedread = TRUE;
444 }
445 else
446 {
447 printf("Random seed parameter '-r' followed by something that is not an integer\n");
448 paramerror = TRUE;
449 }
450 }
451 else if( strcmp(argv[i], "-o") == 0 )
452 {
453 if( i >= argc - 2 )
454 {
455 printf("wrong usage of reference objective parameter '-o': -o <primref> <dualref>\n");
456 paramerror = TRUE;
457 }
458 else
459 {
460 /* do not parse the strings directly, the settings could still influence the value of +-infinity */
461 primalrefstring = argv[i + 1];
462 dualrefstring = argv[i+2];
463 }
464 i += 2;
465 }
466 else
467 {
468 printf("invalid parameter <%s>\n", argv[i]);
469 paramerror = TRUE;
470 }
471 }
472
473 if( interactive && probname != NULL )
474 {
475 printf("cannot mix batch mode '-c' and '-b' with file mode '-f'\n");
476 paramerror = TRUE;
477 }
478
479 if( !paramerror )
480 {
481 /***********************************
482 * create log file message handler *
483 ***********************************/
484
485 if( quiet )
486 {
488 }
489
490 if( logname != NULL )
491 {
493 }
494
495 /***********************************
496 * Version and library information *
497 ***********************************/
498
500 SCIPinfoMessage(scip, NULL, "\n");
501
503 SCIPinfoMessage(scip, NULL, "\n");
504
505 if( onlyversion )
506 {
508 SCIPinfoMessage(scip, NULL, "\n");
509 return SCIP_OKAY;
510 }
511
512 /*****************
513 * Load settings *
514 *****************/
515
516 if( settingsname != NULL )
517 {
518 SCIP_CALL( readParams(scip, settingsname) );
519 }
520 else if( defaultsetname != NULL )
521 {
522 SCIP_CALL( readParams(scip, defaultsetname) );
523 }
524
525 /************************************
526 * Change random seed, if specified *
527 ***********************************/
528 if( randomseedread )
529 {
530 SCIP_CALL( SCIPsetIntParam(scip, "randomization/randomseedshift", randomseed) );
531 }
532
533 /**************
534 * Start SCIP *
535 **************/
536
537 if( probname != NULL )
538 {
539 SCIP_Bool validatesolve = FALSE;
540
541 if( primalrefstring != NULL && dualrefstring != NULL )
542 {
543 char *endptr;
544 if( !SCIPisExact(scip) )
545 {
546 if( ! SCIPparseReal(scip, primalrefstring, &primalreference, &endptr) ||
547 ! SCIPparseReal(scip, dualrefstring, &dualreference, &endptr) )
548 {
549 printf("error parsing primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
550 return SCIP_ERROR;
551 }
552 else
553 validatesolve = TRUE;
554 }
555 else
556 {
557 SCIP_Bool error;
558
559 SCIP_CALL( SCIPrationalCreateBlock(SCIPblkmem(scip), &primalreferencerational) );
560 SCIP_CALL( SCIPrationalCreateBlock(SCIPblkmem(scip), &dualreferencerational) );
561
562 error = !SCIPparseRational(scip, primalrefstring, primalreferencerational, &endptr) ||
563 !SCIPparseRational(scip, primalrefstring, dualreferencerational, &endptr);
564 if( error )
565 {
566 printf("error parsing exact primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
567 return SCIP_ERROR;
568 }
569 else
570 validatesolve = TRUE;
571 }
572 }
573 SCIP_CALL( fromCommandLine(scip, probname) );
574
575 /* validate the solve */
576 if( validatesolve )
577 {
578 if( !SCIPisExact(scip) )
579 {
580 SCIP_CALL( SCIPvalidateSolve(scip, primalreference, dualreference, SCIPfeastol(scip), FALSE, NULL, NULL, NULL) );
581 }
582 else
583 {
584 SCIP_CALL( SCIPvalidateSolveExact(scip, primalreferencerational, dualreferencerational, FALSE, NULL, NULL, NULL) );
585 SCIPrationalFreeBlock(SCIPblkmem(scip), &dualreferencerational);
586 SCIPrationalFreeBlock(SCIPblkmem(scip), &primalreferencerational);
587 }
588 }
589 }
590 else
591 {
592 SCIPinfoMessage(scip, NULL, "\n");
594 }
595 }
596 else
597 {
598 printf("\nsyntax: %s [-l <logfile>] [-q] [-s <settings>] [-r <randseed>] [-f <problem>] [-b <batchfile>] [-c \"command\"]\n"
599 " -v, --version : print version and build options\n"
600 " -l <logfile> : copy output into log file\n"
601 " -q : suppress screen messages\n"
602 " -s <settings> : load parameter settings (.set) file\n"
603 " -f <problem> : load and solve problem file\n"
604 " -o <primref> <dualref> : pass primal and dual objective reference values for validation at the end of the solve\n"
605 " -b <batchfile>: load and execute dialog command batch file (can be used multiple times)\n"
606 " -r <randseed> : nonnegative integer to be used as random seed. "
607 "Has priority over random seed specified through parameter settings (.set) file\n"
608 " -c \"command\" : execute single line of dialog commands (can be used multiple times)\n",
609 argv[0]);
610#ifdef SCIP_WITH_AMPL
611 printf("\nas AMPL solver: %s <.nl-file without the .nl> -AMPL [-i]\n"
612 " -i : start interactive SCIP shell after .nl file has been read\n",
613 argv[0]);
614#endif
615 printf("\n");
616 }
617
618 return SCIP_OKAY;
619}
620
621/** creates a SCIP instance with default plugins, evaluates command line parameters, runs SCIP appropriately,
622 * and frees the SCIP instance
623 */
625 int argc, /**< number of shell parameters */
626 char** argv, /**< array with shell parameters */
627 const char* defaultsetname /**< name of default settings file */
628 )
629{
630 SCIP* scip = NULL;
631
632 /*********
633 * Setup *
634 *********/
635
636 /* initialize SCIP */
638
639 /* we explicitly enable the use of a debug solution for this main SCIP instance */
641
642 /* include default SCIP plugins */
644
645 /**********************************
646 * Process command line arguments *
647 **********************************/
648
649 SCIP_CALL( SCIPprocessShellArguments(scip, argc, argv, defaultsetname) );
650
651 /********************
652 * Deinitialization *
653 ********************/
655
657
658 return SCIP_OKAY;
659}
#define NULL
Definition def.h:255
#define SCIP_MAXSTRLEN
Definition def.h:276
#define SCIP_Bool
Definition def.h:98
#define SCIP_Real
Definition def.h:163
#define SCIP_UNKNOWN
Definition def.h:186
#define TRUE
Definition def.h:100
#define FALSE
Definition def.h:101
#define SCIP_CALL(x)
Definition def.h:362
#define SCIP_CALL_FINALLY(x, y)
Definition def.h:404
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)
SCIP_RETCODE SCIPcreate(SCIP **scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
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,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPsetMessagehdlrLogfile(SCIP *scip, const char *filename)
void SCIPsetMessagehdlrQuiet(SCIP *scip, SCIP_Bool quiet)
void SCIPprintBuildOptions(SCIP *scip, FILE *file)
void SCIPprintVersion(SCIP *scip, FILE *file)
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)
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
SCIP_Bool SCIPisExact(SCIP *scip)
Definition scip_exact.c:193
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
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:109
void SCIPrationalFreeBlock(BMS_BLKMEM *mem, SCIP_RATIONAL **rational)
Definition rational.cpp:462
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
Definition scip_sol.c:2988
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:3054
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2353
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
Definition scip_sol.c:3189
SCIP_RETCODE SCIPprintSolExact(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
Definition scip_sol.c:2428
SCIP_Bool SCIPsolIsExact(SCIP_SOL *sol)
Definition sol.c:4165
SCIP_RETCODE SCIPsolve(SCIP *scip)
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
return SCIP_OKAY
SCIPfreeSol(scip, &heurdata->sol))
#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)
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:624
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:297
SCIP command line interface.
@ SCIP_VERBLEVEL_HIGH
struct SCIP_Rational SCIP_RATIONAL
@ SCIP_NOFILE
@ SCIP_READERROR
@ SCIP_PLUGINNOTFOUND
@ SCIP_ERROR
enum SCIP_Retcode SCIP_RETCODE
struct Scip SCIP
Definition type_scip.h:39
@ SCIP_STAGE_PROBLEM
Definition type_set.h:45
struct SCIP_Sol SCIP_SOL
Definition type_sol.h:57