126 if ( bestsol ==
NULL )
171 const char* defaultsetname
178 const char* constoptions;
179 size_t nlfilenamelen;
182 "whether to print statistics on a solve",
186 "name of file to write SCIP log to (additionally to writing to stdout)",
195 constoptions = getenv(
"scip_options");
196 if( constoptions !=
NULL )
204 optionslen = strlen(constoptions);
209 optname = strtok(options,
" ");
210 optval = strtok(
NULL,
" ");
211 while( optname !=
NULL && optval !=
NULL )
216 optname = strtok(
NULL,
" ");
217 optval = strtok(
NULL,
" ");
223 if( defaultsetname !=
NULL )
235 SCIPinfoMessage(
scip,
NULL,
"user parameter file <%s> not found - using default parameters\n", defaultsetname);
246 nlfilenamelen = strlen(nlfilename);
247 if( nlfilenamelen > 3 && strcmp(nlfilename + (nlfilenamelen-3),
".nl") == 0 )
256 (void)
SCIPsnprintf(readcommand, (
int)
sizeof(readcommand),
"read %s", fullnlfilename);
301 const char* defaultsetname
304 char* probname =
NULL;
305 char* settingsname =
NULL;
306 char* logname =
NULL;
317 const char* dualrefstring;
318 const char* primalrefstring;
326 if( argc >= 3 && strcmp(argv[2],
"-AMPL") == 0 )
329 interactive = argc >= 4 && strcmp(argv[3],
"-i") == 0;
340 randomseedread =
FALSE;
342 primalrefstring =
NULL;
343 dualrefstring =
NULL;
345 for(
i = 1;
i < argc; ++
i )
347 if( strcmp(argv[
i],
"-l") == 0 )
354 printf(
"missing log filename after parameter '-l'\n");
358 else if( strcmp(argv[
i],
"-q") == 0 )
360 else if( strcmp(argv[
i],
"-v") == 0 )
362 else if( strcmp(argv[
i],
"--version") == 0 )
364 else if( strcmp(argv[
i],
"-s") == 0 )
368 settingsname = argv[
i];
371 printf(
"missing settings filename after parameter '-s'\n");
375 else if( strcmp(argv[
i],
"-f") == 0 )
382 printf(
"missing problem filename after parameter '-f'\n");
386 else if( strcmp(argv[
i],
"-c") == 0 )
396 printf(
"missing command line after parameter '-c'\n");
400 else if( strcmp(argv[
i],
"-b") == 0 )
410 printf(
"cannot read command batch file <%s>\n", argv[
i]);
420 (void)
SCIPfgets(buffer, (
int)
sizeof(buffer), file);
421 if( buffer[0] !=
'\0' )
432 printf(
"missing command batch filename after parameter '-b'\n");
436 else if( strcmp(argv[
i],
"-r") == 0 )
440 if(
i < argc && isdigit((
unsigned char)argv[
i][0]) )
442 randomseed = atoi(argv[
i]);
443 randomseedread =
TRUE;
447 printf(
"Random seed parameter '-r' followed by something that is not an integer\n");
451 else if( strcmp(argv[
i],
"-o") == 0 )
455 printf(
"wrong usage of reference objective parameter '-o': -o <primref> <dualref>\n");
461 primalrefstring = argv[
i + 1];
462 dualrefstring = argv[
i+2];
468 printf(
"invalid parameter <%s>\n", argv[
i]);
475 printf(
"cannot mix batch mode '-c' and '-b' with file mode '-f'\n");
490 if( logname !=
NULL )
516 if( settingsname !=
NULL )
520 else if( defaultsetname !=
NULL )
537 if( probname !=
NULL )
541 if( primalrefstring !=
NULL && dualrefstring !=
NULL )
549 printf(
"error parsing primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
553 validatesolve =
TRUE;
566 printf(
"error parsing exact primal and dual reference values for validation: %s %s\n", primalrefstring, dualrefstring);
570 validatesolve =
TRUE;
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",
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",
627 const char* defaultsetname
#define SCIP_CALL_FINALLY(x, y)
static SCIP_RETCODE interactive(SCIP *scip)
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
int SCIPfeof(SCIP_FILE *stream)
int SCIPfclose(SCIP_FILE *fp)
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
void SCIPenableDebugSol(SCIP *scip)
SCIP_Bool SCIPfileExists(const char *filename)
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)
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)
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)
SCIP_RETCODE SCIPsetIntParam(SCIP *scip, const char *name, int value)
SCIP_RETCODE SCIPreadParams(SCIP *scip, const char *filename)
SCIP_RETCODE SCIPwriteParams(SCIP *scip, const char *filename, SCIP_Bool comments, SCIP_Bool onlychanged)
SCIP_RETCODE SCIPsetParam(SCIP *scip, const char *name, const char *value)
SCIP_RETCODE SCIPgetStringParam(SCIP *scip, const char *name, char **value)
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)
SCIP_RETCODE SCIPstartInteraction(SCIP *scip)
SCIP_RETCODE SCIPaddDialogInputLine(SCIP *scip, const char *inputline)
SCIP_Bool SCIPisExact(SCIP *scip)
void SCIPprintExternalCodes(SCIP *scip, FILE *file)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
SCIP_RETCODE SCIPrationalCreateBlock(BMS_BLKMEM *blkmem, SCIP_RATIONAL **rational)
void SCIPrationalFreeBlock(BMS_BLKMEM *mem, SCIP_RATIONAL **rational)
SCIP_SOL * SCIPgetBestSol(SCIP *scip)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
SCIP_RETCODE SCIPprintBestSol(SCIP *scip, FILE *file, SCIP_Bool printzeros)
SCIP_RETCODE SCIPprintSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
SCIP_RETCODE SCIPretransformSol(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPprintSolExact(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
SCIP_Bool SCIPsolIsExact(SCIP_SOL *sol)
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,...)
void SCIPprintSysError(const char *message)
SCIPfreeSol(scip, &heurdata->sol))
#define BMScheckEmptyMemory()
struct SCIP_File SCIP_FILE
wrapper for rational number arithmetic
SCIP_RETCODE SCIPwriteSolutionNl(SCIP *scip)
AMPL .nl file reader and writer.
SCIP_RETCODE SCIPincludeDefaultPlugins(SCIP *scip)
SCIP_RETCODE SCIPrunShell(int argc, char **argv, const char *defaultsetname)
static SCIP_RETCODE fromCommandLine(SCIP *scip, const char *filename)
static SCIP_RETCODE fromAmpl(SCIP *scip, char *nlfilename, SCIP_Bool interactive, const char *defaultsetname)
static SCIP_RETCODE readParams(SCIP *scip, const char *filename)
SCIP_RETCODE SCIPprocessShellArguments(SCIP *scip, int argc, char **argv, const char *defaultsetname)
SCIP command line interface.
struct SCIP_Rational SCIP_RATIONAL
enum SCIP_Retcode SCIP_RETCODE