Scippy

SCIP

Solving Constraint Integer Programs

scip_datastructures.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 scip_datastructures.c
17  * @brief public methods for data structures
18  * @author Tobias Achterberg
19  * @author Timo Berthold
20  * @author Gerald Gamrath
21  * @author Robert Lion Gottwald
22  * @author Stefan Heinz
23  * @author Gregor Hendel
24  * @author Thorsten Koch
25  * @author Alexander Martin
26  * @author Marc Pfetsch
27  * @author Michael Winkler
28  * @author Kati Wolter
29  *
30  * @todo check all SCIP_STAGE_* switches, and include the new stages TRANSFORMED and INITSOLVE
31  */
32 
33 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
34 
35 #include <ctype.h>
36 #include <stdarg.h>
37 #include <assert.h>
38 #include <string.h>
39 #if defined(_WIN32) || defined(_WIN64)
40 #else
41 #include <strings.h> /*lint --e{766}*/
42 #endif
43 
44 
45 #include "lpi/lpi.h"
46 #include "nlpi/exprinterpret.h"
47 #include "nlpi/nlpi.h"
48 #include "scip/benders.h"
49 #include "scip/benderscut.h"
50 #include "scip/branch.h"
51 #include "scip/branch_nodereopt.h"
52 #include "scip/clock.h"
53 #include "scip/compr.h"
54 #include "scip/concsolver.h"
55 #include "scip/concurrent.h"
56 #include "scip/conflict.h"
57 #include "scip/conflictstore.h"
58 #include "scip/cons.h"
59 #include "scip/cons_linear.h"
60 #include "scip/cutpool.h"
61 #include "scip/cuts.h"
62 #include "scip/debug.h"
63 #include "scip/def.h"
64 #include "scip/dialog.h"
65 #include "scip/dialog_default.h"
66 #include "scip/disp.h"
67 #include "scip/event.h"
68 #include "scip/heur.h"
69 #include "scip/heur_ofins.h"
70 #include "scip/heur_reoptsols.h"
72 #include "scip/heuristics.h"
73 #include "scip/history.h"
74 #include "scip/implics.h"
75 #include "scip/interrupt.h"
76 #include "scip/lp.h"
77 #include "scip/mem.h"
78 #include "scip/message_default.h"
79 #include "scip/misc.h"
80 #include "scip/nlp.h"
81 #include "scip/nodesel.h"
82 #include "scip/paramset.h"
83 #include "scip/presol.h"
84 #include "scip/presolve.h"
85 #include "scip/pricer.h"
86 #include "scip/pricestore.h"
87 #include "scip/primal.h"
88 #include "scip/prob.h"
89 #include "scip/prop.h"
90 #include "scip/reader.h"
91 #include "scip/relax.h"
92 #include "scip/reopt.h"
93 #include "scip/retcode.h"
94 #include "scip/scipbuildflags.h"
95 #include "scip/scipcoreplugins.h"
96 #include "scip/scipgithash.h"
97 #include "scip/sepa.h"
98 #include "scip/sepastore.h"
99 #include "scip/set.h"
100 #include "scip/sol.h"
101 #include "scip/solve.h"
102 #include "scip/stat.h"
103 #include "scip/syncstore.h"
104 #include "scip/table.h"
105 #include "scip/tree.h"
106 #include "scip/var.h"
107 #include "scip/visual.h"
108 #include "xml/xml.h"
109 
111 #include "scip/scip_mem.h"
112 
113 #include "scip/pub_message.h"
114 
115 
116 /* In debug mode, we include the SCIP's structure in scip.c, such that no one can access
117  * this structure except the interface methods in scip.c.
118  * In optimized mode, the structure is included in scip.h, because some of the methods
119  * are implemented as defines for performance reasons (e.g. the numerical comparisons)
120  */
121 #ifndef NDEBUG
122 #include "scip/struct_scip.h"
123 #endif
124 
125 /** creates a dynamic array of real values
126  *
127  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
128  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
129  */
131  SCIP* scip, /**< SCIP data structure */
132  SCIP_REALARRAY** realarray /**< pointer to store the real array */
133  )
134 {
135  assert(scip != NULL);
136 
137  SCIP_CALL( SCIPrealarrayCreate(realarray, SCIPblkmem(scip)) );
138 
139  return SCIP_OKAY;
140 }
141 
142 /** frees a dynamic array of real values
143  *
144  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
145  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
146  */
148  SCIP* scip, /**< SCIP data structure */
149  SCIP_REALARRAY** realarray /**< pointer to the real array */
150  )
151 {
152  assert(scip != NULL);
153 
154  SCIP_CALL( SCIPrealarrayFree(realarray) );
155 
156  return SCIP_OKAY;
157 }
158 
159 /** extends dynamic array to be able to store indices from minidx to maxidx
160  *
161  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
162  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
163  */
165  SCIP* scip, /**< SCIP data structure */
166  SCIP_REALARRAY* realarray, /**< dynamic real array */
167  int minidx, /**< smallest index to allocate storage for */
168  int maxidx /**< largest index to allocate storage for */
169  )
170 {
171  assert(scip != NULL);
172 
173  SCIP_CALL( SCIPrealarrayExtend(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
174 
175  return SCIP_OKAY;
176 }
177 
178 /** clears a dynamic real array
179  *
180  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
181  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
182  */
184  SCIP* scip, /**< SCIP data structure */
185  SCIP_REALARRAY* realarray /**< dynamic real array */
186  )
187 {
188  assert(scip != NULL);
189 
190  SCIP_CALL( SCIPrealarrayClear(realarray) );
191 
192  return SCIP_OKAY;
193 }
194 
195 /** gets value of entry in dynamic array
196  *
197  * @return value of entry in dynamic array
198  */
200  SCIP* scip, /**< SCIP data structure */
201  SCIP_REALARRAY* realarray, /**< dynamic real array */
202  int idx /**< array index to get value for */
203  )
204 {
205  assert(scip != NULL);
206 
207  return SCIPrealarrayGetVal(realarray, idx);
208 }
209 
210 /** sets value of entry in dynamic array
211  *
212  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
213  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
214  */
216  SCIP* scip, /**< SCIP data structure */
217  SCIP_REALARRAY* realarray, /**< dynamic real array */
218  int idx, /**< array index to set value for */
219  SCIP_Real val /**< value to set array index to */
220  )
221 {
222  assert(scip != NULL);
223 
224  SCIP_CALL( SCIPrealarraySetVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
225 
226  return SCIP_OKAY;
227 }
228 
229 /** increases value of entry in dynamic array
230  *
231  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
232  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
233  */
235  SCIP* scip, /**< SCIP data structure */
236  SCIP_REALARRAY* realarray, /**< dynamic real array */
237  int idx, /**< array index to increase value for */
238  SCIP_Real incval /**< value to increase array index */
239  )
240 {
241  assert(scip != NULL);
242 
243  SCIP_CALL( SCIPrealarrayIncVal(realarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
244 
245  return SCIP_OKAY;
246 }
247 
248 /** returns the minimal index of all stored non-zero elements
249  *
250  * @return the minimal index of all stored non-zero elements
251  */
253  SCIP* scip, /**< SCIP data structure */
254  SCIP_REALARRAY* realarray /**< dynamic real array */
255  )
256 {
257  assert(scip != NULL);
258 
259  return SCIPrealarrayGetMinIdx(realarray);
260 }
261 
262 /** returns the maximal index of all stored non-zero elements
263  *
264  * @return the maximal index of all stored non-zero elements
265  */
267  SCIP* scip, /**< SCIP data structure */
268  SCIP_REALARRAY* realarray /**< dynamic real array */
269  )
270 {
271  assert(scip != NULL);
272 
273  return SCIPrealarrayGetMaxIdx(realarray);
274 }
275 
276 /** creates a dynamic array of int values
277  *
278  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
279  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
280  */
282  SCIP* scip, /**< SCIP data structure */
283  SCIP_INTARRAY** intarray /**< pointer to store the int array */
284  )
285 {
286  assert(scip != NULL);
287 
288  SCIP_CALL( SCIPintarrayCreate(intarray, SCIPblkmem(scip)) );
289 
290  return SCIP_OKAY;
291 }
292 
293 /** frees a dynamic array of int values
294  *
295  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
296  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
297  */
299  SCIP* scip, /**< SCIP data structure */
300  SCIP_INTARRAY** intarray /**< pointer to the int array */
301  )
302 {
303  assert(scip != NULL);
304 
305  SCIP_CALL( SCIPintarrayFree(intarray) );
306 
307  return SCIP_OKAY;
308 }
309 
310 /** extends dynamic array to be able to store indices from minidx to maxidx
311  *
312  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
313  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
314  */
316  SCIP* scip, /**< SCIP data structure */
317  SCIP_INTARRAY* intarray, /**< dynamic int array */
318  int minidx, /**< smallest index to allocate storage for */
319  int maxidx /**< largest index to allocate storage for */
320  )
321 {
322  assert(scip != NULL);
323 
324  SCIP_CALL( SCIPintarrayExtend(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
325 
326  return SCIP_OKAY;
327 }
328 
329 /** clears a dynamic int array
330  *
331  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
332  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
333  */
335  SCIP* scip, /**< SCIP data structure */
336  SCIP_INTARRAY* intarray /**< dynamic int array */
337  )
338 {
339  assert(scip != NULL);
340 
341  SCIP_CALL( SCIPintarrayClear(intarray) );
342 
343  return SCIP_OKAY;
344 }
345 
346 /** gets value of entry in dynamic array
347  *
348  * @return value of entry in dynamic array
349  */
351  SCIP* scip, /**< SCIP data structure */
352  SCIP_INTARRAY* intarray, /**< dynamic int array */
353  int idx /**< array index to get value for */
354  )
355 {
356  assert(scip != NULL);
357 
358  return SCIPintarrayGetVal(intarray, idx);
359 }
360 
361 /** sets value of entry in dynamic array
362  *
363  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
364  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
365  */
367  SCIP* scip, /**< SCIP data structure */
368  SCIP_INTARRAY* intarray, /**< dynamic int array */
369  int idx, /**< array index to set value for */
370  int val /**< value to set array index to */
371  )
372 {
373  assert(scip != NULL);
374 
375  SCIP_CALL( SCIPintarraySetVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
376 
377  return SCIP_OKAY;
378 }
379 
380 /** increases value of entry in dynamic array
381  *
382  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
383  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
384  */
386  SCIP* scip, /**< SCIP data structure */
387  SCIP_INTARRAY* intarray, /**< dynamic int array */
388  int idx, /**< array index to increase value for */
389  int incval /**< value to increase array index */
390  )
391 {
392  assert(scip != NULL);
393 
394  SCIP_CALL( SCIPintarrayIncVal(intarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, incval) );
395 
396  return SCIP_OKAY;
397 }
398 
399 /** returns the minimal index of all stored non-zero elements
400  *
401  * @return the minimal index of all stored non-zero elements
402  */
404  SCIP* scip, /**< SCIP data structure */
405  SCIP_INTARRAY* intarray /**< dynamic int array */
406  )
407 {
408  assert(scip != NULL);
409 
410  return SCIPintarrayGetMinIdx(intarray);
411 }
412 
413 /** returns the maximal index of all stored non-zero elements
414  *
415  * @return the maximal index of all stored non-zero elements
416  */
418  SCIP* scip, /**< SCIP data structure */
419  SCIP_INTARRAY* intarray /**< dynamic int array */
420  )
421 {
422  assert(scip != NULL);
423 
424  return SCIPintarrayGetMaxIdx(intarray);
425 }
426 
427 /** creates a dynamic array of bool values
428  *
429  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
430  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
431  */
433  SCIP* scip, /**< SCIP data structure */
434  SCIP_BOOLARRAY** boolarray /**< pointer to store the bool array */
435  )
436 {
437  assert(scip != NULL);
438 
439  SCIP_CALL( SCIPboolarrayCreate(boolarray, SCIPblkmem(scip)) );
440 
441  return SCIP_OKAY;
442 }
443 
444 /** frees a dynamic array of bool values
445  *
446  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
447  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
448  */
450  SCIP* scip, /**< SCIP data structure */
451  SCIP_BOOLARRAY** boolarray /**< pointer to the bool array */
452  )
453 {
454  assert(scip != NULL);
455 
456  SCIP_CALL( SCIPboolarrayFree(boolarray) );
457 
458  return SCIP_OKAY;
459 }
460 
461 /** extends dynamic array to be able to store indices from minidx to maxidx
462  *
463  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
464  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
465  */
467  SCIP* scip, /**< SCIP data structure */
468  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
469  int minidx, /**< smallest index to allocate storage for */
470  int maxidx /**< largest index to allocate storage for */
471  )
472 {
473  assert(scip != NULL);
474 
475  SCIP_CALL( SCIPboolarrayExtend(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
476 
477  return SCIP_OKAY;
478 }
479 
480 /** clears a dynamic bool array
481  *
482  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
483  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
484  */
486  SCIP* scip, /**< SCIP data structure */
487  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
488  )
489 {
490  assert(scip != NULL);
491 
492  SCIP_CALL( SCIPboolarrayClear(boolarray) );
493 
494  return SCIP_OKAY;
495 }
496 
497 /** gets value of entry in dynamic array
498  *
499  * @return value of entry in dynamic array at position idx
500  */
502  SCIP* scip, /**< SCIP data structure */
503  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
504  int idx /**< array index to get value for */
505  )
506 {
507  assert(scip != NULL);
508 
509  return SCIPboolarrayGetVal(boolarray, idx);
510 }
511 
512 /** sets value of entry in dynamic array
513  *
514  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
515  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
516  */
518  SCIP* scip, /**< SCIP data structure */
519  SCIP_BOOLARRAY* boolarray, /**< dynamic bool array */
520  int idx, /**< array index to set value for */
521  SCIP_Bool val /**< value to set array index to */
522  )
523 {
524  assert(scip != NULL);
525 
526  SCIP_CALL( SCIPboolarraySetVal(boolarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
527 
528  return SCIP_OKAY;
529 }
530 
531 /** returns the minimal index of all stored non-zero elements
532  *
533  * @return the minimal index of all stored non-zero elements
534  */
536  SCIP* scip, /**< SCIP data structure */
537  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
538  )
539 {
540  assert(scip != NULL);
541 
542  return SCIPboolarrayGetMinIdx(boolarray);
543 }
544 
545 /** returns the maximal index of all stored non-zero elements
546  *
547  * @return the maximal index of all stored non-zero elements
548  */
550  SCIP* scip, /**< SCIP data structure */
551  SCIP_BOOLARRAY* boolarray /**< dynamic bool array */
552  )
553 {
554  assert(scip != NULL);
555 
556  return SCIPboolarrayGetMaxIdx(boolarray);
557 }
558 
559 /** creates a dynamic array of pointers
560  *
561  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
562  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
563  */
565  SCIP* scip, /**< SCIP data structure */
566  SCIP_PTRARRAY** ptrarray /**< pointer to store the int array */
567  )
568 {
569  assert(scip != NULL);
570 
571  SCIP_CALL( SCIPptrarrayCreate(ptrarray, SCIPblkmem(scip)) );
572 
573  return SCIP_OKAY;
574 }
575 
576 /** frees a dynamic array of pointers
577  *
578  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
579  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
580  */
582  SCIP* scip, /**< SCIP data structure */
583  SCIP_PTRARRAY** ptrarray /**< pointer to the int array */
584  )
585 {
586  assert(scip != NULL);
587 
588  SCIP_CALL( SCIPptrarrayFree(ptrarray) );
589 
590  return SCIP_OKAY;
591 }
592 
593 /** extends dynamic array to be able to store indices from minidx to maxidx
594  *
595  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
596  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
597  */
599  SCIP* scip, /**< SCIP data structure */
600  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
601  int minidx, /**< smallest index to allocate storage for */
602  int maxidx /**< largest index to allocate storage for */
603  )
604 {
605  assert(scip != NULL);
606 
607  SCIP_CALL( SCIPptrarrayExtend(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, minidx, maxidx) );
608 
609  return SCIP_OKAY;
610 }
611 
612 /** clears a dynamic pointer array
613  *
614  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
615  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
616  */
618  SCIP* scip, /**< SCIP data structure */
619  SCIP_PTRARRAY* ptrarray /**< dynamic int array */
620  )
621 {
622  assert(scip != NULL);
623 
624  SCIP_CALL( SCIPptrarrayClear(ptrarray) );
625 
626  return SCIP_OKAY;
627 }
628 
629 /** gets value of entry in dynamic array */
631  SCIP* scip, /**< SCIP data structure */
632  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
633  int idx /**< array index to get value for */
634  )
635 {
636  assert(scip != NULL);
637 
638  return SCIPptrarrayGetVal(ptrarray, idx);
639 }
640 
641 /** sets value of entry in dynamic array
642  *
643  * @return \ref SCIP_OKAY is returned if everything worked. Otherwise a suitable error code is passed. See \ref
644  * SCIP_Retcode "SCIP_RETCODE" for a complete list of error codes.
645  */
647  SCIP* scip, /**< SCIP data structure */
648  SCIP_PTRARRAY* ptrarray, /**< dynamic int array */
649  int idx, /**< array index to set value for */
650  void* val /**< value to set array index to */
651  )
652 {
653  assert(scip != NULL);
654 
655  SCIP_CALL( SCIPptrarraySetVal(ptrarray, scip->set->mem_arraygrowinit, scip->set->mem_arraygrowfac, idx, val) );
656 
657  return SCIP_OKAY;
658 }
659 
660 /** returns the minimal index of all stored non-zero elements
661  *
662  * @return the minimal index of all stored non-zero elements
663  */
665  SCIP* scip, /**< SCIP data structure */
666  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
667  )
668 {
669  assert(scip != NULL);
670 
671  return SCIPptrarrayGetMinIdx(ptrarray);
672 }
673 
674 /** returns the maximal index of all stored non-zero elements
675  *
676  * @return the maximal index of all stored non-zero elements
677  */
679  SCIP* scip, /**< SCIP data structure */
680  SCIP_PTRARRAY* ptrarray /**< dynamic ptr array */
681  )
682 {
683  assert(scip != NULL);
684 
685  return SCIPptrarrayGetMaxIdx(ptrarray);
686 }
687 
688 /** creates directed graph structure */
690  SCIP* scip, /**< SCIP data structure */
691  SCIP_DIGRAPH** digraph, /**< pointer to store the created directed graph */
692  int nnodes /**< number of nodes */
693  )
694 {
695  assert(scip != NULL);
696  assert(digraph != NULL);
697 
698  SCIP_CALL( SCIPdigraphCreate(digraph, scip->mem->probmem, nnodes) );
699 
700  return SCIP_OKAY;
701 }
702 
703 /** copies directed graph structure
704  *
705  * The copying procedure uses the memory of the passed SCIP instance. The user must ensure that the digraph lives
706  * as most as long as the SCIP instance.
707  *
708  * @note The data in nodedata is copied verbatim. This possibly has to be adapted by the user.
709  */
711  SCIP* scip, /**< SCIP data structure */
712  SCIP_DIGRAPH** targetdigraph, /**< pointer to store the copied directed graph */
713  SCIP_DIGRAPH* sourcedigraph /**< source directed graph */
714  )
715 {
716  assert(scip != NULL);
717  assert(sourcedigraph != NULL);
718  assert(targetdigraph != NULL);
719 
720  SCIP_CALL( SCIPdigraphCopy(targetdigraph, sourcedigraph, scip->mem->probmem) );
721 
722  return SCIP_OKAY;
723 }
724 
725 /** creates a disjoint set (union find) structure \p uf for \p ncomponents many components (of size one) */
727  SCIP* scip, /**< SCIP data structure */
728  SCIP_DISJOINTSET** djset, /**< disjoint set (union find) data structure */
729  int ncomponents /**< number of components */
730  )
731 {
732  assert(scip != NULL);
733  assert(djset != NULL);
734 
735  SCIP_CALL( SCIPdisjointsetCreate(djset, scip->mem->probmem, ncomponents) );
736 
737  return SCIP_OKAY;
738 }
739 
740 /** frees the disjoint set (union find) data structure */
742  SCIP* scip, /**< SCIP data structure */
743  SCIP_DISJOINTSET** djset /**< disjoint set (union find) data structure */
744  )
745 {
746  assert(scip != NULL);
747 
748  SCIPdisjointsetFree(djset, scip->mem->probmem);
749 }
internal methods for separators
int SCIPrealarrayGetMaxIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3973
SCIP_RETCODE SCIPincIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int incval)
#define NULL
Definition: def.h:239
internal methods for managing events
default message handler
trivialnegation primal heuristic
internal methods for storing primal CIP solutions
SCIP_RETCODE SCIPextendBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray, int minidx, int maxidx)
methods to interpret (evaluate) an expression tree "fast"
internal methods for branch and bound tree
SCIP_RETCODE SCIPcreateBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
public methods for memory management
SCIP_RETCODE SCIPintarrayIncVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int incval)
Definition: misc.c:4315
int SCIPgetIntarrayMaxIdx(SCIP *scip, SCIP_INTARRAY *intarray)
methods for implications, variable bounds, and cliques
internal methods for clocks and timing issues
int SCIPintarrayGetMinIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:4327
SCIP_RETCODE SCIPrealarrayCreate(SCIP_REALARRAY **realarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3611
SCIP_Bool SCIPboolarrayGetVal(SCIP_BOOLARRAY *boolarray, int idx)
Definition: misc.c:4594
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPcreateRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
SCIP_RETCODE SCIPextendIntarray(SCIP *scip, SCIP_INTARRAY *intarray, int minidx, int maxidx)
interface methods for specific LP solvers
int SCIPintarrayGetVal(SCIP_INTARRAY *intarray, int idx)
Definition: misc.c:4226
internal methods for displaying statistics tables
SCIP_RETCODE SCIPincRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real incval)
SCIP_RETCODE SCIPextendRealarray(SCIP *scip, SCIP_REALARRAY *realarray, int minidx, int maxidx)
void * SCIPptrarrayGetVal(SCIP_PTRARRAY *ptrarray, int idx)
Definition: misc.c:4947
methods for the aggregation rows
int SCIPboolarrayGetMaxIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4693
internal methods for Benders&#39; decomposition
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
methods commonly used by primal heuristics
SCIP_RETCODE SCIPcreateIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
SCIP_RETCODE SCIPfreeIntarray(SCIP *scip, SCIP_INTARRAY **intarray)
SCIP_RETCODE SCIPptrarrayExtend(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4761
internal methods for branching rules and branching candidate storage
datastructures for concurrent solvers
SCIP_Real mem_arraygrowfac
Definition: struct_set.h:349
int SCIPgetPtrarrayMaxIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
internal methods for handling parameter settings
methods for creating output for visualization tools (VBC, BAK)
nodereopt branching rule
int SCIPptrarrayGetMinIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:5036
int SCIPgetIntarrayMinIdx(SCIP *scip, SCIP_INTARRAY *intarray)
internal methods for LP management
SCIP_RETCODE SCIPcreateDigraph(SCIP *scip, SCIP_DIGRAPH **digraph, int nnodes)
int SCIPrealarrayGetMinIdx(SCIP_REALARRAY *realarray)
Definition: misc.c:3963
internal methods for branching and inference history
internal methods for collecting primal CIP solutions and primal informations
SCIP_RETCODE SCIPsetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx, SCIP_Bool val)
SCIP_RETCODE SCIPboolarraySetVal(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Bool val)
Definition: misc.c:4615
SCIP_RETCODE SCIPclearRealarray(SCIP *scip, SCIP_REALARRAY *realarray)
internal methods for propagators
SCIP_RETCODE SCIPclearPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray)
SCIP_RETCODE SCIPintarrayFree(SCIP_INTARRAY **intarray)
Definition: misc.c:4026
void * SCIPgetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx)
SCIP_RETCODE SCIPrealarrayIncVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real incval)
Definition: misc.c:3945
SCIP_MEM * mem
Definition: struct_scip.h:61
git hash methods
internal methods for storing and manipulating the main problem
void SCIPdisjointsetFree(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
Definition: misc.c:10488
methods for block memory pools and memory buffers
SCIP_RETCODE SCIPboolarrayCreate(SCIP_BOOLARRAY **boolarray, BMS_BLKMEM *blkmem)
Definition: misc.c:4348
register additional core functionality that is designed as plugins
SCIP_Real SCIPrealarrayGetVal(SCIP_REALARRAY *realarray, int idx)
Definition: misc.c:3855
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
Definition: scip_mem.c:128
int SCIPintarrayGetMaxIdx(SCIP_INTARRAY *intarray)
Definition: misc.c:4337
internal methods for presolvers
SCIP_RETCODE SCIPdigraphCreate(SCIP_DIGRAPH **digraph, BMS_BLKMEM *blkmem, int nnodes)
Definition: misc.c:6900
internal methods for NLP management
internal miscellaneous methods
SCIP_RETCODE SCIPboolarrayClear(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4563
SCIP_RETCODE SCIPclearBoolarray(SCIP *scip, SCIP_BOOLARRAY *boolarray)
internal methods for node selectors and node priority queues
internal methods for variable pricers
SCIP_RETCODE SCIPfreeBoolarray(SCIP *scip, SCIP_BOOLARRAY **boolarray)
int SCIPptrarrayGetMaxIdx(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:5046
internal methods for global SCIP settings
internal methods for storing conflicts
#define SCIP_CALL(x)
Definition: def.h:351
SCIP main data structure.
int SCIPgetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx)
SCIP_RETCODE SCIPintarraySetVal(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, int val)
Definition: misc.c:4247
internal methods for storing priced variables
internal methods for relaxators
SCIP_RETCODE SCIPfreeRealarray(SCIP *scip, SCIP_REALARRAY **realarray)
SCIP_RETCODE SCIPcreateDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset, int ncomponents)
internal methods for storing separated cuts
int SCIPgetRealarrayMaxIdx(SCIP *scip, SCIP_REALARRAY *realarray)
SCIP_RETCODE SCIPsetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx, SCIP_Real val)
int SCIPgetBoolarrayMinIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
methods commonly used for presolving
methods for catching the user CTRL-C interrupt
internal methods for problem variables
data structures and methods for collecting reoptimization information
the function declarations for the synchronization store
internal methods for user interface dialog
#define SCIP_Bool
Definition: def.h:62
internal methods for input file readers
int mem_arraygrowinit
Definition: struct_set.h:352
SCIP_RETCODE SCIPrealarrayFree(SCIP_REALARRAY **realarray)
Definition: misc.c:3655
methods for debugging
SCIP_RETCODE SCIPsetIntarrayVal(SCIP *scip, SCIP_INTARRAY *intarray, int idx, int val)
int SCIPboolarrayGetMinIdx(SCIP_BOOLARRAY *boolarray)
Definition: misc.c:4683
reoptsols primal heuristic
internal methods for storing cuts in a cut pool
Constraint handler for linear constraints in their most general form, .
SCIP_RETCODE SCIPextendPtrarray(SCIP *scip, SCIP_PTRARRAY *ptrarray, int minidx, int maxidx)
helper functions for concurrent scip solvers
SCIP_RETCODE SCIPptrarrayClear(SCIP_PTRARRAY *ptrarray)
Definition: misc.c:4916
internal methods for return codes for SCIP methods
int SCIPgetBoolarrayMaxIdx(SCIP *scip, SCIP_BOOLARRAY *boolarray)
SCIP_RETCODE SCIPcreatePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
BMS_BLKMEM * probmem
Definition: struct_mem.h:40
SCIP_RETCODE SCIPptrarrayFree(SCIP_PTRARRAY **ptrarray)
Definition: misc.c:4747
internal methods for conflict analysis
internal methods for tree compressions
internal methods for main solving loop and node processing
SCIP_Real SCIPgetRealarrayVal(SCIP *scip, SCIP_REALARRAY *realarray, int idx)
SCIP_RETCODE SCIPintarrayExtend(SCIP_INTARRAY *intarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4040
SCIP_RETCODE SCIPptrarraySetVal(SCIP_PTRARRAY *ptrarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, void *val)
Definition: misc.c:4968
int SCIPgetRealarrayMinIdx(SCIP *scip, SCIP_REALARRAY *realarray)
SCIP_RETCODE SCIPclearIntarray(SCIP *scip, SCIP_INTARRAY *intarray)
SCIP_SET * set
Definition: struct_scip.h:62
SCIP_RETCODE SCIPdigraphCopy(SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph, BMS_BLKMEM *targetblkmem)
Definition: misc.c:6972
SCIP_RETCODE SCIPboolarrayFree(SCIP_BOOLARRAY **boolarray)
Definition: misc.c:4392
public methods for message output
default user interface dialog
#define SCIP_Real
Definition: def.h:150
internal methods for problem statistics
SCIP_RETCODE SCIPrealarrayExtend(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:3669
public methods for data structures
internal methods for constraints and constraint handlers
SCIP_RETCODE SCIPdisjointsetCreate(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
Definition: misc.c:10370
SCIP_RETCODE SCIPrealarraySetVal(SCIP_REALARRAY *realarray, int arraygrowinit, SCIP_Real arraygrowfac, int idx, SCIP_Real val)
Definition: misc.c:3876
declarations for XML parsing
SCIP_RETCODE SCIPintarrayClear(SCIP_INTARRAY *intarray)
Definition: misc.c:4195
build flags methods
SCIP_Bool SCIPgetBoolarrayVal(SCIP *scip, SCIP_BOOLARRAY *boolarray, int idx)
#define nnodes
Definition: gastrans.c:65
int SCIPgetPtrarrayMinIdx(SCIP *scip, SCIP_PTRARRAY *ptrarray)
SCIP_RETCODE SCIPboolarrayExtend(SCIP_BOOLARRAY *boolarray, int arraygrowinit, SCIP_Real arraygrowfac, int minidx, int maxidx)
Definition: misc.c:4406
common defines and data types used in all packages of SCIP
internal methods for primal heuristics
void SCIPfreeDisjointset(SCIP *scip, SCIP_DISJOINTSET **djset)
SCIP_RETCODE SCIPptrarrayCreate(SCIP_PTRARRAY **ptrarray, BMS_BLKMEM *blkmem)
Definition: misc.c:4704
SCIP_RETCODE SCIPcopyDigraph(SCIP *scip, SCIP_DIGRAPH **targetdigraph, SCIP_DIGRAPH *sourcedigraph)
SCIP_RETCODE SCIPintarrayCreate(SCIP_INTARRAY **intarray, BMS_BLKMEM *blkmem)
Definition: misc.c:3983
internal methods for Benders&#39; decomposition cuts
SCIP_RETCODE SCIPsetPtrarrayVal(SCIP *scip, SCIP_PTRARRAY *ptrarray, int idx, void *val)
internal methods for displaying runtime statistics
SCIP_RETCODE SCIPrealarrayClear(SCIP_REALARRAY *realarray)
Definition: misc.c:3824
SCIP_RETCODE SCIPfreePtrarray(SCIP *scip, SCIP_PTRARRAY **ptrarray)
OFINS - Objective Function Induced Neighborhood Search - a primal heuristic for reoptimization.