Scippy

SCIP

Solving Constraint Integer Programs

reader_tim.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-2022 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not visit scipopt.org. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file reader_tim.c
17  * @ingroup DEFPLUGINS_READER
18  * @brief TIM file reader - the stage information for a stochastic programming instance in SMPS format
19  * @author Stephen J. Maher
20  */
21 
22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
23 
24 #include "scip/pub_cons.h"
25 #include "scip/pub_fileio.h"
26 #include "scip/pub_message.h"
27 #include "scip/pub_misc.h"
28 #include "scip/pub_reader.h"
29 #include "scip/reader_cor.h"
30 #include "scip/reader_tim.h"
31 #include "scip/scip_mem.h"
32 #include "scip/scip_message.h"
33 #include "scip/scip_numerics.h"
34 #include "scip/scip_prob.h"
35 #include "scip/scip_reader.h"
36 #include <string.h>
37 
38 #define READER_NAME "timreader"
39 #define READER_DESC "file reader for the TIME file of a stochastic program in SMPS format"
40 #define READER_EXTENSION "tim"
41 
42 /*
43  * tim reader internal methods
44  */
45 
46 #define TIM_MAX_LINELEN 1025
47 #define TIM_MAX_NAMELEN 256
48 #define TIM_DEFAULT_STAGESIZE 10
49 #define TIM_DEFAULT_ARRAYSIZE 100
50 
51 #define BLANK ' '
52 
53 struct TimStage
54 {
59  int nvars;
60  int nconss;
61  int varssize;
62  int conssize;
63 };
64 typedef struct TimStage TIMSTAGE;
65 
66 /** TIM reading data */
67 struct SCIP_ReaderData
68 {
69  SCIP_Bool read; /**< flag to indicate whether the time file has been read */
70  int nstages; /**< the number of stages in the stochastic program */
71  const char** stagestartvars; /**< the variables that start each stage */
72  const char** stagestartcons; /**< the constraints that start each stage */
73  const char** stagenames; /**< the name of the stage */
74  TIMSTAGE** stages; /**< the stages for the stochastic program */
75 };
76 
77 /** enum containing all tim sections */
79 {
83 };
84 typedef enum TimSection TIMSECTION;
85 
86 /** tim input structure */
87 struct TimInput
88 {
91  int lineno;
93  char buf[TIM_MAX_LINELEN];
94  const char* f0;
95  const char* f1;
96  const char* f2;
97  const char* f3;
98  char probname[TIM_MAX_NAMELEN];
99  const char** stagestartvars;
100  const char** stagestartcons;
101  const char** stagenames;
102  int nstages;
104 };
105 typedef struct TimInput TIMINPUT;
106 
107 /** adds the variable to the given stage */
108 static
110  SCIP* scip, /**< SCIP data structure */
111  TIMSTAGE* stage, /**< the stage structure */
112  const char* varname /**< the name of the variable to add to the stage */
113  )
114 {
115  SCIP_VAR* var;
116 
117  assert(scip != NULL);
118  assert(stage != NULL);
119 
120  var = SCIPfindVar(scip, varname);
121 
122  if( var == NULL )
123  {
124  SCIPwarningMessage(scip, "This is an error. All variables should in the problem.\n");
125  return SCIP_OKAY;
126  }
127 
128  /* adding the variable to the hashmap */
129  SCIP_CALL( SCIPhashmapInsert(stage->varnametovar, (void*) varname, var) );
130 
131  /* adding the variable to the variable storage */
132  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &stage->vars, &stage->varssize, stage->nvars + 1) );
133  stage->vars[stage->nvars] = var;
134  stage->nvars++;
135 
136  return SCIP_OKAY;
137 }
138 
139 /** adds the constraint to the given stage */
140 static
142  SCIP* scip, /**< SCIP data structure */
143  TIMSTAGE* stage, /**< the stage structure */
144  const char* consname /**< the name of the constraint to add to the stage */
145  )
146 {
147  SCIP_CONS* cons;
148 
149  assert(scip != NULL);
150  assert(stage != NULL);
151 
152  cons = SCIPfindCons(scip, consname);
153 
154  if( cons == NULL )
155  {
156  SCIPwarningMessage(scip, "This is an error. All constraints should in the problem.\n");
157  return SCIP_OKAY;
158  }
159 
160  /* adding the constraint to the hashmap */
161  SCIP_CALL( SCIPhashmapInsert(stage->consnametocons, (void*) consname, cons) );
162 
163  /* adding the constraint to the constraint storage */
164  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &stage->conss, &stage->conssize, stage->nconss + 1) );
165  stage->conss[stage->nconss] = cons;
166  stage->nconss++;
167 
168  return SCIP_OKAY;
169 }
170 
171 /** creates the stage data */
172 static
174  SCIP* scip, /**< SCIP data structure */
175  SCIP_READER* reader, /**< the reader structure */
176  SCIP_READER* correader /**< the reader structure for the core file */
177  )
178 {
179  SCIP_READERDATA* readerdata;
180  int stage;
181  int i;
182 
183  assert(scip != NULL);
184  assert(reader != NULL);
185  assert(correader != NULL);
186 
187  readerdata = SCIPreaderGetData(reader);
188  assert(readerdata != NULL);
189 
190  stage = 0;
191 
192  /* assigning the variables to the stages */
193  for( i = 0; i < SCIPcorGetNVarNames(correader); i++ )
194  {
195  /* the first variable in the var names list should be the start of the first stage */
196  assert((stage == 0 && i == 0 && strcmp(SCIPcorGetVarName(correader, i), readerdata->stagestartvars[stage]) == 0)
197  || i > 0);
198  /* checking whether the next stage has been found */
199  if( i > 0 && stage < readerdata->nstages - 1
200  && strcmp(SCIPcorGetVarName(correader, i), readerdata->stagestartvars[stage + 1]) == 0 )
201  stage++;
202 
203  /* adding the variable to the stage */
204  SCIP_CALL( addVariableToStage(scip, readerdata->stages[stage], SCIPcorGetVarName(correader, i)) );
205  }
206 
207  stage = 0;
208 
209  /* assigning the constraint to the stages */
210  for( i = 0; i < SCIPcorGetNConsNames(correader); i++ )
211  {
212  /* checking whether the next stage has been found */
213  if( i > 0 && stage < readerdata->nstages - 1
214  && strcmp(SCIPcorGetConsName(correader, i), readerdata->stagestartcons[stage + 1]) == 0 )
215  stage++;
216 
217  /* adding the consiable to the stage */
218  SCIP_CALL( addConstraintToStage(scip, readerdata->stages[stage], SCIPcorGetConsName(correader, i)) );
219  }
220 
221  return SCIP_OKAY;
222 }
223 
224 /** creates the reader data for the time input data */
225 static
227  SCIP* scip, /**< SCIP data structure */
228  SCIP_READER* reader, /**< the reader structure */
229  TIMINPUT* timi /**< tim input structure */
230  )
231 {
232  SCIP_READERDATA* readerdata;
233  int hashmapsize;
234  int nvars;
235  int i;
236 
237  assert(scip != NULL);
238  assert(reader != NULL);
239  assert(timi != NULL);
240 
241  readerdata = SCIPreaderGetData(reader);
242 
243  assert(readerdata != NULL);
244 
245  /* getting the total number of variables in the problem. The hash maps will be of size nvars/nstages. */
246  nvars = SCIPgetNVars(scip);
247 
248  readerdata->read = TRUE;
249  readerdata->nstages = timi->nstages;
250 
251  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stagestartvars, readerdata->nstages) );
252  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stagestartcons, readerdata->nstages) );
253  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stagenames, readerdata->nstages) );
254  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stages, readerdata->nstages) );
255 
256  for( i = 0; i < readerdata->nstages; i++ )
257  {
258  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &readerdata->stagestartvars[i],
259  timi->stagestartvars[i], strlen(timi->stagestartvars[i]) + 1) ); /*lint !e866*/
260  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &readerdata->stagestartcons[i],
261  timi->stagestartcons[i], strlen(timi->stagestartcons[i]) + 1) ); /*lint !e866*/
262  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &readerdata->stagenames[i],
263  timi->stagenames[i], strlen(timi->stagenames[i]) + 1) ); /*lint !e866*/
264 
265  /* creating the data for the stages */
266  SCIP_CALL( SCIPallocBlockMemory(scip, &readerdata->stages[i]) ); /*lint !e866*/
267  readerdata->stages[i]->nvars = 0;
268  readerdata->stages[i]->nconss = 0;
269  readerdata->stages[i]->varssize = TIM_DEFAULT_ARRAYSIZE;
270  readerdata->stages[i]->conssize = TIM_DEFAULT_ARRAYSIZE;
271  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stages[i]->vars, readerdata->stages[i]->varssize) ); /*lint !e866*/
272  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &readerdata->stages[i]->conss, readerdata->stages[i]->conssize) ); /*lint !e866*/
273 
274  /* creating the hashmaps */
275  hashmapsize = (int) SCIPceil(scip, (SCIP_Real) nvars/(SCIP_Real) readerdata->nstages);
276  SCIP_CALL( SCIPhashmapCreate(&readerdata->stages[i]->varnametovar, SCIPblkmem(scip), hashmapsize) );
277  SCIP_CALL( SCIPhashmapCreate(&readerdata->stages[i]->consnametocons, SCIPblkmem(scip), hashmapsize) );
278  }
279 
280  return SCIP_OKAY;
281 }
282 
283 /** free the reader data */
284 static
286  SCIP* scip, /**< SCIP data structure */
287  SCIP_READER* reader /**< the reader structure */
288  )
289 {
290  SCIP_READERDATA* readerdata;
291  int i;
292 
293  assert(scip != NULL);
294  assert(reader != NULL);
295 
296  readerdata = SCIPreaderGetData(reader);
297 
298  assert(readerdata != NULL);
299 
300  /* only free the reader data is a file has been read */
301  if( readerdata->read )
302  {
303  for( i = 0; i < readerdata->nstages; i++ )
304  {
305  /* freeing the hashmaps */
306  SCIPhashmapFree(&readerdata->stages[i]->consnametocons);
307  SCIPhashmapFree(&readerdata->stages[i]->varnametovar);
308 
309  SCIPfreeBlockMemoryArray(scip, &readerdata->stagestartvars[i], strlen(readerdata->stagestartvars[i]) + 1);
310  SCIPfreeBlockMemoryArray(scip, &readerdata->stagestartcons[i], strlen(readerdata->stagestartcons[i]) + 1);
311  SCIPfreeBlockMemoryArray(scip, &readerdata->stagenames[i], strlen(readerdata->stagenames[i]) + 1);
312 
313  /* freeing the memory for the stage data */
314  SCIPfreeBlockMemoryArray(scip, &readerdata->stages[i]->vars, readerdata->stages[i]->varssize);
315  SCIPfreeBlockMemoryArray(scip, &readerdata->stages[i]->conss, readerdata->stages[i]->conssize);
316  SCIPfreeBlockMemory(scip, &readerdata->stages[i]); /*lint !e866*/
317  }
318 
319  SCIPfreeBlockMemoryArray(scip, &readerdata->stages, readerdata->nstages);
320  SCIPfreeBlockMemoryArray(scip, &readerdata->stagenames, readerdata->nstages);
321  SCIPfreeBlockMemoryArray(scip, &readerdata->stagestartcons, readerdata->nstages);
322  SCIPfreeBlockMemoryArray(scip, &readerdata->stagestartvars, readerdata->nstages);
323  }
324 
325  SCIPfreeBlockMemory(scip, &readerdata);
326 }
327 
328 
329 /** creates the tim input structure */
330 static
332  SCIP* scip, /**< SCIP data structure */
333  TIMINPUT** timi, /**< tim input structure */
334  SCIP_FILE* fp /**< file object for the input file */
335  )
336 {
337  assert(timi != NULL);
338  assert(fp != NULL);
339 
340  SCIP_CALL( SCIPallocBlockMemory(scip, timi) );
341 
342  (*timi)->section = TIM_TIME;
343  (*timi)->fp = fp;
344  (*timi)->lineno = 0;
345  (*timi)->haserror = FALSE;
346  (*timi)->buf [0] = '\0';
347  (*timi)->probname[0] = '\0';
348  (*timi)->f0 = NULL;
349  (*timi)->f1 = NULL;
350  (*timi)->f2 = NULL;
351  (*timi)->f3 = NULL;
352  (*timi)->nstages = 0;
353  (*timi)->stagesize = TIM_DEFAULT_STAGESIZE;
354 
355  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &(*timi)->stagestartvars, (*timi)->stagesize) );
356  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &(*timi)->stagestartcons, (*timi)->stagesize) );
357  SCIP_CALL( SCIPallocBlockMemoryArray(scip, &(*timi)->stagenames, (*timi)->stagesize) );
358 
359  return SCIP_OKAY;
360 }
361 
362 /** free the tim input structure */
363 static
365  SCIP* scip, /**< SCIP data structure */
366  TIMINPUT** timi /**< tim input structure */
367  )
368 {
369  int i;
370 
371  for( i = 0; i < (*timi)->nstages; i++ )
372  {
373  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagestartvars[i], strlen((*timi)->stagestartvars[i]) + 1);
374  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagestartcons[i], strlen((*timi)->stagestartcons[i]) + 1);
375  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagenames[i], strlen((*timi)->stagenames[i]) + 1);
376  }
377 
378  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagestartvars, (*timi)->stagesize);
379  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagestartcons, (*timi)->stagesize);
380  SCIPfreeBlockMemoryArray(scip, &(*timi)->stagenames, (*timi)->stagesize);
381 
382  SCIPfreeBlockMemory(scip, timi);
383 }
384 
385 /** returns the current section */
386 static
388  const TIMINPUT* timi /**< tim input structure */
389  )
390 {
391  assert(timi != NULL);
392 
393  return timi->section;
394 }
395 
396 /** return the current value of field 0 */
397 static
398 const char* timinputField0(
399  const TIMINPUT* timi /**< tim input structure */
400  )
401 {
402  assert(timi != NULL);
403 
404  return timi->f0;
405 }
406 
407 /** return the current value of field 1 */
408 static
409 const char* timinputField1(
410  const TIMINPUT* timi /**< tim input structure */
411  )
412 {
413  assert(timi != NULL);
414 
415  return timi->f1;
416 }
417 
418 /** return the current value of field 2 */
419 static
420 const char* timinputField2(
421  const TIMINPUT* timi /**< tim input structure */
422  )
423 {
424  assert(timi != NULL);
425 
426  return timi->f2;
427 }
428 
429 /** return the current value of field 3 */
430 static
431 const char* timinputField3(
432  const TIMINPUT* timi /**< tim input structure */
433  )
434 {
435  assert(timi != NULL);
436 
437  return timi->f3;
438 }
439 
440 /** returns if an error was detected */
441 static
443  const TIMINPUT* timi /**< tim input structure */
444  )
445 {
446  assert(timi != NULL);
447 
448  return timi->haserror;
449 }
450 
451 /** set the section in the tim input structure to given section */
452 static
454  TIMINPUT* timi, /**< tim input structure */
455  TIMSECTION section /**< section that is set */
456  )
457 {
458  assert(timi != NULL);
459 
460  timi->section = section;
461 }
462 
463 /** set the problem name in the tim input structure to given problem name */
464 static
466  TIMINPUT* timi, /**< tim input structure */
467  const char* probname /**< name of the problem to set */
468  )
469 {
470  assert(timi != NULL);
471  assert(probname != NULL);
472  assert(strlen(probname) < sizeof(timi->probname));
473 
474  (void)SCIPmemccpy(timi->probname, probname, '\0', TIM_MAX_NAMELEN - 1);
475 }
476 
477 /** set the problem var name that starts a stage in the tim input structure to given objective name */
478 static
480  TIMINPUT* timi, /**< tim input structure */
481  SCIP* scip, /**< SCIP data structure */
482  const char* varname, /**< name of the variable that starts the stage */
483  int stagenum /**< the stage number the variable starts */
484  )
485 {
486  assert(timi != NULL);
487  assert(varname != NULL);
488 
489  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &timi->stagestartvars[stagenum], varname, strlen(varname) + 1) ); /*lint !e866*/
490 
491  return SCIP_OKAY;
492 }
493 
494 /** set the problem constraint name that starts a stage in the tim input structure to given objective name */
495 static
497  TIMINPUT* timi, /**< tim input structure */
498  SCIP* scip, /**< SCIP data structure */
499  const char* consname, /**< name of the constraint that starts the stage */
500  int stagenum /**< the stage number the constraint starts */
501  )
502 {
503  assert(timi != NULL);
504  assert(consname != NULL);
505 
506  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &timi->stagestartcons[stagenum], consname, strlen(consname) + 1) ); /*lint !e866*/
507 
508  return SCIP_OKAY;
509 }
510 
511 /** set the stage name in the tim input structure to given objective name */
512 static
514  TIMINPUT* timi, /**< tim input structure */
515  SCIP* scip, /**< SCIP data structure */
516  const char* stagename, /**< name of the stage */
517  int stagenum /**< the stage number the constraint starts */
518  )
519 {
520  assert(timi != NULL);
521  assert(stagename != NULL);
522 
523  SCIP_CALL( SCIPduplicateBlockMemoryArray(scip, &timi->stagenames[stagenum], stagename, strlen(stagename) + 1) ); /*lint !e866*/
524 
525  return SCIP_OKAY;
526 }
527 
528 static
530  TIMINPUT* timi /**< tim input structure */
531  )
532 {
533  assert(timi != NULL);
534 
535  SCIPerrorMessage("Syntax error in line %d\n", timi->lineno);
536  timi->section = TIM_ENDATA;
537  timi->haserror = TRUE;
538 }
539 
540 /** fill the line from \p pos up to column 80 with blanks. */
541 static
543  char* buf, /**< buffer to clear */
544  unsigned int pos /**< position to start the clearing process */
545  )
546 {
547  unsigned int i;
548 
549  for(i = pos; i < 80; i++)
550  buf[i] = BLANK;
551  buf[80] = '\0';
552 }
553 
554 /** read a tim format data line and parse the fields. */
555 static
557  TIMINPUT* timi /**< tim input structure */
558  )
559 {
560  unsigned int len;
561  unsigned int i;
562  char* s;
563  SCIP_Bool is_empty;
564  char* nexttok;
565 
566  do
567  {
568  timi->f0 = timi->f1 = timi->f2 = timi->f3 = 0;
569 
570  /* Read until we have not a comment line. */
571  do
572  {
573  timi->buf[TIM_MAX_LINELEN-1] = '\0';
574  if( NULL == SCIPfgets(timi->buf, (int) sizeof(timi->buf), timi->fp) )
575  return FALSE;
576  timi->lineno++;
577  }
578  while( *timi->buf == '*' ); /* coverity[a_loop_bound] */
579 
580  /* Normalize line */
581  len = (unsigned int) strlen(timi->buf);
582 
583  for( i = 0; i < len; i++ )
584  if( (timi->buf[i] == '\t') || (timi->buf[i] == '\n') || (timi->buf[i] == '\r') )
585  timi->buf[i] = BLANK;
586 
587  if( len < 80 )
588  clearFrom(timi->buf, len);
589 
590  SCIPdebugMessage("line %d: <%s>\n", timi->lineno, timi->buf);
591 
592  assert(strlen(timi->buf) >= 80);
593 
594  /* Look for new section */
595  if( *timi->buf != BLANK )
596  {
597  timi->f0 = SCIPstrtok(&timi->buf[0], " ", &nexttok);
598 
599  assert(timi->f0 != 0);
600 
601  timi->f1 = SCIPstrtok(NULL, " ", &nexttok);
602 
603  return TRUE;
604  }
605 
606  s = &timi->buf[1];
607 
608  /* At this point it is not clear if we have a indicator field.
609  * If there is none (e.g. empty) f1 will be the first name field.
610  * If there is one, f2 will be the first name field.
611  *
612  * Initially comment marks '$' are only allowed in the beginning
613  * of the 2nd and 3rd name field. We test all fields but the first.
614  * This makes no difference, since if the $ is at the start of a value
615  * field, the line will be erroneous anyway.
616  */
617  do
618  {
619  if( NULL == (timi->f1 = SCIPstrtok(s, " ", &nexttok)) )
620  break;
621 
622  if( (NULL == (timi->f2 = SCIPstrtok(NULL, " ", &nexttok))) || (*timi->f2 == '$') )
623  {
624  timi->f2 = 0;
625  break;
626  }
627 
628  if( (NULL == (timi->f3 = SCIPstrtok(NULL, " ", &nexttok))) || (*timi->f3 == '$') )
629  {
630  timi->f3 = 0;
631  break;
632  }
633  }
634  while( FALSE );
635 
636  /* check for empty lines */
637  is_empty = (timi->f0 == NULL && timi->f1 == NULL);
638  }
639  while( is_empty );
640 
641  return TRUE;
642 }
643 
644 /** Process TIME section. */
645 static
647  SCIP* scip, /**< SCIP data structure */
648  TIMINPUT* timi /**< tim input structure */
649  )
650 {
651  SCIPdebugMsg(scip, "read problem name from TIME section\n");
652 
653  /* This has to be the Line with the TIME section. */
654  if( !timinputReadLine(timi) || timinputField0(timi) == NULL || strcmp(timinputField0(timi), "TIME") )
655  {
656  timinputSyntaxerror(timi);
657  return SCIP_OKAY;
658  }
659 
660  /* Sometimes the name is omitted. */
661  timinputSetProbname(timi, (timinputField1(timi) == 0) ? "_TIM_" : timinputField1(timi));
662 
663  /* This has to be a new section */
664  /* coverity[tainted_data] */
665  if( !timinputReadLine(timi) || (timinputField0(timi) == NULL) )
666  {
667  timinputSyntaxerror(timi);
668  return SCIP_OKAY;
669  }
670 
671  if( strncmp(timinputField0(timi), "PERIODS", 7) == 0 )
673  else
674  {
675  timinputSyntaxerror(timi);
676  return SCIP_OKAY;
677  }
678 
679  return SCIP_OKAY;
680 }
681 
682 /** Process PERIODS section. */
683 static
685  TIMINPUT* timi, /**< tim input structure */
686  SCIP* scip /**< SCIP data structure */
687  )
688 {
689  SCIPdebugMsg(scip, "read Periods\n");
690 
691  /* coverity[tainted_data_sink_lv_call] */
692  /* coverity[tainted_data] */
693  while( timinputReadLine(timi) )
694  {
695  if( timinputField0(timi) != NULL )
696  {
697  if( strcmp(timinputField0(timi), "PERIODS") == 0 )
699  else if( strcmp(timinputField0(timi), "ENDATA") == 0 )
701  else
702  timinputSyntaxerror(timi);
703 
704  return SCIP_OKAY;
705  }
706 
707  if( timi->nstages + 1 >= timi->stagesize )
708  {
709  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagestartvars, &timi->stagesize, timi->nstages + 1) );
710  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagestartcons, &timi->stagesize, timi->nstages + 1) );
711  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagenames, &timi->stagesize, timi->nstages + 1) );
712  }
713 
714  SCIP_CALL( timinputSetStageStartVar(timi, scip, timinputField1(timi), timi->nstages) );
715  SCIP_CALL( timinputSetStageStartCons(timi, scip, timinputField2(timi), timi->nstages) );
716  SCIP_CALL( timinputSetStageName(timi, scip, timinputField3(timi), timi->nstages) );
717 
718  timi->nstages++;
719  }
720  timinputSyntaxerror(timi);
721 
722  return SCIP_OKAY;
723 }
724 
725 
726 /** Read time data for the SMPS file format. */
727 static
729  SCIP* scip, /**< SCIP data structure */
730  SCIP_READER* reader, /**< the file reader itself */
731  const char* filename /**< name of the input file */
732  )
733 {
734  SCIP_FILE* fp;
735  TIMINPUT* timi;
736  SCIP_RETCODE retcode;
737  SCIP_Bool error = TRUE;
738 
739  assert(scip != NULL);
740  assert(filename != NULL);
741 
742  fp = SCIPfopen(filename, "r");
743  if( fp == NULL )
744  {
745  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
746  SCIPprintSysError(filename);
747 
748  return SCIP_NOFILE;
749  }
750 
751  SCIP_CALL_FINALLY( timinputCreate(scip, &timi, fp), SCIPfclose(fp) );
752 
753  SCIP_CALL_TERMINATE( retcode, readTime(scip, timi), TERMINATE );
754 
755  while( timinputSection(timi) == TIM_PERIODS )
756  {
757  /* coverity[tainted_data] */
758  SCIP_CALL_TERMINATE( retcode, readPeriods(timi, scip), TERMINATE );
759  }
760  if( timinputSection(timi) != TIM_ENDATA )
761  timinputSyntaxerror(timi);
762 
763  error = timinputHasError(timi);
764 
765  if( !error )
766  {
767  SCIP_CALL_TERMINATE( retcode, createReaderdata(scip, reader, timi), TERMINATE );
768  }
769 
770  /* cppcheck-suppress unusedLabel */
771  TERMINATE:
772  timinputFree(scip, &timi);
773  SCIPfclose(fp);
774 
775  if( error )
776  return SCIP_READERROR;
777  else
778  return SCIP_OKAY;
779 }
780 
781 /*
782  * Callback methods of reader
783  */
784 
785 /** copy method for reader plugins (called when SCIP copies plugins) */
786 static
787 SCIP_DECL_READERCOPY(readerCopyTim)
788 { /*lint --e{715}*/
789  assert(scip != NULL);
790  assert(reader != NULL);
791  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
792 
793  /* call inclusion method of reader */
795 
796  return SCIP_OKAY;
797 }
798 
799 /** destructor of reader to free user data (called when SCIP is exiting) */
800 static
801 SCIP_DECL_READERFREE(readerFreeTim)
802 {
803  freeReaderdata(scip, reader);
804 
805  return SCIP_OKAY;
806 }
807 
808 /** reads the stage information for a stochastic programming instance in SMPS format */
809 static
810 SCIP_DECL_READERREAD(readerReadTim)
811 { /*lint --e{715}*/
812  SCIP_READER* correader;
813 
814  assert(reader != NULL);
815  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
816 
817  correader = SCIPfindReader(scip, "correader");
818 
819  if( correader == NULL )
820  {
821  SCIPwarningMessage(scip, "It is necessary to include the \"cor\" reader\n");
822  (*result) = SCIP_DIDNOTRUN;
823  return SCIP_OKAY;
824  }
825 
826  /* checking whether the cor file has been read */
827  if( !SCIPcorHasRead(correader) )
828  {
829  SCIPwarningMessage(scip, "The core file must be read before the time and stochastic files.\n");
830  (*result) = SCIP_DIDNOTRUN;
831  return SCIP_OKAY;
832  }
833 
834  SCIP_CALL( SCIPreadTim(scip, filename, result) );
835 
836  return SCIP_OKAY;
837 }
838 
839 
840 /*
841  * tim file reader specific interface methods
842  */
843 
844 /** includes the tim file reader in SCIP */
846  SCIP* scip /**< SCIP data structure */
847  )
848 {
849  SCIP_READERDATA* readerdata;
850  SCIP_READER* reader;
851 
852  /* create reader data */
853  SCIP_CALL( SCIPallocBlockMemory(scip, &readerdata) );
854  readerdata->read = FALSE;
855 
856  /* include reader */
858 
859  /* set non fundamental callbacks via setter functions */
860  SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyTim) );
861  SCIP_CALL( SCIPsetReaderFree(scip, reader, readerFreeTim) );
862  SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadTim) );
863 
864  return SCIP_OKAY;
865 }
866 
867 
868 /** reads problem from file */
870  SCIP* scip, /**< SCIP data structure */
871  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
872  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
873  )
874 {
875  SCIP_READER* reader;
876  SCIP_RETCODE retcode;
877  SCIP_READERDATA* readerdata;
878 
879  assert(scip != NULL);
880  assert(result != NULL);
881 
882  reader = SCIPfindReader(scip, READER_NAME);
883  assert(reader != NULL);
884 
885  retcode = readTim(scip, reader, filename);
886 
887  if( retcode == SCIP_PLUGINNOTFOUND )
888  retcode = SCIP_READERROR;
889 
890  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
891  return retcode;
892 
893  SCIP_CALL( retcode );
894 
895  /* creating the stages */
896  SCIP_CALL( createStages(scip, reader, SCIPfindReader(scip, "correader")) );
897 
898  /* setting the read flag to TRUE */
899  readerdata = SCIPreaderGetData(reader);
900  readerdata->read = TRUE;
901 
902  *result = SCIP_SUCCESS;
903 
904  return SCIP_OKAY;
905 }
906 
907 /*
908  * Interface methods for the cor and sto files
909  */
910 
911 /* return whether the tim file has been read */
913  SCIP_READER* reader /**< the file reader itself */
914  )
915 {
916  SCIP_READERDATA* readerdata;
917 
918  assert(reader != NULL);
919  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
920 
921  readerdata = SCIPreaderGetData(reader);
922  assert(readerdata != NULL);
923 
924  return readerdata->read;
925 }
926 
927 
928 /* returns the number of stages */
930  SCIP* scip /**< SCIP data structure */
931  )
932 {
933  SCIP_READER* reader;
934  SCIP_READERDATA* readerdata;
935 
936  reader = SCIPfindReader(scip, READER_NAME);
937 
938  assert(reader != NULL);
939  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
940 
941  readerdata = SCIPreaderGetData(reader);
942  assert(readerdata != NULL);
943 
944  return readerdata->nstages;
945 }
946 
947 /* returns the name for a given stage */
949  SCIP* scip, /**< SCIP data structure */
950  int stagenum /**< the number of the requested stage */
951  )
952 {
953  SCIP_READER* reader;
954  SCIP_READERDATA* readerdata;
955 
956  reader = SCIPfindReader(scip, READER_NAME);
957 
958  assert(reader != NULL);
959  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
960 
961  readerdata = SCIPreaderGetData(reader);
962  assert(readerdata != NULL);
963  assert(stagenum >= 0 && stagenum < readerdata->nstages);
964 
965  return readerdata->stagenames[stagenum];
966 }
967 
968 /* returns the stage name for a given constraint name */
970  SCIP* scip, /**< SCIP data structure */
971  const char* consname /**< the constraint to search for */
972  )
973 {
974  SCIP_READER* reader;
975  SCIP_READERDATA* readerdata;
976  int stagenum;
977  int i;
978  int j;
979 
980  reader = SCIPfindReader(scip, READER_NAME);
981 
982  assert(reader != NULL);
983  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
984 
985  readerdata = SCIPreaderGetData(reader);
986  assert(readerdata != NULL);
987 
988  /* looping over all stages to find the provided constraint */
989  stagenum = -1;
990  for( i = 0; i < readerdata->nstages; i++ )
991  {
992  for( j = 0; j < readerdata->stages[i]->nconss; j++ )
993  {
994  if( strcmp(SCIPconsGetName(readerdata->stages[i]->conss[j]), consname) == 0 )
995  {
996  stagenum = i;
997  break;
998  }
999  }
1000 
1001  if( stagenum >= 0 )
1002  break;
1003  }
1004  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1005 
1006  return readerdata->stagenames[stagenum];
1007 }
1008 
1009 /* returns the number for a given stage */
1011  SCIP* scip, /**< SCIP data structure */
1012  const char* stage /**< the name of the requested stage */
1013  )
1014 {
1015  SCIP_READER* reader;
1016  SCIP_READERDATA* readerdata;
1017  int i;
1018  int stagenum;
1019 
1020  reader = SCIPfindReader(scip, READER_NAME);
1021 
1022  assert(reader != NULL);
1023  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1024 
1025  readerdata = SCIPreaderGetData(reader);
1026  assert(readerdata != NULL);
1027 
1028  stagenum = -1;
1029  for( i = 0; i < readerdata->nstages; i++ )
1030  {
1031  if( strcmp(readerdata->stagenames[i], stage) == 0 )
1032  {
1033  stagenum = i;
1034  break;
1035  }
1036  }
1037 
1038  if( stagenum < 0 )
1039  {
1040  SCIPerrorMessage("Stage <%s> was not found in the TIM file. Check the SMPS files (COR, TIM and STO)\n", stage);
1041  SCIPABORT();
1042  }
1043 
1044  return stagenum;
1045 }
1046 
1047 /* returns the array of variables for a given stage */
1049  SCIP* scip, /**< SCIP data structure */
1050  int stagenum /**< the number of the requested stage */
1051  )
1052 {
1053  SCIP_READER* reader;
1054  SCIP_READERDATA* readerdata;
1055 
1056  reader = SCIPfindReader(scip, READER_NAME);
1057 
1058  assert(reader != NULL);
1059  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1060 
1061  readerdata = SCIPreaderGetData(reader);
1062  assert(readerdata != NULL);
1063  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1064 
1065  return readerdata->stages[stagenum]->vars;
1066 }
1067 
1068 /* returns an array of constraints for a given stage */
1070  SCIP* scip, /**< SCIP data structure */
1071  int stagenum /**< the number of the requested stage */
1072  )
1073 {
1074  SCIP_READER* reader;
1075  SCIP_READERDATA* readerdata;
1076 
1077  reader = SCIPfindReader(scip, READER_NAME);
1078 
1079  assert(reader != NULL);
1080  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1081 
1082  readerdata = SCIPreaderGetData(reader);
1083  assert(readerdata != NULL);
1084  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1085 
1086  return readerdata->stages[stagenum]->conss;
1087 }
1088 
1089 /* returns the number of variables for a given stage */
1091  SCIP* scip, /**< SCIP data structure */
1092  int stagenum /**< the number of the requested stage */
1093  )
1094 {
1095  SCIP_READER* reader;
1096  SCIP_READERDATA* readerdata;
1097 
1098  reader = SCIPfindReader(scip, READER_NAME);
1099 
1100  assert(reader != NULL);
1101  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1102 
1103  readerdata = SCIPreaderGetData(reader);
1104  assert(readerdata != NULL);
1105  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1106 
1107  return readerdata->stages[stagenum]->nvars;
1108 }
1109 
1110 /* returns the number of constraints for a given stage */
1112  SCIP* scip, /**< SCIP data structure */
1113  int stagenum /**< the number of the requested stage */
1114  )
1115 {
1116  SCIP_READER* reader;
1117  SCIP_READERDATA* readerdata;
1118 
1119  reader = SCIPfindReader(scip, READER_NAME);
1120 
1121  assert(reader != NULL);
1122  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1123 
1124  readerdata = SCIPreaderGetData(reader);
1125  assert(readerdata != NULL);
1126  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1127 
1128  return readerdata->stages[stagenum]->nconss;
1129 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:101
SCIP_RETCODE SCIPreadTim(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_tim.c:869
int lineno
Definition: reader_tim.c:91
static SCIP_DECL_READERREAD(readerReadTim)
Definition: reader_tim.c:810
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
Definition: misc.c:10639
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:84
TIM file reader - the stage information for a stochastic programming instance in SMPS format...
#define TIM_DEFAULT_STAGESIZE
Definition: reader_tim.c:48
SCIP_HASHMAP * consnametocons
Definition: reader_tim.c:58
#define TIM_MAX_LINELEN
Definition: reader_tim.c:46
public methods for memory management
static SCIP_Bool timinputHasError(const TIMINPUT *timi)
Definition: reader_tim.c:442
static const char * timinputField2(const TIMINPUT *timi)
Definition: reader_tim.c:420
SCIP_HASHMAP * varnametovar
Definition: reader_tim.c:57
static TIMSECTION timinputSection(const TIMINPUT *timi)
Definition: reader_tim.c:387
const char * SCIPcorGetVarName(SCIP_READER *reader, int i)
Definition: reader_cor.c:256
COR file reader (MPS format of the core problem for stochastic programs)
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:426
const char ** stagestartvars
Definition: reader_tim.c:99
char probname[TIM_MAX_NAMELEN]
Definition: reader_tim.c:98
const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:548
SCIP_VAR ** vars
Definition: reader_tim.c:55
static SCIP_RETCODE timinputSetStageStartVar(TIMINPUT *timi, SCIP *scip, const char *varname, int stagenum)
Definition: reader_tim.c:479
#define FALSE
Definition: def.h:87
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:3014
enum TimSection TIMSECTION
Definition: reader_tim.c:84
int nconss
Definition: reader_tim.c:60
#define TRUE
Definition: def.h:86
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
#define TIM_DEFAULT_ARRAYSIZE
Definition: reader_tim.c:49
static void freeReaderdata(SCIP *scip, SCIP_READER *reader)
Definition: reader_tim.c:285
const char ** stagenames
Definition: reader_tim.c:101
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:99
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip_reader.c:226
#define SCIPdebugMessage
Definition: pub_message.h:87
const char * SCIPtimConsGetStageName(SCIP *scip, const char *consname)
Definition: reader_tim.c:969
const char * f3
Definition: reader_tim.c:97
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:111
#define SCIPdebugMsg
Definition: scip_message.h:69
#define READER_DESC
Definition: reader_tim.c:39
public methods for numerical tolerances
#define TIM_MAX_NAMELEN
Definition: reader_tim.c:47
const char * f0
Definition: reader_tim.c:94
TIMSECTION section
Definition: reader_tim.c:89
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip_prob.c:2684
static void timinputSetProbname(TIMINPUT *timi, const char *probname)
Definition: reader_tim.c:465
SCIP_FILE * SCIPfopen(const char *path, const char *mode)
Definition: fileio.c:144
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
Definition: reader.c:483
const char * SCIPcorGetConsName(SCIP_READER *reader, int i)
Definition: reader_cor.c:274
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:96
SCIP_Bool SCIPtimHasRead(SCIP_READER *reader)
Definition: reader_tim.c:912
public methods for managing constraints
char buf[TIM_MAX_LINELEN]
Definition: reader_tim.c:93
TimSection
Definition: reader_tim.c:78
#define SCIPerrorMessage
Definition: pub_message.h:55
int nvars
Definition: reader_tim.c:59
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:48
struct SCIP_File SCIP_FILE
Definition: pub_fileio.h:34
char * SCIPfgets(char *s, int size, SCIP_FILE *stream)
Definition: fileio.c:191
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:8085
int SCIPcorGetNConsNames(SCIP_READER *reader)
Definition: reader_cor.c:240
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:3048
int SCIPtimGetNStages(SCIP *scip)
Definition: reader_tim.c:929
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip_prob.c:2946
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_CONS ** conss
Definition: reader_tim.c:56
#define SCIP_CALL(x)
Definition: def.h:384
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
Definition: scip_mem.h:98
static SCIP_DECL_READERCOPY(readerCopyTim)
Definition: reader_tim.c:787
static void clearFrom(char *buf, unsigned int pos)
Definition: reader_tim.c:542
static void timinputSyntaxerror(TIMINPUT *timi)
Definition: reader_tim.c:529
wrapper functions to map file i/o to standard or zlib file i/o
static SCIP_Bool timinputReadLine(TIMINPUT *timi)
Definition: reader_tim.c:556
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:44
#define READER_NAME
Definition: reader_tim.c:38
public data structures and miscellaneous methods
int SCIPtimFindStage(SCIP *scip, const char *stage)
Definition: reader_tim.c:1010
#define SCIP_Bool
Definition: def.h:84
static SCIP_RETCODE addConstraintToStage(SCIP *scip, TIMSTAGE *stage, const char *consname)
Definition: reader_tim.c:141
SCIP_RETCODE SCIPincludeReaderBasic(SCIP *scip, SCIP_READER **readerptr, const char *name, const char *desc, const char *extension, SCIP_READERDATA *readerdata)
Definition: scip_reader.c:100
void SCIPprintSysError(const char *message)
Definition: misc.c:10664
static const char * timinputField3(const TIMINPUT *timi)
Definition: reader_tim.c:431
SCIP_CONS ** SCIPtimGetStageConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1069
const char * f1
Definition: reader_tim.c:95
static SCIP_RETCODE timinputCreate(SCIP *scip, TIMINPUT **timi, SCIP_FILE *fp)
Definition: reader_tim.c:331
const char * f2
Definition: reader_tim.c:96
static SCIP_RETCODE readTime(SCIP *scip, TIMINPUT *timi)
Definition: reader_tim.c:646
static SCIP_RETCODE readPeriods(TIMINPUT *timi, SCIP *scip)
Definition: reader_tim.c:684
static SCIP_RETCODE readTim(SCIP *scip, SCIP_READER *reader, const char *filename)
Definition: reader_tim.c:728
int SCIPtimGetStageNVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1090
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip_reader.c:138
static SCIP_RETCODE timinputSetStageName(TIMINPUT *timi, SCIP *scip, const char *stagename, int stagenum)
Definition: reader_tim.c:513
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1991
static SCIP_RETCODE addVariableToStage(SCIP *scip, TIMSTAGE *stage, const char *varname)
Definition: reader_tim.c:109
#define BLANK
Definition: reader_tim.c:51
int conssize
Definition: reader_tim.c:62
static SCIP_DECL_READERFREE(readerFreeTim)
Definition: reader_tim.c:801
SCIP_Bool SCIPcorHasRead(SCIP_READER *reader)
Definition: reader_cor.c:208
public methods for message output
static const char * timinputField0(const TIMINPUT *timi)
Definition: reader_tim.c:398
static SCIP_RETCODE createReaderdata(SCIP *scip, SCIP_READER *reader, TIMINPUT *timi)
Definition: reader_tim.c:226
#define READER_EXTENSION
Definition: reader_tim.c:40
const char ** stagestartcons
Definition: reader_tim.c:100
#define SCIP_Real
Definition: def.h:177
public methods for input file readers
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
Definition: def.h:405
int nstages
Definition: reader_tim.c:102
public methods for message handling
SCIP_Bool haserror
Definition: reader_tim.c:92
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip_reader.c:186
static SCIP_RETCODE timinputSetStageStartCons(TIMINPUT *timi, SCIP *scip, const char *consname, int stagenum)
Definition: reader_tim.c:496
static void timinputSetSection(TIMINPUT *timi, TIMSECTION section)
Definition: reader_tim.c:453
static void timinputFree(SCIP *scip, TIMINPUT **timi)
Definition: reader_tim.c:364
int SCIPcorGetNVarNames(SCIP_READER *reader)
Definition: reader_cor.c:224
int stagesize
Definition: reader_tim.c:103
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:3096
SCIPallocBlockMemory(scip, subsol))
SCIP_VAR ** SCIPtimGetStageVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1048
SCIP_FILE * fp
Definition: reader_tim.c:90
int SCIPfclose(SCIP_FILE *fp)
Definition: fileio.c:223
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
int SCIPtimGetStageNConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1111
public methods for reader plugins
#define SCIPABORT()
Definition: def.h:356
public methods for global and local (sub)problems
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
Definition: misc.c:10713
int varssize
Definition: reader_tim.c:61
static SCIP_RETCODE createStages(SCIP *scip, SCIP_READER *reader, SCIP_READER *correader)
Definition: reader_tim.c:173
const char * SCIPtimGetStageName(SCIP *scip, int stagenum)
Definition: reader_tim.c:948
static const char * timinputField1(const TIMINPUT *timi)
Definition: reader_tim.c:409
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip_reader.c:162
SCIP_RETCODE SCIPincludeReaderTim(SCIP *scip)
Definition: reader_tim.c:845