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-2020 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 == '*' );
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  if( !timinputReadLine(timi) || (timinputField0(timi) == NULL) )
665  {
666  timinputSyntaxerror(timi);
667  return SCIP_OKAY;
668  }
669 
670  if( strncmp(timinputField0(timi), "PERIODS", 7) == 0 )
672  else
673  {
674  timinputSyntaxerror(timi);
675  return SCIP_OKAY;
676  }
677 
678  return SCIP_OKAY;
679 }
680 
681 /** Process PERIODS section. */
682 static
684  TIMINPUT* timi, /**< tim input structure */
685  SCIP* scip /**< SCIP data structure */
686  )
687 {
688  SCIPdebugMsg(scip, "read Periods\n");
689 
690  while( timinputReadLine(timi) )
691  {
692  if( timinputField0(timi) != NULL )
693  {
694  if( strcmp(timinputField0(timi), "PERIODS") == 0 )
696  else if( strcmp(timinputField0(timi), "ENDATA") == 0 )
698  else
699  timinputSyntaxerror(timi);
700 
701  return SCIP_OKAY;
702  }
703 
704  if( timi->nstages + 1 >= timi->stagesize )
705  {
706  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagestartvars, &timi->stagesize, timi->nstages + 1) );
707  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagestartcons, &timi->stagesize, timi->nstages + 1) );
708  SCIP_CALL( SCIPensureBlockMemoryArray(scip, &timi->stagenames, &timi->stagesize, timi->nstages + 1) );
709  }
710 
711  SCIP_CALL( timinputSetStageStartVar(timi, scip, timinputField1(timi), timi->nstages) );
712  SCIP_CALL( timinputSetStageStartCons(timi, scip, timinputField2(timi), timi->nstages) );
713  SCIP_CALL( timinputSetStageName(timi, scip, timinputField3(timi), timi->nstages) );
714 
715  timi->nstages++;
716  }
717  timinputSyntaxerror(timi);
718 
719  return SCIP_OKAY;
720 }
721 
722 
723 /** Read time data for the SMPS file format. */
724 static
726  SCIP* scip, /**< SCIP data structure */
727  SCIP_READER* reader, /**< the file reader itself */
728  const char* filename /**< name of the input file */
729  )
730 {
731  SCIP_FILE* fp;
732  TIMINPUT* timi;
733  SCIP_RETCODE retcode;
734  SCIP_Bool error = TRUE;
735 
736  assert(scip != NULL);
737  assert(filename != NULL);
738 
739  fp = SCIPfopen(filename, "r");
740  if( fp == NULL )
741  {
742  SCIPerrorMessage("cannot open file <%s> for reading\n", filename);
743  SCIPprintSysError(filename);
744 
745  return SCIP_NOFILE;
746  }
747 
748  SCIP_CALL_FINALLY( timinputCreate(scip, &timi, fp), SCIPfclose(fp) );
749 
750  SCIP_CALL_TERMINATE( retcode, readTime(scip, timi), TERMINATE );
751 
752  while( timinputSection(timi) == TIM_PERIODS )
753  {
754  SCIP_CALL_TERMINATE( retcode, readPeriods(timi, scip), TERMINATE );
755  }
756  if( timinputSection(timi) != TIM_ENDATA )
757  timinputSyntaxerror(timi);
758 
759  error = timinputHasError(timi);
760 
761  if( !error )
762  {
763  SCIP_CALL_TERMINATE( retcode, createReaderdata(scip, reader, timi), TERMINATE );
764  }
765 
766  /* cppcheck-suppress unusedLabel */
767  TERMINATE:
768  timinputFree(scip, &timi);
769  SCIPfclose(fp);
770 
771  if( error )
772  return SCIP_READERROR;
773  else
774  return SCIP_OKAY;
775 }
776 
777 /*
778  * Callback methods of reader
779  */
780 
781 /** copy method for reader plugins (called when SCIP copies plugins) */
782 static
783 SCIP_DECL_READERCOPY(readerCopyTim)
784 { /*lint --e{715}*/
785  assert(scip != NULL);
786  assert(reader != NULL);
787  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
788 
789  /* call inclusion method of reader */
791 
792  return SCIP_OKAY;
793 }
794 
795 /** destructor of reader to free user data (called when SCIP is exiting) */
796 static
797 SCIP_DECL_READERFREE(readerFreeTim)
798 {
799  freeReaderdata(scip, reader);
800 
801  return SCIP_OKAY;
802 }
803 
804 /** reads the stage information for a stochastic programming instance in SMPS format */
805 static
806 SCIP_DECL_READERREAD(readerReadTim)
807 { /*lint --e{715}*/
808  SCIP_READER* correader;
809 
810  assert(reader != NULL);
811  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
812 
813  correader = SCIPfindReader(scip, "correader");
814 
815  if( correader == NULL )
816  {
817  SCIPwarningMessage(scip, "It is necessary to include the \"cor\" reader\n");
818  (*result) = SCIP_DIDNOTRUN;
819  return SCIP_OKAY;
820  }
821 
822  /* checking whether the cor file has been read */
823  if( !SCIPcorHasRead(correader) )
824  {
825  SCIPwarningMessage(scip, "The core file must be read before the time and stochastic files.\n");
826  (*result) = SCIP_DIDNOTRUN;
827  return SCIP_OKAY;
828  }
829 
830  SCIP_CALL( SCIPreadTim(scip, filename, result) );
831 
832  return SCIP_OKAY;
833 }
834 
835 
836 /*
837  * tim file reader specific interface methods
838  */
839 
840 /** includes the tim file reader in SCIP */
842  SCIP* scip /**< SCIP data structure */
843  )
844 {
845  SCIP_READERDATA* readerdata;
846  SCIP_READER* reader;
847 
848  /* create reader data */
849  SCIP_CALL( SCIPallocBlockMemory(scip, &readerdata) );
850  readerdata->read = FALSE;
851 
852  /* include reader */
854 
855  /* set non fundamental callbacks via setter functions */
856  SCIP_CALL( SCIPsetReaderCopy(scip, reader, readerCopyTim) );
857  SCIP_CALL( SCIPsetReaderFree(scip, reader, readerFreeTim) );
858  SCIP_CALL( SCIPsetReaderRead(scip, reader, readerReadTim) );
859 
860  return SCIP_OKAY;
861 }
862 
863 
864 /** reads problem from file */
866  SCIP* scip, /**< SCIP data structure */
867  const char* filename, /**< full path and name of file to read, or NULL if stdin should be used */
868  SCIP_RESULT* result /**< pointer to store the result of the file reading call */
869  )
870 {
871  SCIP_READER* reader;
872  SCIP_RETCODE retcode;
873  SCIP_READERDATA* readerdata;
874 
875  assert(scip != NULL);
876  assert(result != NULL);
877 
878  reader = SCIPfindReader(scip, READER_NAME);
879  assert(reader != NULL);
880 
881  retcode = readTim(scip, reader, filename);
882 
883  if( retcode == SCIP_PLUGINNOTFOUND )
884  retcode = SCIP_READERROR;
885 
886  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
887  return retcode;
888 
889  SCIP_CALL( retcode );
890 
891  /* creating the stages */
892  SCIP_CALL( createStages(scip, reader, SCIPfindReader(scip, "correader")) );
893 
894  /* setting the read flag to TRUE */
895  readerdata = SCIPreaderGetData(reader);
896  readerdata->read = TRUE;
897 
898  *result = SCIP_SUCCESS;
899 
900  return SCIP_OKAY;
901 }
902 
903 /*
904  * Interface methods for the cor and sto files
905  */
906 
907 /* return whether the tim file has been read */
909  SCIP_READER* reader /**< the file reader itself */
910  )
911 {
912  SCIP_READERDATA* readerdata;
913 
914  assert(reader != NULL);
915  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
916 
917  readerdata = SCIPreaderGetData(reader);
918  assert(readerdata != NULL);
919 
920  return readerdata->read;
921 }
922 
923 
924 /* returns the number of stages */
926  SCIP* scip /**< SCIP data structure */
927  )
928 {
929  SCIP_READER* reader;
930  SCIP_READERDATA* readerdata;
931 
932  reader = SCIPfindReader(scip, READER_NAME);
933 
934  assert(reader != NULL);
935  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
936 
937  readerdata = SCIPreaderGetData(reader);
938  assert(readerdata != NULL);
939 
940  return readerdata->nstages;
941 }
942 
943 /* returns the name for a given stage */
945  SCIP* scip, /**< SCIP data structure */
946  int stagenum /**< the number of the requested stage */
947  )
948 {
949  SCIP_READER* reader;
950  SCIP_READERDATA* readerdata;
951 
952  reader = SCIPfindReader(scip, READER_NAME);
953 
954  assert(reader != NULL);
955  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
956 
957  readerdata = SCIPreaderGetData(reader);
958  assert(readerdata != NULL);
959  assert(stagenum >= 0 && stagenum < readerdata->nstages);
960 
961  return readerdata->stagenames[stagenum];
962 }
963 
964 /* returns the stage name for a given constraint name */
966  SCIP* scip, /**< SCIP data structure */
967  const char* consname /**< the constraint to search for */
968  )
969 {
970  SCIP_READER* reader;
971  SCIP_READERDATA* readerdata;
972  int stagenum;
973  int i;
974  int j;
975 
976  reader = SCIPfindReader(scip, READER_NAME);
977 
978  assert(reader != NULL);
979  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
980 
981  readerdata = SCIPreaderGetData(reader);
982  assert(readerdata != NULL);
983 
984  /* looping over all stages to find the provided constraint */
985  stagenum = -1;
986  for( i = 0; i < readerdata->nstages; i++ )
987  {
988  for( j = 0; j < readerdata->stages[i]->nconss; j++ )
989  {
990  if( strcmp(SCIPconsGetName(readerdata->stages[i]->conss[j]), consname) == 0 )
991  {
992  stagenum = i;
993  break;
994  }
995  }
996 
997  if( stagenum >= 0 )
998  break;
999  }
1000  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1001 
1002  return readerdata->stagenames[stagenum];
1003 }
1004 
1005 /* returns the number for a given stage */
1007  SCIP* scip, /**< SCIP data structure */
1008  const char* stage /**< the name of the requested stage */
1009  )
1010 {
1011  SCIP_READER* reader;
1012  SCIP_READERDATA* readerdata;
1013  int i;
1014  int stagenum;
1015 
1016  reader = SCIPfindReader(scip, READER_NAME);
1017 
1018  assert(reader != NULL);
1019  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1020 
1021  readerdata = SCIPreaderGetData(reader);
1022  assert(readerdata != NULL);
1023 
1024  stagenum = -1;
1025  for( i = 0; i < readerdata->nstages; i++ )
1026  {
1027  if( strcmp(readerdata->stagenames[i], stage) == 0 )
1028  {
1029  stagenum = i;
1030  break;
1031  }
1032  }
1033 
1034  if( stagenum < 0 )
1035  {
1036  SCIPerrorMessage("Stage <%s> was not found in the TIM file. Check the SMPS files (COR, TIM and STO)\n", stage);
1037  SCIPABORT();
1038  }
1039 
1040  return stagenum;
1041 }
1042 
1043 /* returns the array of variables for a given stage */
1045  SCIP* scip, /**< SCIP data structure */
1046  int stagenum /**< the number of the requested stage */
1047  )
1048 {
1049  SCIP_READER* reader;
1050  SCIP_READERDATA* readerdata;
1051 
1052  reader = SCIPfindReader(scip, READER_NAME);
1053 
1054  assert(reader != NULL);
1055  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1056 
1057  readerdata = SCIPreaderGetData(reader);
1058  assert(readerdata != NULL);
1059  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1060 
1061  return readerdata->stages[stagenum]->vars;
1062 }
1063 
1064 /* returns an array of constraints for a given stage */
1066  SCIP* scip, /**< SCIP data structure */
1067  int stagenum /**< the number of the requested stage */
1068  )
1069 {
1070  SCIP_READER* reader;
1071  SCIP_READERDATA* readerdata;
1072 
1073  reader = SCIPfindReader(scip, READER_NAME);
1074 
1075  assert(reader != NULL);
1076  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1077 
1078  readerdata = SCIPreaderGetData(reader);
1079  assert(readerdata != NULL);
1080  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1081 
1082  return readerdata->stages[stagenum]->conss;
1083 }
1084 
1085 /* returns the number of variables for a given stage */
1087  SCIP* scip, /**< SCIP data structure */
1088  int stagenum /**< the number of the requested stage */
1089  )
1090 {
1091  SCIP_READER* reader;
1092  SCIP_READERDATA* readerdata;
1093 
1094  reader = SCIPfindReader(scip, READER_NAME);
1095 
1096  assert(reader != NULL);
1097  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1098 
1099  readerdata = SCIPreaderGetData(reader);
1100  assert(readerdata != NULL);
1101  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1102 
1103  return readerdata->stages[stagenum]->nvars;
1104 }
1105 
1106 /* returns the number of constraints for a given stage */
1108  SCIP* scip, /**< SCIP data structure */
1109  int stagenum /**< the number of the requested stage */
1110  )
1111 {
1112  SCIP_READER* reader;
1113  SCIP_READERDATA* readerdata;
1114 
1115  reader = SCIPfindReader(scip, READER_NAME);
1116 
1117  assert(reader != NULL);
1118  assert(strcmp(SCIPreaderGetName(reader), READER_NAME) == 0);
1119 
1120  readerdata = SCIPreaderGetData(reader);
1121  assert(readerdata != NULL);
1122  assert(stagenum >= 0 && stagenum < readerdata->nstages);
1123 
1124  return readerdata->stages[stagenum]->nconss;
1125 }
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:97
SCIP_EXPORT const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:548
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:3095
const char * SCIPcorGetVarName(SCIP_READER *reader, int i)
Definition: reader_cor.c:256
int lineno
Definition: reader_tim.c:91
static SCIP_DECL_READERREAD(readerReadTim)
Definition: reader_tim.c:806
#define SCIPallocBlockMemoryArray(scip, ptr, num)
Definition: scip_mem.h:80
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
SCIP_EXPORT SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
Definition: reader.c:483
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
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
Definition: scip_message.c:123
static TIMSECTION timinputSection(const TIMINPUT *timi)
Definition: reader_tim.c:387
COR file reader (MPS format of the core problem for stochastic programs)
#define SCIP_CALL_FINALLY(x, y)
Definition: def.h:406
const char ** stagestartvars
Definition: reader_tim.c:99
char probname[TIM_MAX_NAMELEN]
Definition: reader_tim.c:98
SCIP_VAR ** vars
Definition: reader_tim.c:55
const char * SCIPcorGetConsName(SCIP_READER *reader, int i)
Definition: reader_cor.c:274
SCIP_RETCODE SCIPsetReaderRead(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: scip_reader.c:186
int SCIPgetNVars(SCIP *scip)
Definition: scip_prob.c:1986
static SCIP_RETCODE timinputSetStageStartVar(TIMINPUT *timi, SCIP *scip, const char *varname, int stagenum)
Definition: reader_tim.c:479
#define FALSE
Definition: def.h:73
enum TimSection TIMSECTION
Definition: reader_tim.c:84
int nconss
Definition: reader_tim.c:60
SCIP_RETCODE SCIPsetReaderCopy(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: scip_reader.c:138
#define TRUE
Definition: def.h:72
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:54
#define TIM_DEFAULT_ARRAYSIZE
Definition: reader_tim.c:49
int SCIPcorGetNVarNames(SCIP_READER *reader)
Definition: reader_cor.c:224
static void freeReaderdata(SCIP *scip, SCIP_READER *reader)
Definition: reader_tim.c:285
const char ** stagenames
Definition: reader_tim.c:101
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
#define SCIPfreeBlockMemory(scip, ptr)
Definition: scip_mem.h:95
#define SCIPdebugMessage
Definition: pub_message.h:87
const char * SCIPtimConsGetStageName(SCIP *scip, const char *consname)
Definition: reader_tim.c:965
const char * f3
Definition: reader_tim.c:97
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
Definition: misc.c:10548
#define SCIPallocBlockMemory(scip, ptr)
Definition: scip_mem.h:78
#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
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
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
Definition: scip_mem.h:92
SCIP_Bool SCIPtimHasRead(SCIP_READER *reader)
Definition: reader_tim.c:908
public methods for managing constraints
char buf[TIM_MAX_LINELEN]
Definition: reader_tim.c:93
int SCIPcorGetNConsNames(SCIP_READER *reader)
Definition: reader_cor.c:240
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
int SCIPtimGetNStages(SCIP *scip)
Definition: reader_tim.c:925
#define NULL
Definition: lpi_spx1.cpp:155
SCIP_RETCODE SCIPsetReaderFree(SCIP *scip, SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: scip_reader.c:162
SCIP_CONS ** conss
Definition: reader_tim.c:56
#define SCIP_CALL(x)
Definition: def.h:364
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
Definition: scip_mem.h:94
static SCIP_DECL_READERCOPY(readerCopyTim)
Definition: reader_tim.c:783
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
SCIP_READER * SCIPfindReader(SCIP *scip, const char *name)
Definition: scip_reader.c:226
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:1006
#define SCIP_Bool
Definition: def.h:70
static SCIP_RETCODE addConstraintToStage(SCIP *scip, TIMSTAGE *stage, const char *consname)
Definition: reader_tim.c:141
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:3013
SCIP_CONS * SCIPfindCons(SCIP *scip, const char *name)
Definition: scip_prob.c:2941
static const char * timinputField3(const TIMINPUT *timi)
Definition: reader_tim.c:431
SCIP_CONS ** SCIPtimGetStageConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1065
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
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
static SCIP_RETCODE readPeriods(TIMINPUT *timi, SCIP *scip)
Definition: reader_tim.c:683
static SCIP_RETCODE readTim(SCIP *scip, SCIP_READER *reader, const char *filename)
Definition: reader_tim.c:725
int SCIPtimGetStageNVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1086
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
Definition: scip_prob.c:2679
static SCIP_RETCODE timinputSetStageName(TIMINPUT *timi, SCIP *scip, const char *stagename, int stagenum)
Definition: reader_tim.c:513
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:797
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
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:3047
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:8089
const char ** stagestartcons
Definition: reader_tim.c:100
SCIP_Bool SCIPcorHasRead(SCIP_READER *reader)
Definition: reader_cor.c:208
#define SCIP_Real
Definition: def.h:163
public methods for input file readers
#define SCIP_CALL_TERMINATE(retcode, x, TERM)
Definition: def.h:385
int nstages
Definition: reader_tim.c:102
public methods for message handling
SCIP_Bool haserror
Definition: reader_tim.c:92
void SCIPprintSysError(const char *message)
Definition: misc.c:10499
static SCIP_RETCODE timinputSetStageStartCons(TIMINPUT *timi, SCIP *scip, const char *consname, int stagenum)
Definition: reader_tim.c:496
SCIP_RETCODE SCIPincludeReaderTim(SCIP *scip)
Definition: reader_tim.c:841
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 stagesize
Definition: reader_tim.c:103
SCIP_RETCODE SCIPreadTim(SCIP *scip, const char *filename, SCIP_RESULT *result)
Definition: reader_tim.c:865
SCIP_VAR ** SCIPtimGetStageVars(SCIP *scip, int stagenum)
Definition: reader_tim.c:1044
SCIP_FILE * fp
Definition: reader_tim.c:90
int SCIPfclose(SCIP_FILE *fp)
Definition: fileio.c:223
int SCIPtimGetStageNConss(SCIP *scip, int stagenum)
Definition: reader_tim.c:1107
public methods for reader plugins
#define SCIPABORT()
Definition: def.h:336
public methods for global and local (sub)problems
int varssize
Definition: reader_tim.c:61
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
Definition: misc.c:10474
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:944
static const char * timinputField1(const TIMINPUT *timi)
Definition: reader_tim.c:409