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