40 while ( filename[i] != 0)
45 if ( l > 3 && filename[l-3] ==
'.' && filename[l-2] ==
'g' && filename[l-1] ==
'z' )
52 while (i > 0 && filename[i] !=
'.' && filename[i] !=
'/')
57 if ( filename[i] ==
'.' )
60 while ( i > 0 && filename[i] !=
'/' )
65 if ( filename[i] ==
'/' )
70 while ( i < l && filename[i] != 0 )
72 probname[j++] = filename[i++];
89 const char** filename,
90 const char** settingsname,
104 assert( argv !=
NULL );
105 assert( filename !=
NULL );
106 assert( settingsname !=
NULL );
107 assert( timelimit !=
NULL );
108 assert( memlimit !=
NULL );
109 assert( nodelimit !=
NULL );
110 assert( dispfreq !=
NULL );
114 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]);
117 (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]);
125 *settingsname =
NULL;
129 for (i = 1; i < argc; ++i)
132 if ( strcmp(argv[i],
"-s") == 0 )
134 if ( *settingsname !=
NULL )
136 (void) fprintf(stderr,
"Error: Setting name already supplied.\n");
137 (void) fprintf(stderr,
"%s\n", usage);
142 fprintf(stderr,
"Error: No setting file name supplied.\n");
143 fprintf(stderr,
"%s\n", usage);
147 *settingsname = argv[i];
153 if ( strcmp(argv[i],
"-t") == 0 )
157 fprintf(stderr,
"Erro: No time limit supplied.\n");
158 fprintf(stderr,
"%s\n", usage);
162 *timelimit = atof(argv[i]);
168 if ( strcmp(argv[i],
"-m") == 0 )
172 fprintf(stderr,
"Error: No memory limit supplied.\n");
173 fprintf(stderr,
"%s\n", usage);
177 *memlimit = atof(argv[i]);
183 if ( strcmp(argv[i],
"-n") == 0 )
187 fprintf(stderr,
"Error: No node limit supplied.\n");
188 fprintf(stderr,
"%s\n", usage);
192 *nodelimit = atol(argv[i]);
198 if ( strcmp(argv[i],
"-d") == 0 )
202 fprintf(stderr,
"Error: No display frequency supplied.\n");
203 fprintf(stderr,
"%s\n", usage);
207 *dispfreq = atoi(argv[i]);
213 if ( *filename !=
NULL )
215 fprintf(stderr,
"Error: file name already specified.\n");
216 fprintf(stderr,
"%s\n", usage);
227 if ( *filename ==
NULL )
229 fprintf(stderr,
"Error: No filename supplied.\n");
230 fprintf(stderr,
"%s\n", usage);
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE readArguments(int argc, char **argv, const char **filename, const char **settingsname, SCIP_Real *timelimit, SCIP_Real *memlimit, SCIP_Longint *nodelimit, int *dispfreq)
read comand line arguments
int getProblemName(const char *filename, char *probname, int maxsize)