Scippy

SCIP

Solving Constraint Integer Programs

reader.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-2017 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 email to scip@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file reader.c
17  * @brief interface for input file readers
18  * @author Tobias Achterberg
19  */
20 
21 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
22 
23 #include <assert.h>
24 #include <string.h>
25 #if defined(_WIN32) || defined(_WIN64)
26 #else
27 #include <strings.h> /*lint --e{766}*/
28 #endif
29 #include <math.h>
30 
31 #include "scip/def.h"
32 #include "blockmemshell/memory.h"
33 #include "scip/set.h"
34 #include "scip/clock.h"
35 #include "scip/pub_misc.h"
36 #include "scip/reader.h"
37 #include "scip/prob.h"
38 #include "scip/pub_var.h"
39 #include "scip/var.h"
40 #include "scip/pub_cons.h"
41 #include "scip/cons.h"
42 
43 #include "scip/struct_reader.h"
44 
45 
46 /** copies the given reader to a new scip */
48  SCIP_READER* reader, /**< reader */
49  SCIP_SET* set /**< SCIP_SET of SCIP to copy to */
50  )
51 {
52  assert(reader != NULL);
53  assert(set != NULL);
54  assert(set->scip != NULL);
55 
56  if( reader->readercopy != NULL )
57  {
58  SCIPsetDebugMsg(set, "including reader %s in subscip %p\n", SCIPreaderGetName(reader), (void*)set->scip);
59  SCIP_CALL( reader->readercopy(set->scip, reader) );
60  }
61  return SCIP_OKAY;
62 }
63 
64 /** creates a reader */
66  SCIP_READER** reader, /**< pointer to store reader */
67  const char* name, /**< name of reader */
68  const char* desc, /**< description of reader */
69  const char* extension, /**< file extension that reader processes */
70  SCIP_DECL_READERCOPY ((*readercopy)), /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
71  SCIP_DECL_READERFREE ((*readerfree)), /**< destructor of reader */
72  SCIP_DECL_READERREAD ((*readerread)), /**< read method */
73  SCIP_DECL_READERWRITE ((*readerwrite)), /**< write method */
74  SCIP_READERDATA* readerdata /**< reader data */
75  )
76 {
77  assert(reader != NULL);
78  assert(name != NULL);
79  assert(desc != NULL);
80  assert(extension != NULL);
81 
82  SCIP_ALLOC( BMSallocMemory(reader) );
83  SCIP_ALLOC( BMSduplicateMemoryArray(&(*reader)->name, name, strlen(name)+1) );
84  SCIP_ALLOC( BMSduplicateMemoryArray(&(*reader)->desc, desc, strlen(desc)+1) );
85  SCIP_ALLOC( BMSduplicateMemoryArray(&(*reader)->extension, extension, strlen(extension)+1) );
86  (*reader)->readercopy = readercopy;
87  (*reader)->readerfree = readerfree;
88  (*reader)->readerread = readerread;
89  (*reader)->readerwrite = readerwrite;
90  (*reader)->readerdata = readerdata;
91 
92  /* create reading clock */
93  SCIP_CALL( SCIPclockCreate(&(*reader)->readingtime, SCIP_CLOCKTYPE_DEFAULT) );
94 
95  return SCIP_OKAY;
96 }
97 
98 /** frees memory of reader */
100  SCIP_READER** reader, /**< pointer to reader data structure */
101  SCIP_SET* set /**< global SCIP settings */
102  )
103 {
104  assert(reader != NULL);
105  assert(*reader != NULL);
106  assert(set != NULL);
107 
108  /* call destructor of reader */
109  if( (*reader)->readerfree != NULL )
110  {
111  SCIP_CALL( (*reader)->readerfree(set->scip, *reader) );
112  }
113 
114  /* free clock */
115  SCIPclockFree(&(*reader)->readingtime);
116 
117  BMSfreeMemoryArray(&(*reader)->name);
118  BMSfreeMemoryArray(&(*reader)->desc);
119  BMSfreeMemoryArray(&(*reader)->extension);
120  BMSfreeMemory(reader);
121 
122  return SCIP_OKAY;
123 }
124 
125 /** returns TRUE, if reader is responsible for files with the given extension */
126 static
128  SCIP_READER* reader, /**< reader */
129  const char* extension /**< extension of the input file name */
130  )
131 {
132  assert(reader != NULL);
133  assert(reader->extension != NULL);
134 
135  return (extension != NULL && strcasecmp(reader->extension, extension) == 0)
136  || (extension == NULL && *(reader->extension) == '\0');
137 }
138 
139 /** reads problem data from file with given reader or returns SCIP_DIDNOTRUN */
141  SCIP_READER* reader, /**< reader */
142  SCIP_SET* set, /**< global SCIP settings */
143  const char* filename, /**< name of the input file */
144  const char* extension, /**< extension of the input file name */
145  SCIP_RESULT* result /**< pointer to store the result of the callback method */
146  )
147 {
148  SCIP_RETCODE retcode;
149 
150  assert(reader != NULL);
151  assert(set != NULL);
152  assert(filename != NULL);
153  assert(result != NULL);
154 
155  /* check, if reader is applicable on the given file */
156  if( readerIsApplicable(reader, extension) && reader->readerread != NULL )
157  {
158  SCIP_CLOCK* readingtime;
159 
160  /**@note we need temporary clock to measure the reading time correctly since in case of creating a new problem
161  * within the reader all clocks are reset (including the reader clocks); this resetting is necessary for
162  * example for those case we people solve several problems using the (same) interactive shell
163  */
164 
165  assert(!SCIPclockIsRunning(reader->readingtime));
166 
167  /* create a temporary clock for measuring the reading time */
169 
170  /* start timing */
171  SCIPclockStart(readingtime, set);
172 
173  /* call reader to read problem */
174  retcode = reader->readerread(set->scip, reader, filename, result);
175 
176  /* stop timing */
177  SCIPclockStop(readingtime, set);
178 
179  /* add time to reader reading clock */
181 
182  /* free the temporary clock */
183  SCIPclockFree(&readingtime);
184  }
185  else
186  {
187  *result = SCIP_DIDNOTRUN;
188  retcode = SCIP_OKAY;
189  }
190 
191  /* check for reader errors */
192  if( retcode == SCIP_NOFILE || retcode == SCIP_READERROR )
193  return retcode;
194 
195  /* check if the result code is valid in case no reader error occurred */
196  assert( *result == SCIP_DIDNOTRUN || *result == SCIP_SUCCESS );
197 
198  SCIP_CALL( retcode );
199 
200  return SCIP_OKAY;
201 }
202 
203 
204 /* reset the variable name to the given one */
205 static
207  SCIP_VAR* var, /**< variable */
208  SCIP_SET* set, /**< global SCIP settings */
209  const char* name /**< variable name */
210  )
211 {
212  const char * oldname;
213 
214  assert( var != NULL );
215  assert( name != NULL );
216 
217  /* get pointer to temporary generic name and free the memory */
218  oldname = SCIPvarGetName(var);
219  SCIPsetFreeBufferArray(set, &oldname);
220 
221  /* reset name */
222  SCIPvarSetNamePointer(var, name);
223 }
224 
225 
226 /** writes problem data to file with given reader or returns SCIP_DIDNOTRUN */
228  SCIP_READER* reader, /**< reader */
229  SCIP_PROB* prob, /**< problem data */
230  SCIP_SET* set, /**< global SCIP settings */
231  FILE* file, /**< output file (or NULL for standard output) */
232  const char* extension, /**< file format */
233  SCIP_Bool genericnames, /**< using generic variable and constraint names? */
234  SCIP_RESULT* result /**< pointer to store the result of the callback method */
235  )
236 {
237  SCIP_RETCODE retcode;
238 
239  assert(reader != NULL);
240  assert(set != NULL);
241  assert(set->buffer != NULL);
242  assert(extension != NULL);
243  assert(result != NULL);
244 
245  /* check, if reader is applicable on the given file */
246  if( readerIsApplicable(reader, extension) && reader->readerwrite != NULL )
247  {
248  SCIP_VAR** vars;
249  int nvars;
250  SCIP_VAR** fixedvars;
251  int nfixedvars;
252  SCIP_CONS** conss;
253  int nconss;
254  int i;
255 
256  SCIP_CONS* cons;
257 
258  char* name;
259  const char* consname;
260  const char** varnames;
261  const char** fixedvarnames;
262  const char** consnames;
263 
264  varnames = NULL;
265  fixedvarnames = NULL;
266  consnames = NULL;
267 
268  vars = prob->vars;
269  nvars = prob->nvars;
270  fixedvars = prob->fixedvars;
271  nfixedvars = prob->nfixedvars;
272 
273  /* case of the transformed problem, we want to write currently valid problem */
274  if( prob->transformed )
275  {
276  SCIP_CONSHDLR** conshdlrs;
277  int nconshdlrs;
278 
279  conshdlrs = set->conshdlrs;
280  nconshdlrs = set->nconshdlrs;
281 
282  /* collect number of constraints which have to be enforced; these are the constraints which currency (locally)
283  * enabled; these also includes the local constraints
284  */
285  nconss = 0;
286  for( i = 0; i < nconshdlrs; ++i )
287  {
288  /* check if all constraints of the constraint handler should be written */
289  if( set->write_allconss )
290  nconss += SCIPconshdlrGetNConss(conshdlrs[i]);
291  else
292  nconss += SCIPconshdlrGetNEnfoConss(conshdlrs[i]);
293  }
294 
295  SCIPsetDebugMsg(set, "Writing %d constraints.\n", nconss);
296 
297 
298  SCIP_CALL( SCIPsetAllocBufferArray(set, &conss, nconss) );
299 
300  /* copy the constraints */
301  nconss = 0;
302  for( i = 0; i < nconshdlrs; ++i )
303  {
304  SCIP_CONS** conshdlrconss;
305  int nconshdlrconss;
306  int c;
307 
308  /* check if all constraints of the constraint handler should be written */
309  if( set->write_allconss )
310  {
311  conshdlrconss = SCIPconshdlrGetConss(conshdlrs[i]);
312  nconshdlrconss = SCIPconshdlrGetNConss(conshdlrs[i]);
313  }
314  else
315  {
316  conshdlrconss = SCIPconshdlrGetEnfoConss(conshdlrs[i]);
317  nconshdlrconss = SCIPconshdlrGetNEnfoConss(conshdlrs[i]);
318  }
319 
320  SCIPsetDebugMsg(set, "Conshdlr <%s> has %d constraints to write from all in all %d constraints.\n", SCIPconshdlrGetName(conshdlrs[i]), nconshdlrconss, SCIPconshdlrGetNConss(conshdlrs[i]));
321 
322  for( c = 0; c < nconshdlrconss; ++c )
323  {
324  conss[nconss] = conshdlrconss[c];
325  nconss++;
326  }
327  }
328  }
329  else
330  {
331  conss = prob->conss;
332  nconss = prob->nconss;
333  }
334 
335  if( genericnames )
336  {
337  SCIP_VAR* var;
338  int size;
339 
340  /* save variable and constraint names and replace these names by generic names */
341 
342  /* allocate memory for saving the original variable and constraint names */
343  SCIP_CALL( SCIPsetAllocBufferArray(set, &varnames, nvars) );
344  SCIP_CALL( SCIPsetAllocBufferArray(set, &fixedvarnames, nfixedvars) );
345  SCIP_CALL( SCIPsetAllocBufferArray(set, &consnames, nconss) );
346 
347  /* compute length of the generic variable names:
348  * - nvars + 1 to avoid log of zero
349  * - +3 (zero at end + 'x' + 1 because we round down)
350  * Example: 10 -> need 4 chars ("x10\0")
351  */
352  size = (int) log10(nvars+1.0) + 3;
353 
354  for( i = 0; i < nvars; ++i )
355  {
356  var = vars[i];
357  varnames[i] = SCIPvarGetName(var);
358 
359  SCIP_CALL( SCIPsetAllocBufferArray(set, &name, size) );
360  (void) SCIPsnprintf(name, size, "x%d", i + set->write_genoffset);
361  SCIPvarSetNamePointer(var, name);
362  }
363 
364  /* compute length of the generic variable names */
365  size = (int) log10(nfixedvars+1.0) + 3;
366 
367  for( i = 0; i < nfixedvars; ++i )
368  {
369  var = fixedvars[i];
370  fixedvarnames[i] = SCIPvarGetName(var);
371 
372  SCIP_CALL( SCIPsetAllocBufferArray(set, &name, size) );
373  (void) SCIPsnprintf(name, size, "y%d", i);
374  SCIPvarSetNamePointer(var, name);
375  }
376 
377  /* compute length of the generic constraint names */
378  size = (int) log10(nconss+1.0) + 3;
379 
380  for( i = 0; i < nconss; ++i )
381  {
382  cons = conss[i];
383  consnames[i] = SCIPconsGetName(cons);
384 
385  SCIP_CALL( SCIPsetAllocBufferArray(set, &name, size) );
386  (void) SCIPsnprintf(name, size, "c%d", i);
387  SCIPconsSetNamePointer(cons, name);
388  }
389  }
390 
391  /* call reader to write problem */
392  retcode = reader->readerwrite(set->scip, reader, file, prob->name, prob->probdata, prob->transformed,
393  prob->transformed ? SCIP_OBJSENSE_MINIMIZE : prob->objsense, prob->objscale, prob->objoffset,
394  vars, nvars, prob->nbinvars, prob->nintvars, prob->nimplvars, prob->ncontvars,
395  fixedvars, nfixedvars, prob->startnvars,
396  conss, nconss, prob->maxnconss, prob->startnconss, genericnames, result);
397 
398  /* reset variable and constraint names to original names */
399  if( genericnames )
400  {
401  assert(varnames != NULL);
402  assert(fixedvarnames != NULL);
403  assert(consnames != NULL);
404  for( i = nconss - 1; i >= 0; --i )
405  {
406  cons = conss[i];
407 
408  /* get pointer to temporary generic name and free the memory */
409  consname = SCIPconsGetName(cons);
410  SCIPsetFreeBufferArray(set, &consname);
411 
412  /* reset name */
413  SCIPconsSetNamePointer(cons, consnames[i]);
414  }
415 
416  for( i = nfixedvars - 1; i >= 0; --i )
417  resetVarname(fixedvars[i], set, fixedvarnames[i]);
418 
419  for( i = nvars - 1; i >= 0; --i )
420  resetVarname(vars[i], set, varnames[i]);
421 
422  /* free memory */
423  SCIPsetFreeBufferArray(set, &consnames);
424  SCIPsetFreeBufferArray(set, &fixedvarnames);
425  SCIPsetFreeBufferArray(set, &varnames);
426  }
427 
428  if( prob->transformed )
429  {
430  /* free memory */
431  SCIPsetFreeBufferArray(set, &conss);
432  }
433  }
434  else
435  {
436  *result = SCIP_DIDNOTRUN;
437  retcode = SCIP_OKAY;
438  }
439 
440  /* check for reader errors */
441  if( retcode == SCIP_WRITEERROR )
442  return retcode;
443 
444  SCIP_CALL( retcode );
445 
446  return SCIP_OKAY;
447 }
448 
449 /** gets user data of reader */
451  SCIP_READER* reader /**< reader */
452  )
453 {
454  assert(reader != NULL);
455 
456  return reader->readerdata;
457 }
458 
459 /** sets user data of reader; user has to free old data in advance! */
461  SCIP_READER* reader, /**< reader */
462  SCIP_READERDATA* readerdata /**< new reader user data */
463  )
464 {
465  assert(reader != NULL);
466 
467  reader->readerdata = readerdata;
468 }
469 
470 /** sets copy method of reader */
472  SCIP_READER* reader, /**< reader */
473  SCIP_DECL_READERCOPY ((*readercopy)) /**< copy method of reader or NULL if you don't want to copy your plugin into sub-SCIPs */
474  )
475 {
476  assert(reader != NULL);
477 
478  reader->readercopy = readercopy;
479 }
480 
481 /** sets destructor of reader */
483  SCIP_READER* reader, /**< reader */
484  SCIP_DECL_READERFREE ((*readerfree)) /**< destructor of reader */
485  )
486 {
487  assert(reader != NULL);
488 
489  reader->readerfree = readerfree;
490 }
491 
492 /** sets read method of reader */
494  SCIP_READER* reader, /**< reader */
495  SCIP_DECL_READERREAD ((*readerread)) /**< read method */
496  )
497 {
498  assert(reader != NULL);
499 
500  reader->readerread = readerread;
501 }
502 
503 /** sets write method of reader */
505  SCIP_READER* reader, /**< reader */
506  SCIP_DECL_READERWRITE ((*readerwrite)) /**< write method */
507  )
508 {
509  assert(reader != NULL);
510 
511  reader->readerwrite = readerwrite;
512 }
513 
514 /** gets name of reader */
515 const char* SCIPreaderGetName(
516  SCIP_READER* reader /**< reader */
517  )
518 {
519  assert(reader != NULL);
520 
521  return reader->name;
522 }
523 
524 /** gets description of reader */
525 const char* SCIPreaderGetDesc(
526  SCIP_READER* reader /**< reader */
527  )
528 {
529  assert(reader != NULL);
530 
531  return reader->desc;
532 }
533 
534 /** gets file extension of reader */
536  SCIP_READER* reader /**< reader */
537  )
538 {
539  assert(reader != NULL);
540 
541  return reader->extension;
542 }
543 
544 /** return whether the reader can read files */
546  SCIP_READER* reader /**< reader */
547  )
548 {
549  assert(reader != NULL);
550 
551  return (reader->readerread != NULL);
552 }
553 
554 /** return whether the reader can write files */
556  SCIP_READER* reader /**< reader */
557  )
558 {
559  assert(reader != NULL);
560 
561  return (reader->readerwrite != NULL);
562 }
563 
564 /** gets time in seconds used in this reader for reading */
566  SCIP_READER* reader /**< reader */
567  )
568 {
569  assert(reader != NULL);
570 
571  return SCIPclockGetTime(reader->readingtime);
572 }
573 
574 /** enables or disables all clocks of \p reader, depending on the value of the flag */
576  SCIP_READER* reader, /**< the reader for which all clocks should be enabled or disabled */
577  SCIP_Bool enable /**< should the clocks be enabled? */
578  )
579 {
580  assert(reader != NULL);
581 
582  SCIPclockEnableOrDisable(reader->readingtime, enable);
583 }
584 
585 /** resets reading time of reader */
587  SCIP_READER* reader /**< reader */
588  )
589 {
590  assert(reader != NULL);
591 
592  /* reset reading time/clock */
593  SCIPclockReset(reader->readingtime);
594 
595  return SCIP_OKAY;
596 }
597 
enum SCIP_Result SCIP_RESULT
Definition: type_result.h:52
SCIP_RETCODE SCIPreaderCopyInclude(SCIP_READER *reader, SCIP_SET *set)
Definition: reader.c:47
SCIP_CONS ** SCIPconshdlrGetEnfoConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4495
static SCIP_Bool readerIsApplicable(SCIP_READER *reader, const char *extension)
Definition: reader.c:127
SCIP_Bool SCIPreaderCanWrite(SCIP_READER *reader)
Definition: reader.c:555
void SCIPreaderSetCopy(SCIP_READER *reader, SCIP_DECL_READERCOPY((*readercopy)))
Definition: reader.c:471
internal methods for clocks and timing issues
int nintvars
Definition: struct_prob.h:63
SCIP_DECL_READERFREE(ReaderTSP::scip_free)
Definition: ReaderTSP.cpp:137
const char * SCIPreaderGetName(SCIP_READER *reader)
Definition: reader.c:515
int startnconss
Definition: struct_prob.h:76
void SCIPreaderSetFree(SCIP_READER *reader, SCIP_DECL_READERFREE((*readerfree)))
Definition: reader.c:482
void SCIPclockStop(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:350
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4485
const char * extension
Definition: struct_reader.h:40
SCIP_Real objoffset
Definition: struct_prob.h:41
void SCIPclockStart(SCIP_CLOCK *clck, SCIP_SET *set)
Definition: clock.c:280
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:9340
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
#define SCIPsetAllocBufferArray(set, ptr, num)
Definition: set.h:1834
SCIP_DECL_READERWRITE(ReaderTSP::scip_write)
Definition: ReaderTSP.cpp:472
void SCIPvarSetNamePointer(SCIP_VAR *var, const char *name)
Definition: var.c:5650
public methods for problem variables
SCIP_VAR ** fixedvars
Definition: struct_prob.h:56
void SCIPconsSetNamePointer(SCIP_CONS *cons, const char *name)
Definition: cons.c:6614
int nimplvars
Definition: struct_prob.h:64
void SCIPclockEnableOrDisable(SCIP_CLOCK *clck, SCIP_Bool enable)
Definition: clock.c:250
#define SCIPsetFreeBufferArray(set, ptr)
Definition: set.h:1841
#define BMSfreeMemory(ptr)
Definition: memory.h:104
const char * desc
Definition: struct_reader.h:39
void SCIPreaderSetData(SCIP_READER *reader, SCIP_READERDATA *readerdata)
Definition: reader.c:460
SCIP_RETCODE SCIPreaderFree(SCIP_READER **reader, SCIP_SET *set)
Definition: reader.c:99
SCIP_CLOCK * readingtime
Definition: struct_reader.h:46
SCIP_Bool SCIPclockIsRunning(SCIP_CLOCK *clck)
Definition: clock.c:417
void SCIPclockSetTime(SCIP_CLOCK *clck, SCIP_Real sec)
Definition: clock.c:518
void SCIPreaderEnableOrDisableClocks(SCIP_READER *reader, SCIP_Bool enable)
Definition: reader.c:575
SCIP_READERDATA * SCIPreaderGetData(SCIP_READER *reader)
Definition: reader.c:450
public methods for managing constraints
int SCIPconshdlrGetNEnfoConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4525
#define BMSfreeMemoryArray(ptr)
Definition: memory.h:106
internal methods for storing and manipulating the main problem
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4113
void SCIPclockReset(SCIP_CLOCK *clck)
Definition: clock.c:199
SCIP_Bool SCIPreaderCanRead(SCIP_READER *reader)
Definition: reader.c:545
SCIP_RETCODE SCIPreaderCreate(SCIP_READER **reader, const char *name, const char *desc, const char *extension, SCIP_DECL_READERCOPY((*readercopy)), SCIP_DECL_READERFREE((*readerfree)), SCIP_DECL_READERREAD((*readerread)), SCIP_DECL_READERWRITE((*readerwrite)), SCIP_READERDATA *readerdata)
Definition: reader.c:65
const char * SCIPconsGetName(SCIP_CONS *cons)
Definition: cons.c:7881
SCIP_OBJSENSE objsense
Definition: struct_prob.h:77
SCIP_RETCODE SCIPreaderResetReadingTime(SCIP_READER *reader)
Definition: reader.c:586
void SCIPreaderSetRead(SCIP_READER *reader, SCIP_DECL_READERREAD((*readerread)))
Definition: reader.c:493
const char * SCIPvarGetName(SCIP_VAR *var)
Definition: var.c:16555
SCIP_Real SCIPclockGetTime(SCIP_CLOCK *clck)
Definition: clock.c:428
#define NULL
Definition: lpi_spx1.cpp:137
char * name
Definition: struct_prob.h:46
internal methods for global SCIP settings
#define SCIP_CALL(x)
Definition: def.h:316
SCIP_RETCODE SCIPreaderRead(SCIP_READER *reader, SCIP_SET *set, const char *filename, const char *extension, SCIP_RESULT *result)
Definition: reader.c:140
datastructures for input file readers
SCIP_RETCODE SCIPreaderWrite(SCIP_READER *reader, SCIP_PROB *prob, SCIP_SET *set, FILE *file, const char *extension, SCIP_Bool genericnames, SCIP_RESULT *result)
Definition: reader.c:227
#define BMSduplicateMemoryArray(ptr, source, num)
Definition: memory.h:102
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
Definition: cons.c:4515
SCIP_RETCODE SCIPclockCreate(SCIP_CLOCK **clck, SCIP_CLOCKTYPE clocktype)
Definition: clock.c:160
internal methods for problem variables
struct SCIP_ReaderData SCIP_READERDATA
Definition: type_reader.h:37
public data structures and miscellaneous methods
SCIP_PROBDATA * probdata
Definition: struct_prob.h:53
#define SCIP_Bool
Definition: def.h:61
SCIP_Real SCIPreaderGetReadingTime(SCIP_READER *reader)
Definition: reader.c:565
void SCIPreaderSetWrite(SCIP_READER *reader, SCIP_DECL_READERWRITE((*readerwrite)))
Definition: reader.c:504
int ncontvars
Definition: struct_prob.h:65
int nbinvars
Definition: struct_prob.h:62
internal methods for input file readers
void SCIPclockFree(SCIP_CLOCK **clck)
Definition: clock.c:175
#define SCIPsetDebugMsg
Definition: set.h:1870
const char * SCIPreaderGetDesc(SCIP_READER *reader)
Definition: reader.c:525
SCIP_Bool transformed
Definition: struct_prob.h:79
int maxnconss
Definition: struct_prob.h:74
int nfixedvars
Definition: struct_prob.h:68
SCIP_READERDATA * readerdata
Definition: struct_reader.h:45
#define SCIP_DECL_READERCOPY(x)
Definition: type_reader.h:46
static void resetVarname(SCIP_VAR *var, SCIP_SET *set, const char *name)
Definition: reader.c:206
const char * name
Definition: struct_reader.h:38
int nconss
Definition: struct_prob.h:73
#define SCIP_Real
Definition: def.h:145
SCIP_VAR ** vars
Definition: struct_prob.h:55
#define BMSallocMemory(ptr)
Definition: memory.h:78
SCIP_CONS ** conss
Definition: struct_prob.h:59
internal methods for constraints and constraint handlers
SCIP_DECL_READERREAD(ReaderTSP::scip_read)
Definition: ReaderTSP.cpp:150
common defines and data types used in all packages of SCIP
int startnvars
Definition: struct_prob.h:75
#define SCIP_ALLOC(x)
Definition: def.h:327
const char * SCIPreaderGetExtension(SCIP_READER *reader)
Definition: reader.c:535
SCIP_Real objscale
Definition: struct_prob.h:42
memory allocation routines