49 while ( filename[i] != 0)
54 if ( l > 3 && filename[l-3] ==
'.' && filename[l-2] ==
'g' && filename[l-1] ==
'z' )
61 while (i > 0 && filename[i] !=
'.' && filename[i] !=
'/')
66 if ( filename[i] ==
'.' )
69 while ( i > 0 && filename[i] !=
'/' )
74 if ( filename[i] ==
'/' )
79 while ( i < l && filename[i] != 0 )
81 probname[j++] = filename[i++];
98 const char** filename,
99 const char** settingsname,
113 assert( argv !=
NULL );
114 assert( filename !=
NULL );
115 assert( settingsname !=
NULL );
116 assert( timelimit !=
NULL );
117 assert( memlimit !=
NULL );
118 assert( nodelimit !=
NULL );
119 assert( dispfreq !=
NULL );
123 status =
SCIPsnprintf(usage,
SCIP_MAXSTRLEN,
"usage: %s <file> [-s <setting file>] [-t <time limit>] [-m <mem limit>] [-n <node limit>] [-d <display frequency>]", argv[0]);
126 (void)
SCIPsnprintf(usage,
SCIP_MAXSTRLEN,
"usage: %s <file> [-s <setting file>] [-t <time limit>] [-m <mem limit>] [-n <node limit>] [-d <display frequency>]", argv[0]);
134 *settingsname =
NULL;
138 for (i = 1; i < argc; ++i)
141 if ( strcmp(argv[i],
"-s") == 0 )
143 if ( *settingsname !=
NULL )
145 (void) fprintf(stderr,
"Error: Setting name already supplied.\n");
146 (void) fprintf(stderr,
"%s\n", usage);
151 fprintf(stderr,
"Error: No setting file name supplied.\n");
152 fprintf(stderr,
"%s\n", usage);
156 *settingsname = argv[i];
162 if ( strcmp(argv[i],
"-t") == 0 )
166 fprintf(stderr,
"Erro: No time limit supplied.\n");
167 fprintf(stderr,
"%s\n", usage);
171 *timelimit = atof(argv[i]);
177 if ( strcmp(argv[i],
"-m") == 0 )
181 fprintf(stderr,
"Error: No memory limit supplied.\n");
182 fprintf(stderr,
"%s\n", usage);
186 *memlimit = atof(argv[i]);
192 if ( strcmp(argv[i],
"-n") == 0 )
196 fprintf(stderr,
"Error: No node limit supplied.\n");
197 fprintf(stderr,
"%s\n", usage);
201 *nodelimit = atol(argv[i]);
207 if ( strcmp(argv[i],
"-d") == 0 )
211 fprintf(stderr,
"Error: No display frequency supplied.\n");
212 fprintf(stderr,
"%s\n", usage);
216 *dispfreq = atoi(argv[i]);
222 if ( *filename !=
NULL )
224 fprintf(stderr,
"Error: file name already specified.\n");
225 fprintf(stderr,
"%s\n", usage);
236 if ( *filename ==
NULL )
238 fprintf(stderr,
"Error: No filename supplied.\n");
239 fprintf(stderr,
"%s\n", usage);
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_RETCODE readArguments(int argc, char **argv, const char **filename, const char **settingsname, SCIP_Real *timelimit, SCIP_Real *memlimit, SCIP_Longint *nodelimit, int *dispfreq)
int getProblemName(const char *filename, char *probname, int maxsize)
read comand line arguments
enum SCIP_Retcode SCIP_RETCODE