Scippy

SCIP

Solving Constraint Integer Programs

pub_misc.h
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-2019 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 pub_misc.h
17  * @ingroup PUBLICCOREAPI
18  * @brief public data structures and miscellaneous methods
19  * @author Tobias Achterberg
20  * @author Gerald Gamrath
21  * @author Stefan Heinz
22  * @author Gregor Hendel
23  * @author Michael Winkler
24  * @author Kati Wolter
25  *
26  * This file contains a bunch of data structures and miscellaneous methods:
27  *
28  * - \ref DataStructures "Data structures"
29  * - \ref MiscellaneousMethods "Miscellaneous Methods"
30  */
31 
32 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33 
34 #ifndef __SCIP_PUB_MISC_H__
35 #define __SCIP_PUB_MISC_H__
36 
37 /* on SunOS, the function finite(a) (for the SCIPisFinite macro below) is declared in ieeefp.h */
38 #ifdef __sun
39 #include <ieeefp.h>
40 #endif
41 #include <math.h>
42 
43 #include "scip/def.h"
44 #include "blockmemshell/memory.h"
45 #include "scip/type_retcode.h"
46 #include "scip/type_misc.h"
47 #include "scip/type_message.h"
48 #include "scip/type_var.h"
49 #include "scip/pub_misc_select.h"
50 #include "scip/pub_misc_sort.h"
51 #include "scip/pub_misc_linear.h"
52 
53 /* in optimized mode some of the function are handled via defines, for that the structs are needed */
54 #ifdef NDEBUG
55 #include "scip/struct_misc.h"
56 #endif
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 /*
63  * methods for statistical tests
64  */
65 
66 /**@defgroup STATISTICALTESTS Statistical tests
67  * @ingroup MiscellaneousMethods
68  * @brief public methods for statistical tests
69  *
70  * Below are the public methods for statistical tests inside of \SCIP
71  *
72  * @{
73  */
74 
75 /** get critical value of a Student-T distribution for a given number of degrees of freedom at a confidence level */
78  SCIP_CONFIDENCELEVEL clevel, /**< (one-sided) confidence level */
79  int df /**< degrees of freedom */
80  );
81 
82 /** compute a t-value for the hypothesis that x and y are from the same population; Assuming that
83  * x and y represent normally distributed random samples with equal variance, the returned value
84  * comes from a Student-T distribution with countx + county - 2 degrees of freedom; this
85  * value can be compared with a critical value (see also SCIPstudentTGetCriticalValue()) at
86  * a predefined confidence level for checking if x and y significantly differ in location
87  */
90  SCIP_Real meanx, /**< the mean of the first distribution */
91  SCIP_Real meany, /**< the mean of the second distribution */
92  SCIP_Real variancex, /**< the variance of the x-distribution */
93  SCIP_Real variancey, /**< the variance of the y-distribution */
94  SCIP_Real countx, /**< number of samples of x */
95  SCIP_Real county /**< number of samples of y */
96  );
97 
98 /** returns the value of the Gauss error function evaluated at a given point */
101  SCIP_Real x /**< value to evaluate */
102  );
103 
104 /** get critical value of a standard normal distribution at a given confidence level */
107  SCIP_CONFIDENCELEVEL clevel /**< (one-sided) confidence level */
108  );
109 
110 /** calculates the cumulative distribution P(-infinity <= x <= value) that a normally distributed
111  * random variable x takes a value between -infinity and parameter \p value.
112  *
113  * The distribution is given by the respective mean and deviation. This implementation
114  * uses the error function erf().
115  */
118  SCIP_Real mean, /**< the mean value of the distribution */
119  SCIP_Real variance, /**< the square of the deviation of the distribution */
120  SCIP_Real value /**< the upper limit of the calculated distribution integral */
121  );
122 
123 /**@} */
124 
125 /**@defgroup Regression Linear Regression
126  * @ingroup MiscellaneousMethods
127  * @brief methods for linear regression
128  *
129  * Below are the public methods for incremental linear regression of observations pairs \f$(X_i,Y_i), i=1\dots,n\f$
130  *
131  * @{
132  */
133 
134 /** returns the number of observations of this regression */
137  SCIP_REGRESSION* regression /**< regression data structure */
138  );
139 
140 /** return the current slope of the regression */
143  SCIP_REGRESSION* regression /**< regression data structure */
144  );
145 
146 /** get the current y-intercept of the regression */
149  SCIP_REGRESSION* regression /**< regression data structure */
150  );
151 
152 /** removes an observation (x,y) from the regression */
155  SCIP_REGRESSION* regression, /**< regression data structure */
156  SCIP_Real x, /**< X of observation */
157  SCIP_Real y /**< Y of the observation */
158  );
159 
160 /** update regression by a new observation (x,y) */
163  SCIP_REGRESSION* regression, /**< regression data structure */
164  SCIP_Real x, /**< X of observation */
165  SCIP_Real y /**< Y of the observation */
166  );
167 
168 /** reset regression data structure */
171  SCIP_REGRESSION* regression /**< regression data structure */
172  );
173 
174 /** creates and resets a regression */
177  SCIP_REGRESSION** regression /**< regression data structure */
178  );
179 
180 /** frees a regression */
182 void SCIPregressionFree(
183  SCIP_REGRESSION** regression /**< regression data structure */
184  );
185 
186 /**@} */
187 
188 /*
189  */
190 
191 /**@defgroup GMLgraph GML Graphical Printing
192  * @ingroup MiscellaneousMethods
193  * @brief GML graph printing methods
194  *
195  * For a detailed format decription see http://docs.yworks.com/yfiles/doc/developers-guide/gml.html
196  *
197  * @{
198  */
199 
200 
201 /** writes a node section to the given graph file */
203 void SCIPgmlWriteNode(
204  FILE* file, /**< file to write to */
205  unsigned int id, /**< id of the node */
206  const char* label, /**< label of the node */
207  const char* nodetype, /**< type of the node, or NULL */
208  const char* fillcolor, /**< color of the node's interior, or NULL */
209  const char* bordercolor /**< color of the node's border, or NULL */
210  );
211 
212 /** writes a node section including weight to the given graph file */
215  FILE* file, /**< file to write to */
216  unsigned int id, /**< id of the node */
217  const char* label, /**< label of the node */
218  const char* nodetype, /**< type of the node, or NULL */
219  const char* fillcolor, /**< color of the node's interior, or NULL */
220  const char* bordercolor, /**< color of the node's border, or NULL */
221  SCIP_Real weight /**< weight of node */
222  );
223 
224 /** writes an edge section to the given graph file */
226 void SCIPgmlWriteEdge(
227  FILE* file, /**< file to write to */
228  unsigned int source, /**< source node id of the node */
229  unsigned int target, /**< target node id of the edge */
230  const char* label, /**< label of the edge, or NULL */
231  const char* color /**< color of the edge, or NULL */
232  );
233 
234 /** writes an arc section to the given graph file */
236 void SCIPgmlWriteArc(
237  FILE* file, /**< file to write to */
238  unsigned int source, /**< source node id of the node */
239  unsigned int target, /**< target node id of the edge */
240  const char* label, /**< label of the edge, or NULL */
241  const char* color /**< color of the edge, or NULL */
242  );
243 
244 /** writes the starting line to a GML graph file, does not open a file */
247  FILE* file, /**< file to write to */
248  SCIP_Bool directed /**< is the graph directed */
249  );
250 
251 /** writes the ending lines to a GML graph file, does not close a file */
254  FILE* file /**< file to close */
255  );
256 
257 /**@} */
258 
259 /*
260  * Sparse solution
261  */
262 
263 /**@defgroup SparseSol Sparse Solution
264  * @ingroup DataStructures
265  * @brief sparse storage for multiple integer solutions
266  *
267  * @{
268  */
269 
270 /** creates a sparse solution */
273  SCIP_SPARSESOL** sparsesol, /**< pointer to store the created sparse solution */
274  SCIP_VAR** vars, /**< variables in the sparse solution, must not contain continuous variables */
275  int nvars, /**< number of variables to store, size of the lower and upper bound arrays */
276  SCIP_Bool cleared /**< should the lower and upper bound arrays be cleared (entries set to 0) */
277  );
278 
279 /** frees sparse solution */
281 void SCIPsparseSolFree(
282  SCIP_SPARSESOL** sparsesol /**< pointer to a sparse solution */
283  );
284 
285 /** returns the variables in the given sparse solution */
288  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
289  );
290 
291 /** returns the number of variables in the given sparse solution */
294  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
295  );
296 
297 /** returns the the lower bound array for all variables for a given sparse solution */
300  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
301  );
302 
303 /** returns the the upper bound array for all variables for a given sparse solution */
306  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
307  );
308 
309 /** constructs the first solution of sparse solution (all variables are set to their lower bound value */
312  SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
313  SCIP_Longint* sol, /**< array to store the first solution */
314  int nvars /**< number of variables */
315  );
316 
317 /** constructs the next solution of the sparse solution and return whether there was one more or not */
320  SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
321  SCIP_Longint* sol, /**< current solution array which get changed to the next solution */
322  int nvars /**< number of variables */
323  );
324 
325 /**@} */
326 
327 
328 /*
329  * Queue
330  */
331 
332 /**@defgroup Queue Queue
333  * @ingroup DataStructures
334  * @brief circular FIFO queue
335  *
336  * @{
337  */
338 
339 
340 /** creates a (circular) queue, best used if the size will be fixed or will not be increased that much */
343  SCIP_QUEUE** queue, /**< pointer to the new queue */
344  int initsize, /**< initial number of available element slots */
345  SCIP_Real sizefac /**< memory growing factor applied, if more element slots are needed */
346  );
347 
348 
349 /** frees queue, but not the data elements themselves */
351 void SCIPqueueFree(
352  SCIP_QUEUE** queue /**< pointer to a queue */
353  );
354 
355 /** clears the queue, but doesn't free the data elements themselves */
357 void SCIPqueueClear(
358  SCIP_QUEUE* queue /**< queue */
359  );
360 
361 /** inserts pointer element at the end of the queue */
364  SCIP_QUEUE* queue, /**< queue */
365  void* elem /**< element to be inserted */
366  );
367 
368 /** inserts unsigned integer element at the end of the queue */
371  SCIP_QUEUE* queue, /**< queue */
372  unsigned int elem /**< element to be inserted */
373  );
374 
375 /** removes and returns the first element of the queue, or NULL if no element exists */
377 void* SCIPqueueRemove(
378  SCIP_QUEUE* queue /**< queue */
379  );
380 
381 /** removes and returns the first unsigned integer element of the queue, or UNIT_MAX if no element exists */
383 unsigned int SCIPqueueRemoveUInt(
384  SCIP_QUEUE* queue /**< queue */
385  );
386 
387 /** returns the first element of the queue without removing it, or NULL if no element exists */
389 void* SCIPqueueFirst(
390  SCIP_QUEUE* queue /**< queue */
391  );
392 
393 /** returns the first unsigned integer element of the queue without removing it, or UINT_MAX if no element exists */
395 unsigned int SCIPqueueFirstUInt(
396  SCIP_QUEUE* queue /**< queue */
397  );
398 
399 /** returns whether the queue is empty */
402  SCIP_QUEUE* queue /**< queue */
403  );
404 
405 /** returns the number of elements in the queue */
407 int SCIPqueueNElems(
408  SCIP_QUEUE* queue /**< queue */
409  );
410 
411 /**@} */
412 
413 /*
414  * Priority Queue
415  */
416 
417 /**@defgroup PriorityQueue Priority Queue
418  * @ingroup DataStructures
419  * @brief priority queue with O(1) access to the minimum element
420  *
421  * @{
422  */
423 
424 /** creates priority queue */
427  SCIP_PQUEUE** pqueue, /**< pointer to a priority queue */
428  int initsize, /**< initial number of available element slots */
429  SCIP_Real sizefac, /**< memory growing factor applied, if more element slots are needed */
430  SCIP_DECL_SORTPTRCOMP((*ptrcomp)) /**< data element comparator */
431  );
432 
433 /** frees priority queue, but not the data elements themselves */
435 void SCIPpqueueFree(
436  SCIP_PQUEUE** pqueue /**< pointer to a priority queue */
437  );
438 
439 /** clears the priority queue, but doesn't free the data elements themselves */
441 void SCIPpqueueClear(
442  SCIP_PQUEUE* pqueue /**< priority queue */
443  );
444 
445 /** inserts element into priority queue */
448  SCIP_PQUEUE* pqueue, /**< priority queue */
449  void* elem /**< element to be inserted */
450  );
451 
452 /** removes and returns best element from the priority queue */
454 void* SCIPpqueueRemove(
455  SCIP_PQUEUE* pqueue /**< priority queue */
456  );
457 
458 /** returns the best element of the queue without removing it */
460 void* SCIPpqueueFirst(
461  SCIP_PQUEUE* pqueue /**< priority queue */
462  );
463 
464 /** returns the number of elements in the queue */
466 int SCIPpqueueNElems(
467  SCIP_PQUEUE* pqueue /**< priority queue */
468  );
469 
470 /** returns the elements of the queue; changing the returned array may destroy the queue's ordering! */
472 void** SCIPpqueueElems(
473  SCIP_PQUEUE* pqueue /**< priority queue */
474  );
475 
476 /**@} */
477 
478 
479 /*
480  * Hash Table
481  */
482 
483 /**@defgroup HashTable Hash Table
484  * @ingroup DataStructures
485  * @brief hash table that resolves conflicts by probing
486  *
487  *@{
488  */
489 
490 /* fast 2-universal hash functions for two and four elements */
491 
492 #define SCIPhashSignature64(a) (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26))
493 #define SCIPhashTwo(a, b) ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32))
494 
495 #define SCIPhashFour(a, b, c, d) ((uint32_t)((((uint64_t)(a) + 0xbd5c89185f082658ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) + \
496  ((uint64_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(d) + 0x926f2d4dc4a67218ULL))>>32 ))
497 
498 /* helpers to use above hashfuncions */
499 #define SCIPcombineTwoInt(a, b) (((uint64_t) (a) << 32) | (uint64_t) (b) )
500 
501 #define SCIPcombineThreeInt(a, b, c) (((uint64_t) (a) << 43) + ((uint64_t) (b) << 21) + ((uint64_t) (c)) )
502 
503 #define SCIPcombineFourInt(a, b, c, d) (((uint64_t) (a) << 48) + ((uint64_t) (b) << 32) + ((uint64_t) (c) << 16) + ((uint64_t) (d)) )
504 
505 /** computes a hashcode for double precision floating point values containing
506  * 15 significant bits, the sign and the exponent
507  */
508 INLINE static
509 uint32_t SCIPrealHashCode(double x)
510 {
511  int theexp;
512  return (((uint32_t)(uint16_t)(int16_t)ldexp(frexp(x, &theexp), 15))<<16) | (uint32_t)(uint16_t)theexp;
513 }
514 
515 /** creates a hash table */
518  SCIP_HASHTABLE** hashtable, /**< pointer to store the created hash table */
519  BMS_BLKMEM* blkmem, /**< block memory used to store hash table entries */
520  int tablesize, /**< size of the hash table */
521  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
522  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
523  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
524  void* userptr /**< user pointer */
525  );
526 
527 /** frees the hash table */
529 void SCIPhashtableFree(
530  SCIP_HASHTABLE** hashtable /**< pointer to the hash table */
531  );
532 
533 /** removes all elements of the hash table
534  *
535  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
536  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
537  *
538  * @deprecated Please use SCIPhashtableRemoveAll()
539  */
541 void SCIPhashtableClear(
542  SCIP_HASHTABLE* hashtable /**< hash table */
543  );
544 
545 /** inserts element in hash table (multiple inserts of same element override the previous entry) */
548  SCIP_HASHTABLE* hashtable, /**< hash table */
549  void* element /**< element to insert into the table */
550  );
551 
552 /** inserts element in hash table (multiple insertion of same element is checked and results in an error) */
555  SCIP_HASHTABLE* hashtable, /**< hash table */
556  void* element /**< element to insert into the table */
557  );
558 
559 /** retrieve element with key from hash table, returns NULL if not existing */
562  SCIP_HASHTABLE* hashtable, /**< hash table */
563  void* key /**< key to retrieve */
564  );
565 
566 /** returns whether the given element exists in the table */
569  SCIP_HASHTABLE* hashtable, /**< hash table */
570  void* element /**< element to search in the table */
571  );
572 
573 /** removes element from the hash table, if it exists */
576  SCIP_HASHTABLE* hashtable, /**< hash table */
577  void* element /**< element to remove from the table */
578  );
579 
580 /** removes all elements of the hash table */
583  SCIP_HASHTABLE* hashtable /**< hash table */
584  );
585 
586 /** returns number of hash table elements */
589  SCIP_HASHTABLE* hashtable /**< hash table */
590  );
591 
592 /** gives the number of entries in the internal arrays of a hash table */
595  SCIP_HASHTABLE* hashtable /**< hash table */
596  );
597 
598 /** gives the element at the given index or NULL if entry at that index has no element */
601  SCIP_HASHTABLE* hashtable, /**< hash table */
602  int entryidx /**< index of hash table entry */
603  );
604 
605 /** returns the load of the given hash table in percentage */
608  SCIP_HASHTABLE* hashtable /**< hash table */
609  );
610 
611 /** prints statistics about hash table usage */
614  SCIP_HASHTABLE* hashtable, /**< hash table */
615  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
616  );
617 
618 /**@} */
619 
620 /*
621  * MultiHash Table
622  */
623 
624 /**@defgroup MultiHash Multi Hash table
625  * @ingroup DataStructures
626  * @brief hash table that resolves conflicts by queueing, thereby allowing for duplicate entries
627  *
628  *@{
629  */
630 
631 /** returns a reasonable hash table size (a prime number) that is at least as large as the specified value */
634  int minsize /**< minimal size of the hash table */
635  );
636 
637 /** creates a multihash table */
640  SCIP_MULTIHASH** multihash, /**< pointer to store the created multihash table */
641  BMS_BLKMEM* blkmem, /**< block memory used to store multihash table entries */
642  int tablesize, /**< size of the hash table */
643  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
644  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
645  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
646  void* userptr /**< user pointer */
647  );
648 
649 /** frees the multihash table */
651 void SCIPmultihashFree(
652  SCIP_MULTIHASH** multihash /**< pointer to the multihash table */
653  );
654 
655 /** inserts element in multihash table (multiple inserts of same element possible)
656  *
657  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding an element
658  * to the hash table, due to dynamic resizing.
659  */
662  SCIP_MULTIHASH* multihash, /**< multihash table */
663  void* element /**< element to insert into the table */
664  );
665 
666 /** inserts element in multihash table (multiple insertion of same element is checked and results in an error)
667  *
668  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding a new
669  * element to the multihash table, due to dynamic resizing.
670  */
673  SCIP_MULTIHASH* multihash, /**< multihash table */
674  void* element /**< element to insert into the table */
675  );
676 
677 /** retrieve element with key from multihash table, returns NULL if not existing */
680  SCIP_MULTIHASH* multihash, /**< multihash table */
681  void* key /**< key to retrieve */
682  );
683 
684 /** retrieve element with key from multihash table, returns NULL if not existing
685  * can be used to retrieve all entries with the same key (one-by-one)
686  *
687  * @note The returned multimultihashlist pointer might get invalid when adding a new element to the multihash table.
688  */
691  SCIP_MULTIHASH* multihash, /**< multihash table */
692  SCIP_MULTIHASHLIST** multihashlist, /**< input: entry in hash table list from which to start searching, or NULL
693  * output: entry in hash table list corresponding to element after
694  * retrieved one, or NULL */
695  void* key /**< key to retrieve */
696  );
697 
698 /** returns whether the given element exists in the multihash table */
701  SCIP_MULTIHASH* multihash, /**< multihash table */
702  void* element /**< element to search in the table */
703  );
704 
705 /** removes element from the multihash table, if it exists */
708  SCIP_MULTIHASH* multihash, /**< multihash table */
709  void* element /**< element to remove from the table */
710  );
711 
712 /** removes all elements of the multihash table
713  *
714  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
715  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
716  */
719  SCIP_MULTIHASH* multihash /**< multihash table */
720  );
721 
722 /** returns number of multihash table elements */
725  SCIP_MULTIHASH* multihash /**< multihash table */
726  );
727 
728 /** returns the load of the given multihash table in percentage */
731  SCIP_MULTIHASH* multihash /**< multihash table */
732  );
733 
734 /** prints statistics about multihash table usage */
737  SCIP_MULTIHASH* multihash, /**< multihash table */
738  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
739  );
740 
741 /** standard hash key comparator for string keys */
743 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString);
744 
745 /** standard hashing function for string keys */
747 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString);
748 
749 /** gets the element as the key */
751 SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard);
752 
753 /** returns TRUE iff both keys(pointer) are equal */
755 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqPtr);
756 
757 /** returns the hash value of the key */
759 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValPtr);
760 
761 /**@} */
762 
763 
764 /*
765  * Hash Map
766  */
767 
768 /**@defgroup HashMap Hash Map
769  * @ingroup DataStructures
770  * @brief hash map to store key-value pairs (called \p origin and \p image)
771  *
772  * @{
773  */
774 
775 /** creates a hash map mapping pointers to pointers */
778  SCIP_HASHMAP** hashmap, /**< pointer to store the created hash map */
779  BMS_BLKMEM* blkmem, /**< block memory used to store hash map entries */
780  int mapsize /**< size of the hash map */
781  );
782 
783 /** frees the hash map */
785 void SCIPhashmapFree(
786  SCIP_HASHMAP** hashmap /**< pointer to the hash map */
787  );
788 
789 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
792  SCIP_HASHMAP* hashmap, /**< hash map */
793  void* origin, /**< origin to set image for */
794  void* image /**< new image for origin */
795  );
796 
797 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
800  SCIP_HASHMAP* hashmap, /**< hash map */
801  void* origin, /**< origin to set image for */
802  int image /**< new image for origin */
803  );
804 
805 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
808  SCIP_HASHMAP* hashmap, /**< hash map */
809  void* origin, /**< origin to set image for */
810  SCIP_Real image /**< new image for origin */
811  );
812 
813 /** retrieves image of given origin from the hash map, or NULL if no image exists */
815 void* SCIPhashmapGetImage(
816  SCIP_HASHMAP* hashmap, /**< hash map */
817  void* origin /**< origin to retrieve image for */
818  );
819 
820 /** retrieves image of given origin from the hash map, or INT_MAX if no image exists */
823  SCIP_HASHMAP* hashmap, /**< hash map */
824  void* origin /**< origin to retrieve image for */
825  );
826 
827 /** retrieves image of given origin from the hash map, or SCIP_INVALID if no image exists */
830  SCIP_HASHMAP* hashmap, /**< hash map */
831  void* origin /**< origin to retrieve image for */
832  );
833 
834 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
835  * new origin->image pair
836  */
839  SCIP_HASHMAP* hashmap, /**< hash map */
840  void* origin, /**< origin to set image for */
841  void* image /**< new image for origin */
842  );
843 
844 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
845  * new origin->image pair
846  */
849  SCIP_HASHMAP* hashmap, /**< hash map */
850  void* origin, /**< origin to set image for */
851  int image /**< new image for origin */
852  );
853 
854 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
855  * new origin->image pair
856  */
859  SCIP_HASHMAP* hashmap, /**< hash map */
860  void* origin, /**< origin to set image for */
861  SCIP_Real image /**< new image for origin */
862  );
863 
864 /** checks whether an image to the given origin exists in the hash map */
867  SCIP_HASHMAP* hashmap, /**< hash map */
868  void* origin /**< origin to search for */
869  );
870 
871 /** removes origin->image pair from the hash map, if it exists */
874  SCIP_HASHMAP* hashmap, /**< hash map */
875  void* origin /**< origin to remove from the list */
876  );
877 
878 /** prints statistics about hash map usage */
881  SCIP_HASHMAP* hashmap, /**< hash map */
882  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
883  );
884 
885 /** indicates whether a hash map has no entries */
888  SCIP_HASHMAP* hashmap /**< hash map */
889  );
890 
891 /** gives the number of elements in a hash map */
894  SCIP_HASHMAP* hashmap /**< hash map */
895  );
896 
897 /** gives the number of entries in the internal arrays of a hash map */
900  SCIP_HASHMAP* hashmap /**< hash map */
901  );
902 
903 /** gives the hashmap entry at the given index or NULL if entry has no element */
906  SCIP_HASHMAP* hashmap, /**< hash map */
907  int entryidx /**< index of hash map entry */
908  );
909 
910 /** gives the origin of the hashmap entry */
913  SCIP_HASHMAPENTRY* entry /**< hash map entry */
914  );
915 
916 /** gives the image of the hashmap entry */
919  SCIP_HASHMAPENTRY* entry /**< hash map entry */
920  );
921 
922 /** gives the image of the hashmap entry */
925  SCIP_HASHMAPENTRY* entry /**< hash map entry */
926  );
927 
928 /** gives the image of the hashmap entry */
931  SCIP_HASHMAPENTRY* entry /**< hash map entry */
932  );
933 
934 /** sets pointer image of a hashmap entry */
937  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
938  void* image /**< new image */
939  );
940 
941 /** sets integer image of a hashmap entry */
944  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
945  int image /**< new image */
946  );
947 
948 /** sets real image of a hashmap entry */
951  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
952  SCIP_Real image /**< new image */
953  );
954 
955 /** removes all entries in a hash map. */
958  SCIP_HASHMAP* hashmap /**< hash map */
959  );
960 
961 /**@} */
962 
963 
964 /*
965  * Hash Set
966  */
967 
968 /**@defgroup HashSet Hash Set
969  * @ingroup DataStructures
970  * @brief very lightweight hash set of pointers
971  *
972  * @{
973  */
974 
975 /** creates a hash set of pointers */
978  SCIP_HASHSET** hashset, /**< pointer to store the created hash set */
979  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
980  int size /**< initial size of the hash set; it is guaranteed that the set is not
981  * resized if at most that many elements are inserted */
982  );
983 
984 /** frees the hash set */
986 void SCIPhashsetFree(
987  SCIP_HASHSET** hashset, /**< pointer to the hash set */
988  BMS_BLKMEM* blkmem /**< block memory used to store hash set entries */
989  );
990 
991 /** inserts new element into the hash set */
994  SCIP_HASHSET* hashset, /**< hash set */
995  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
996  void* element /**< element to insert */
997  );
998 
999 /** checks whether an element exists in the hash set */
1002  SCIP_HASHSET* hashset, /**< hash set */
1003  void* element /**< element to search for */
1004  );
1005 
1006 /** removes an element from the hash set, if it exists */
1009  SCIP_HASHSET* hashset, /**< hash set */
1010  void* element /**< origin to remove from the list */
1011  );
1012 
1013 /** prints statistics about hash set usage */
1016  SCIP_HASHSET* hashset, /**< hash set */
1017  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
1018  );
1019 
1020 /** indicates whether a hash set has no entries */
1023  SCIP_HASHSET* hashset /**< hash set */
1024  );
1025 
1026 /** gives the number of elements in a hash set */
1029  SCIP_HASHSET* hashset /**< hash set */
1030  );
1031 
1032 /** gives the number of slots of a hash set */
1035  SCIP_HASHSET* hashset /**< hash set */
1036  );
1037 
1038 /** gives the array of hash set slots; contains all elements in indetermined order and may contain NULL values */
1040 void** SCIPhashsetGetSlots(
1041  SCIP_HASHSET* hashset /**< hash set */
1042  );
1043 
1044 /** removes all entries in a hash set. */
1047  SCIP_HASHSET* hashset /**< hash set */
1048  );
1049 
1050 #ifdef NDEBUG
1051 
1052 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1053  * speed up the algorithms.
1054  */
1055 
1056 #define SCIPhashsetIsEmpty(hashset) ((hashset)->nelements == 0)
1057 #define SCIPhashsetGetNElements(hashset) ((hashset)->nelements)
1058 #define SCIPhashsetGetNSlots(hashset) (1u << (64 - (hashset)->shift))
1059 #define SCIPhashsetGetSlots(hashset) ((hashset)->slots)
1060 
1061 #endif
1062 
1063 /**@} */
1064 
1065 
1066 /*
1067  * Activity
1068  */
1069 
1070 /**@defgroup ResourceActivity Resource Activity
1071  * @ingroup DataStructures
1072  * @brief ressource activity data structure
1073  *
1074  * @{
1075  */
1076 
1077 /** create a resource activity */
1080  SCIP_RESOURCEACTIVITY** activity, /**< pointer to store the resource activity */
1081  SCIP_VAR* var, /**< start time variable of the activity */
1082  int duration, /**< duration of the activity */
1083  int demand /**< demand of the activity */
1084  );
1085 
1086 /** frees a resource activity */
1088 void SCIPactivityFree(
1089  SCIP_RESOURCEACTIVITY** activity /**< pointer to the resource activity */
1090  );
1091 
1092 #ifndef NDEBUG
1093 
1094 /** returns the start time variable of the resource activity */
1097  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1098  );
1099 
1100 /** returns the duration of the resource activity */
1103  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1104  );
1105 
1106 /** returns the demand of the resource activity */
1109  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1110  );
1111 
1112 /** returns the energy of the resource activity */
1115  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1116  );
1117 
1118 #else
1119 
1120 #define SCIPactivityGetVar(activity) ((activity)->var)
1121 #define SCIPactivityGetDuration(activity) ((activity)->duration)
1122 #define SCIPactivityGetDemand(activity) ((activity)->demand)
1123 #define SCIPactivityGetEnergy(activity) ((activity)->duration * (activity)->demand)
1124 
1125 #endif
1126 
1127 /**@} */
1128 
1129 
1130 /*
1131  * Resource Profile
1132  */
1133 
1134 /**@defgroup ResourceProfile Resource Profile
1135  * @ingroup DataStructures
1136  * @brief ressource profile data structure
1137  *
1138  * @{
1139  */
1140 
1141 /** creates resource profile */
1144  SCIP_PROFILE** profile, /**< pointer to store the resource profile */
1145  int capacity /**< resource capacity */
1146  );
1147 
1148 /** frees given resource profile */
1150 void SCIPprofileFree(
1151  SCIP_PROFILE** profile /**< pointer to the resource profile */
1152  );
1153 
1154 /** output of the given resource profile */
1156 void SCIPprofilePrint(
1157  SCIP_PROFILE* profile, /**< resource profile to output */
1158  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1159  FILE* file /**< output file (or NULL for standard output) */
1160  );
1161 
1162 /** returns the capacity of the resource profile */
1165  SCIP_PROFILE* profile /**< resource profile to use */
1166  );
1167 
1168 /** returns the number time points of the resource profile */
1171  SCIP_PROFILE* profile /**< resource profile to use */
1172  );
1173 
1174 /** returns the time points of the resource profile */
1177  SCIP_PROFILE* profile /**< resource profile to use */
1178  );
1179 
1180 /** returns the loads of the resource profile */
1182 int* SCIPprofileGetLoads(
1183  SCIP_PROFILE* profile /**< resource profile to use */
1184  );
1185 
1186 /** returns the time point for given position of the resource profile */
1188 int SCIPprofileGetTime(
1189  SCIP_PROFILE* profile, /**< resource profile to use */
1190  int pos /**< position */
1191  );
1192 
1193 /** returns the loads of the resource profile at the given position */
1195 int SCIPprofileGetLoad(
1196  SCIP_PROFILE* profile, /**< resource profile */
1197  int pos /**< position */
1198  );
1199 
1200 /** returns if the given time point exists in the resource profile and stores the position of the given time point if it
1201  * exists; otherwise the position of the next smaller existing time point is stored
1202  */
1205  SCIP_PROFILE* profile, /**< resource profile to search */
1206  int timepoint, /**< time point to search for */
1207  int* pos /**< pointer to store the position */
1208  );
1209 
1210 /** insert a core into resource profile; if the core is non-empty the resource profile will be updated otherwise nothing
1211  * happens
1212  */
1215  SCIP_PROFILE* profile, /**< resource profile to use */
1216  int left, /**< left side of the core */
1217  int right, /**< right side of the core */
1218  int height, /**< height of the core */
1219  int* pos, /**< pointer to store the first position were it gets infeasible */
1220  SCIP_Bool* infeasible /**< pointer to store if the core does not fit due to capacity */
1221  );
1222 
1223 /** subtracts the height from the resource profile during core time */
1226  SCIP_PROFILE* profile, /**< resource profile to use */
1227  int left, /**< left side of the core */
1228  int right, /**< right side of the core */
1229  int height /**< height of the core */
1230  );
1231 
1232 /** return the earliest possible starting point within the time interval [lb,ub] for a given core (given by its height
1233  * and duration)
1234  */
1237  SCIP_PROFILE* profile, /**< resource profile to use */
1238  int est, /**< earliest starting time of the given core */
1239  int lst, /**< latest starting time of the given core */
1240  int duration, /**< duration of the core */
1241  int height, /**< height of the core */
1242  SCIP_Bool* infeasible /**< pointer store if the corer cannot be inserted */
1243  );
1244 
1245 /** return the latest possible starting point within the time interval [lb,ub] for a given core (given by its height and
1246  * duration)
1247  */
1250  SCIP_PROFILE* profile, /**< resource profile to use */
1251  int lb, /**< earliest possible start point */
1252  int ub, /**< latest possible start point */
1253  int duration, /**< duration of the core */
1254  int height, /**< height of the core */
1255  SCIP_Bool* infeasible /**< pointer store if the core cannot be inserted */
1256  );
1257 
1258 /**@} */
1259 
1260 /*
1261  * Directed graph
1262  */
1263 
1264 /**@addtogroup DirectedGraph
1265  *
1266  * @{
1267  */
1268 
1269 /** resize directed graph structure */
1272  SCIP_DIGRAPH* digraph, /**< directed graph */
1273  int nnodes /**< new number of nodes */
1274  );
1275 
1276 /** sets the sizes of the successor lists for the nodes in a directed graph and allocates memory for the lists */
1279  SCIP_DIGRAPH* digraph, /**< directed graph */
1280  int* sizes /**< sizes of the successor lists */
1281  );
1282 
1283 /** frees given directed graph structure */
1285 void SCIPdigraphFree(
1286  SCIP_DIGRAPH** digraph /**< pointer to the directed graph */
1287  );
1288 
1289 /** add (directed) arc and a related data to the directed graph structure
1290  *
1291  * @note if the arc is already contained, it is added a second time
1292  */
1295  SCIP_DIGRAPH* digraph, /**< directed graph */
1296  int startnode, /**< start node of the arc */
1297  int endnode, /**< start node of the arc */
1298  void* data /**< data that should be stored for the arc; or NULL */
1299  );
1300 
1301 /** add (directed) arc to the directed graph structure, if it is not contained, yet
1302  *
1303  * @note if there already exists an arc from startnode to endnode, the new arc is not added,
1304  * even if its data is different
1305  */
1308  SCIP_DIGRAPH* digraph, /**< directed graph */
1309  int startnode, /**< start node of the arc */
1310  int endnode, /**< start node of the arc */
1311  void* data /**< data that should be stored for the arc; or NULL */
1312  );
1313 
1314 /** sets the number of successors to a given value */
1317  SCIP_DIGRAPH* digraph, /**< directed graph */
1318  int node, /**< node for which the number of successors has to be changed */
1319  int nsuccessors /**< new number of successors */
1320  );
1321 
1322 /** returns the number of nodes of the given digraph */
1325  SCIP_DIGRAPH* digraph /**< directed graph */
1326  );
1327 
1328 /** returns the node data, or NULL if no data exist */
1331  SCIP_DIGRAPH* digraph, /**< directed graph */
1332  int node /**< node for which the node data is returned */
1333  );
1334 
1335 /** sets the node data */
1338  SCIP_DIGRAPH* digraph, /**< directed graph */
1339  void* dataptr, /**< user node data pointer, or NULL */
1340  int node /**< node for which the node data is returned */
1341  );
1342 
1343 /** returns the total number of arcs in the given digraph */
1346  SCIP_DIGRAPH* digraph /**< directed graph */
1347  );
1348 
1349 /** returns the number of successor nodes of the given node */
1352  SCIP_DIGRAPH* digraph, /**< directed graph */
1353  int node /**< node for which the number of outgoing arcs is returned */
1354  );
1355 
1356 /** returns the array of indices of the successor nodes; this array must not be changed from outside */
1359  SCIP_DIGRAPH* digraph, /**< directed graph */
1360  int node /**< node for which the array of outgoing arcs is returned */
1361  );
1362 
1363 /** returns the array of data corresponding to the arcs originating at the given node, or NULL if no data exist; this
1364  * array must not be changed from outside
1365  */
1368  SCIP_DIGRAPH* digraph, /**< directed graph */
1369  int node /**< node for which the data corresponding to the outgoing arcs is returned */
1370  );
1371 
1372 /** Compute undirected connected components on the given graph.
1373  *
1374  * @note For each arc, its reverse is added, so the graph does not need to be the directed representation of an
1375  * undirected graph.
1376  */
1379  SCIP_DIGRAPH* digraph, /**< directed graph */
1380  int minsize, /**< all components with less nodes are ignored */
1381  int* components, /**< array with as many slots as there are nodes in the directed graph
1382  * to store for each node the component to which it belongs
1383  * (components are numbered 0 to ncomponents - 1); or NULL, if components
1384  * are accessed one-by-one using SCIPdigraphGetComponent() */
1385  int* ncomponents /**< pointer to store the number of components; or NULL, if the
1386  * number of components is accessed by SCIPdigraphGetNComponents() */
1387  );
1388 
1389 /** Computes all strongly connected components of an undirected connected component with Tarjan's Algorithm.
1390  * The resulting strongly connected components are sorted topologically (starting from the end of the
1391  * strongcomponents array).
1392  *
1393  * @note In general a topological sort of the strongly connected components is not unique.
1394  */
1397  SCIP_DIGRAPH* digraph, /**< directed graph */
1398  int compidx, /**< number of the undirected connected component */
1399  int* strongcomponents, /**< array to store the strongly connected components
1400  * (length >= size of the component) */
1401  int* strongcompstartidx, /**< array to store the start indices of the strongly connected
1402  * components (length >= size of the component) */
1403  int* nstrongcomponents /**< pointer to store the number of strongly connected
1404  * components */
1405  );
1406 
1407 /** Performes an (almost) topological sort on the undirected components of the given directed graph. The undirected
1408  * components should be computed before using SCIPdigraphComputeUndirectedComponents().
1409  *
1410  * @note In general a topological sort is not unique. Note, that there might be directed cycles, that are randomly
1411  * broken, which is the reason for having only almost topologically sorted arrays.
1412  */
1415  SCIP_DIGRAPH* digraph /**< directed graph */
1416  );
1417 
1418 /** returns the number of previously computed undirected components for the given directed graph */
1421  SCIP_DIGRAPH* digraph /**< directed graph */
1422  );
1423 
1424 /** Returns the previously computed undirected component of the given number for the given directed graph.
1425  * If the components were sorted using SCIPdigraphTopoSortComponents(), the component is (almost) topologically sorted.
1426  */
1429  SCIP_DIGRAPH* digraph, /**< directed graph */
1430  int compidx, /**< number of the component to return */
1431  int** nodes, /**< pointer to store the nodes in the component; or NULL, if not needed */
1432  int* nnodes /**< pointer to store the number of nodes in the component;
1433  * or NULL, if not needed */
1434  );
1435 
1436 /** frees the component information for the given directed graph */
1439  SCIP_DIGRAPH* digraph /**< directed graph */
1440  );
1441 
1442 /** output of the given directed graph via the given message handler */
1444 void SCIPdigraphPrint(
1445  SCIP_DIGRAPH* digraph, /**< directed graph */
1446  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1447  FILE* file /**< output file (or NULL for standard output) */
1448  );
1449 
1450 /** prints the given directed graph structure in GML format into the given file */
1452 void SCIPdigraphPrintGml(
1453  SCIP_DIGRAPH* digraph, /**< directed graph */
1454  FILE* file /**< file to write to */
1455  );
1456 
1457 
1458 /** output of the given directed graph via the given message handler */
1461  SCIP_DIGRAPH* digraph, /**< directed graph */
1462  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1463  FILE* file /**< output file (or NULL for standard output) */
1464  );
1465 
1466 /**@} */
1467 
1468 /*
1469  * Binary search tree
1470  */
1471 
1472 /**@defgroup BinaryTree Binary Search Tree
1473  * @ingroup DataStructures
1474  * @brief binary search tree data structure
1475  *@{
1476  */
1477 
1478 /** creates a binary tree node with sorting value and user data */
1481  SCIP_BT* tree, /**< binary search tree */
1482  SCIP_BTNODE** node, /**< pointer to store the created search node */
1483  void* dataptr /**< user node data pointer, or NULL */
1484  );
1485 
1486 /** frees the binary node including the rooted subtree
1487  *
1488  * @note The user pointer (object) is not freed. If needed, it has to be done by the user.
1489  */
1491 void SCIPbtnodeFree(
1492  SCIP_BT* tree, /**< binary tree */
1493  SCIP_BTNODE** node /**< node to be freed */
1494  );
1495 
1496 /** returns the user data pointer stored in that node */
1498 void* SCIPbtnodeGetData(
1499  SCIP_BTNODE* node /**< node */
1500  );
1501 
1502 /** returns the parent which can be NULL if the given node is the root */
1505  SCIP_BTNODE* node /**< node */
1506  );
1507 
1508 /** returns left child which can be NULL if the given node is a leaf */
1511  SCIP_BTNODE* node /**< node */
1512  );
1513 
1514 /** returns right child which can be NULL if the given node is a leaf */
1517  SCIP_BTNODE* node /**< node */
1518  );
1519 
1520 /** returns the sibling of the node or NULL if does not exist */
1523  SCIP_BTNODE* node /**< node */
1524  );
1525 
1526 /** returns whether the node is a root node */
1529  SCIP_BTNODE* node /**< node */
1530  );
1531 
1532 /** returns whether the node is a leaf */
1535  SCIP_BTNODE* node /**< node */
1536  );
1537 
1538 /** returns TRUE if the given node is left child */
1541  SCIP_BTNODE* node /**< node */
1542  );
1543 
1544 /** returns TRUE if the given node is right child */
1547  SCIP_BTNODE* node /**< node */
1548  );
1549 
1550 #ifdef NDEBUG
1551 
1552 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1553  * speed up the algorithms.
1554  */
1555 
1556 #define SCIPbtnodeGetData(node) ((node)->dataptr)
1557 #define SCIPbtnodeGetParent(node) ((node)->parent)
1558 #define SCIPbtnodeGetLeftchild(node) ((node)->left)
1559 #define SCIPbtnodeGetRightchild(node) ((node)->right)
1560 #define SCIPbtnodeGetSibling(node) ((node)->parent == NULL ? NULL : \
1561  (node)->parent->left == (node) ? (node)->parent->right : (node)->parent->left)
1562 #define SCIPbtnodeIsRoot(node) ((node)->parent == NULL)
1563 #define SCIPbtnodeIsLeaf(node) ((node)->left == NULL && (node)->right == NULL)
1564 #define SCIPbtnodeIsLeftchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->left == (node) ? TRUE : FALSE)
1565 #define SCIPbtnodeIsRightchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->right == (node) ? TRUE : FALSE)
1566 
1567 #endif
1568 
1569 /** sets the give node data
1570  *
1571  * @note The old user pointer is not freed.
1572  */
1574 void SCIPbtnodeSetData(
1575  SCIP_BTNODE* node, /**< node */
1576  void* dataptr /**< node user data pointer */
1577  );
1578 
1579 /** sets parent node
1580  *
1581  * @note The old parent including the rooted subtree is not delete.
1582  */
1584 void SCIPbtnodeSetParent(
1585  SCIP_BTNODE* node, /**< node */
1586  SCIP_BTNODE* parent /**< new parent node, or NULL */
1587  );
1588 
1589 /** sets left child
1590  *
1591  * @note The old left child including the rooted subtree is not delete.
1592  */
1595  SCIP_BTNODE* node, /**< node */
1596  SCIP_BTNODE* left /**< new left child, or NULL */
1597  );
1598 
1599 /** sets right child
1600  *
1601  * @note The old right child including the rooted subtree is not delete.
1602  */
1605  SCIP_BTNODE* node, /**< node */
1606  SCIP_BTNODE* right /**< new right child, or NULL */
1607  );
1608 
1609 /** creates an binary tree */
1612  SCIP_BT** tree, /**< pointer to store the created binary tree */
1613  BMS_BLKMEM* blkmem /**< block memory used to create nodes */
1614  );
1615 
1616 /** frees binary tree
1617  *
1618  * @note The user pointers (object) of the search nodes are not freed. If needed, it has to be done by the user.
1619  */
1621 void SCIPbtFree(
1622  SCIP_BT** tree /**< pointer to binary tree */
1623  );
1624 
1625 /** prints the binary tree in GML format into the given file */
1627 void SCIPbtPrintGml(
1628  SCIP_BT* tree, /**< binary tree */
1629  FILE* file /**< file to write to */
1630  );
1631 
1632 /** returns whether the binary tree is empty (has no nodes) */
1635  SCIP_BT * tree /**< binary tree */
1636  );
1637 
1638 /** returns the root node of the binary tree or NULL if the binary tree is empty */
1641  SCIP_BT* tree /**< tree to be evaluated */
1642  );
1643 
1644 #ifdef NDEBUG
1645 
1646 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1647  * speed up the algorithms.
1648  */
1649 
1650 #define SCIPbtIsEmpty(tree) (tree->root == NULL)
1651 #define SCIPbtGetRoot(tree) (tree->root)
1652 
1653 #endif
1654 
1655 /** sets root node
1656  *
1657  * @note The old root including the rooted subtree is not delete.
1658  */
1660 void SCIPbtSetRoot(
1661  SCIP_BT* tree, /**< tree to be evaluated */
1662  SCIP_BTNODE* root /**< new root, or NULL */
1663  );
1664 
1665 /**@} */
1666 
1667 /**@addtogroup DisjointSet
1668  *
1669  * @{
1670  */
1671 
1672 /*
1673  * disjoint set data structure
1674  */
1675 
1676 /** clears the disjoint set (union find) structure \p djset */
1679  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1680  );
1681 
1682 /** finds and returns the component identifier of this \p element */
1685  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1686  int element /**< element to be found */
1687  );
1688 
1689 /** merges the components containing the elements \p p and \p q */
1692  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1693  int p, /**< first element */
1694  int q, /**< second element */
1695  SCIP_Bool forcerepofp /**< force representative of p to be new representative */
1696  );
1697 
1698 /** returns the number of independent components in this disjoint set (union find) data structure */
1701  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1702  );
1703 
1704 /** returns the size (number of nodes) of this disjoint set (union find) data structure */
1707  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1708  );
1709 
1710 /* @} */
1711 
1712 /*
1713  * Numerical methods
1714  */
1715 
1716 /**@defgroup NumericalMethods Numerical Methods
1717  * @ingroup MiscellaneousMethods
1718  * @brief commonly used numerical methods
1719  *
1720  * @{
1721  */
1722 
1723 /** returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0 */
1726  void
1727  );
1728 
1729 /** returns the next representable value of from in the direction of to */
1732  SCIP_Real from, /**< value from which the next representable value should be returned */
1733  SCIP_Real to /**< direction in which the next representable value should be returned */
1734  );
1735 
1736 /** calculates the greatest common divisor of the two given values */
1739  SCIP_Longint val1, /**< first value of greatest common devisor calculation */
1740  SCIP_Longint val2 /**< second value of greatest common devisor calculation */
1741  );
1742 
1743 /** calculates the smallest common multiple of the two given values */
1746  SCIP_Longint val1, /**< first value of smallest common multiple calculation */
1747  SCIP_Longint val2 /**< second value of smallest common multiple calculation */
1748  );
1749 
1750 /** calculates a binomial coefficient n over m, choose m elements out of n, maximal value will be 33 over 16 (because
1751  * the n=33 is the last line in the Pascal's triangle where each entry fits in a 4 byte value), an error occurs due to
1752  * big numbers or an negative value m (and m < n) and -1 will be returned
1753  */
1756  int n, /**< number of different elements */
1757  int m /**< number to choose out of the above */
1758  );
1759 
1760 /** converts a real number into a (approximate) rational representation, and returns TRUE iff the conversion was
1761  * successful
1762  */
1765  SCIP_Real val, /**< real value r to convert into rational number */
1766  SCIP_Real mindelta, /**< minimal allowed difference r - q of real r and rational q = n/d */
1767  SCIP_Real maxdelta, /**< maximal allowed difference r - q of real r and rational q = n/d */
1768  SCIP_Longint maxdnom, /**< maximal denominator allowed */
1769  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1770  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1771  );
1772 
1773 /** tries to find a value, such that all given values, if scaled with this value become integral in relative allowed
1774  * difference in between mindelta and maxdelta
1775  */
1778  SCIP_Real* vals, /**< values to scale */
1779  int nvals, /**< number of values to scale */
1780  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1781  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1782  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1783  SCIP_Real maxscale, /**< maximal allowed scalar */
1784  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1785  SCIP_Bool* success /**< stores whether returned value is valid */
1786  );
1787 
1788 /** given a (usually very small) interval, tries to find a rational number with simple denominator (i.e. a small
1789  * number, probably multiplied with powers of 10) out of this interval; returns TRUE iff a valid rational
1790  * number inside the interval was found
1791  */
1794  SCIP_Real lb, /**< lower bound of the interval */
1795  SCIP_Real ub, /**< upper bound of the interval */
1796  SCIP_Longint maxdnom, /**< maximal denominator allowed for resulting rational number */
1797  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1798  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1799  );
1800 
1801 /** given a (usually very small) interval, selects a value inside this interval; it is tried to select a rational number
1802  * with simple denominator (i.e. a small number, probably multiplied with powers of 10);
1803  * if no valid rational number inside the interval was found, selects the central value of the interval
1804  */
1807  SCIP_Real lb, /**< lower bound of the interval */
1808  SCIP_Real ub, /**< upper bound of the interval */
1809  SCIP_Longint maxdnom /**< maximal denominator allowed for resulting rational number */
1810  );
1811 
1812 /* The C99 standard defines the function (or macro) isfinite.
1813  * On MacOS X, isfinite is also available.
1814  * From the BSD world, there comes a function finite.
1815  * On SunOS, finite is also available.
1816  * In the MS compiler world, there is a function _finite.
1817  * As last resort, we check whether x == x does not hold, but this works only for NaN's, not for infinities!
1818  */
1819 #if _XOPEN_SOURCE >= 600 || defined(_ISOC99_SOURCE) || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__)
1820 #define SCIPisFinite isfinite
1821 #elif defined(_BSD_SOURCE) || defined(__sun)
1822 #define SCIPisFinite finite
1823 #elif defined(_MSC_VER)
1824 #define SCIPisFinite _finite
1825 #else
1826 #define SCIPisFinite(x) ((x) == (x))
1827 #endif
1828 
1829 /* In debug mode, the following methods are implemented as function calls to ensure
1830  * type validity.
1831  */
1832 
1833 /** returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0) */
1836  SCIP_Real val1, /**< first value to be compared */
1837  SCIP_Real val2 /**< second value to be compared */
1838  );
1839 
1840 #ifdef NDEBUG
1841 
1842 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1843  * speed up the algorithms.
1844  */
1845 
1846 #define SCIPrelDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) )
1847 
1848 #endif
1849 
1850 /** computes the gap from the primal and the dual bound */
1853  SCIP_Real eps, /**< the value treated as zero */
1854  SCIP_Real inf, /**< the value treated as infinity */
1855  SCIP_Real primalbound, /**< the primal bound */
1856  SCIP_Real dualbound /**< the dual bound */
1857  );
1858 
1859 /**@} */
1860 
1861 
1862 /*
1863  * Random Numbers
1864  */
1865 
1866 /**@defgroup RandomNumbers Random Numbers
1867  * @ingroup MiscellaneousMethods
1868  * @brief structures and methods for pseudo random number generation
1869  *
1870  *@{
1871  */
1872 
1873 /** returns a random integer between minrandval and maxrandval
1874  *
1875  * @deprecated Please use SCIPrandomGetInt() to request a random integer.
1876  */
1878 int SCIPgetRandomInt(
1879  int minrandval, /**< minimal value to return */
1880  int maxrandval, /**< maximal value to return */
1881  unsigned int* seedp /**< pointer to seed value */
1882  );
1883 
1884 
1885 /** returns a random integer between minrandval and maxrandval */
1887 int SCIPrandomGetInt(
1888  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1889  int minrandval, /**< minimal value to return */
1890  int maxrandval /**< maximal value to return */
1891  );
1892 
1893 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1894  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1895  */
1898  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1899  void** set, /**< original set, from which elements should be drawn */
1900  int nelems, /**< number of elements in original set */
1901  void** subset, /**< subset in which drawn elements should be stored */
1902  int nsubelems /**< number of elements that should be drawn and stored */
1903  );
1904 
1905 /** returns a random real between minrandval and maxrandval */
1908  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1909  SCIP_Real minrandval, /**< minimal value to return */
1910  SCIP_Real maxrandval /**< maximal value to return */
1911  );
1912 
1913 /** returns a random real between minrandval and maxrandval
1914  *
1915  * @deprecated Please use SCIPrandomGetReal() to request a random real.
1916  */
1919  SCIP_Real minrandval, /**< minimal value to return */
1920  SCIP_Real maxrandval, /**< maximal value to return */
1921  unsigned int* seedp /**< pointer to seed value */
1922  );
1923 
1924 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1925  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1926  *
1927  * @deprecated Please use SCIPrandomGetSubset()
1928  */
1931  void** set, /**< original set, from which elements should be drawn */
1932  int nelems, /**< number of elements in original set */
1933  void** subset, /**< subset in which drawn elements should be stored */
1934  int nsubelems, /**< number of elements that should be drawn and stored */
1935  unsigned int randseed /**< seed value for random generator */
1936  );
1937 
1938 
1939 /**@} */
1940 
1941 /*
1942  * Permutations / Shuffling
1943  */
1944 
1945 /**@defgroup PermutationsShuffling Permutations Shuffling
1946  * @ingroup MiscellaneousMethods
1947  * @brief methods for shuffling arrays
1948  *
1949  * @{
1950  */
1951 
1952 /** swaps two ints */
1954 void SCIPswapInts(
1955  int* value1, /**< pointer to first integer */
1956  int* value2 /**< pointer to second integer */
1957  );
1958 
1959 /** swaps two real values */
1961 void SCIPswapReals(
1962  SCIP_Real* value1, /**< pointer to first real value */
1963  SCIP_Real* value2 /**< pointer to second real value */
1964 );
1965 
1966 /** swaps the addresses of two pointers */
1968 void SCIPswapPointers(
1969  void** pointer1, /**< first pointer */
1970  void** pointer2 /**< second pointer */
1971  );
1972 
1973 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm
1974  *
1975  * @deprecated Please use SCIPrandomPermuteIntArray()
1976  */
1978 void SCIPpermuteIntArray(
1979  int* array, /**< array to be shuffled */
1980  int begin, /**< first included index that should be subject to shuffling
1981  * (0 for first array entry)
1982  */
1983  int end, /**< first excluded index that should not be subject to shuffling
1984  * (array size for last array entry)
1985  */
1986  unsigned int* randseed /**< seed value for the random generator */
1987  );
1988 
1989 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm */
1992  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1993  int* array, /**< array to be shuffled */
1994  int begin, /**< first included index that should be subject to shuffling
1995  * (0 for first array entry)
1996  */
1997  int end /**< first excluded index that should not be subject to shuffling
1998  * (array size for last array entry)
1999  */
2000  );
2001 
2002 /** randomly shuffles parts of an array using the Fisher-Yates algorithm */
2005  SCIP_RANDNUMGEN* randgen, /**< random number generator */
2006  void** array, /**< array to be shuffled */
2007  int begin, /**< first included index that should be subject to shuffling
2008  * (0 for first array entry)
2009  */
2010  int end /**< first excluded index that should not be subject to shuffling
2011  * (array size for last array entry)
2012  */
2013  );
2014 
2015 /** randomly shuffles parts of an array using the Fisher-Yates algorithm
2016  *
2017  * @deprecated Please use SCIPrandomPermuteArray()
2018  */
2020 void SCIPpermuteArray(
2021  void** array, /**< array to be shuffled */
2022  int begin, /**< first included index that should be subject to shuffling
2023  * (0 for first array entry)
2024  */
2025  int end, /**< first excluded index that should not be subject to shuffling
2026  * (array size for last array entry)
2027  */
2028  unsigned int* randseed /**< pointer to seed value for the random generator */
2029  );
2030 
2031 /**@} */
2032 
2033 
2034 /*
2035  * Arrays
2036  */
2037 
2038 /**@defgroup Arrays Arrays
2039  * @ingroup MiscellaneousMethods
2040  * @brief miscellaneous methods for arrays
2041  *
2042  * @{
2043  */
2044 
2045 
2046 /** computes set intersection (duplicates removed) of two arrays that are ordered ascendingly */
2049  int* array1, /**< first array (in ascending order) */
2050  int narray1, /**< number of entries of first array */
2051  int* array2, /**< second array (in ascending order) */
2052  int narray2, /**< number of entries of second array */
2053  int* intersectarray, /**< intersection of array1 and array2
2054  * (note: it is possible to use array1 for this input argument) */
2055  int* nintersectarray /**< pointer to store number of entries of intersection array
2056  * (note: it is possible to use narray1 for this input argument) */
2057  );
2058 
2059 /** computes set difference (duplicates removed) of two arrays that are ordered ascendingly */
2062  int* array1, /**< first array (in ascending order) */
2063  int narray1, /**< number of entries of first array */
2064  int* array2, /**< second array (in ascending order) */
2065  int narray2, /**< number of entries of second array */
2066  int* setminusarray, /**< array to store entries of array1 that are not an entry of array2
2067  * (note: it is possible to use array1 for this input argument) */
2068  int* nsetminusarray /**< pointer to store number of entries of setminus array
2069  * (note: it is possible to use narray1 for this input argument) */
2070  );
2071 
2072 /**@} */
2073 
2074 
2075 /*
2076  * Strings
2077  */
2078 
2079 /**@defgroup StringMethods String Methods
2080  * @ingroup MiscellaneousMethods
2081  * @brief commonly used methods for strings
2082  *
2083  *@{
2084  */
2085 
2086 /** copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after
2087  * 'cnt' characters have been copied, whichever comes first.
2088  *
2089  * @note undefined behaviuor on overlapping arrays
2090  */
2092 int SCIPmemccpy(
2093  char* dest, /**< destination pointer to copy to */
2094  const char* src, /**< source pointer to copy to */
2095  char stop, /**< character when found stop copying */
2096  unsigned int cnt /**< maximal number of characters to copy too */
2097  );
2098 
2099 /** prints an error message containing of the given string followed by a string describing the current system error;
2100  * prefers to use the strerror_r method, which is threadsafe; on systems where this method does not exist,
2101  * NO_STRERROR_R should be defined (see INSTALL), in this case, srerror is used which is not guaranteed to be
2102  * threadsafe (on SUN-systems, it actually is)
2103  */
2105 void SCIPprintSysError(
2106  const char* message /**< first part of the error message, e.g. the filename */
2107  );
2108 
2109 /** extracts tokens from strings - wrapper method for strtok_r() */
2111 char* SCIPstrtok(
2112  char* s, /**< string to parse */
2113  const char* delim, /**< delimiters for parsing */
2114  char** ptrptr /**< pointer to working char pointer - must stay the same while parsing */
2115  );
2116 
2117 /** translates the given string into a string where symbols ", ', and spaces are escaped with a \ prefix */
2119 void SCIPescapeString(
2120  char* t, /**< target buffer to store escaped string */
2121  int bufsize, /**< size of buffer t */
2122  const char* s /**< string to transform into escaped string */
2123  );
2124 
2125 /** safe version of snprintf */
2127 int SCIPsnprintf(
2128  char* t, /**< target string */
2129  int len, /**< length of the string to copy */
2130  const char* s, /**< source string */
2131  ... /**< further parameters */
2132  );
2133 
2134 /** safe version of strncpy
2135  *
2136  * Copies string in s to t using at most @a size-1 nonzero characters (strncpy copies size characters). It always adds
2137  * a terminating zero char. Does not pad the remaining string with zero characters (unlike strncpy). Returns the number
2138  * of copied nonzero characters, if the length of s is at most size - 1, and returns size otherwise. Thus, the original
2139  * string was truncated if the return value is size.
2140  */
2142 int SCIPstrncpy(
2143  char* t, /**< target string */
2144  const char* s, /**< source string */
2145  int size /**< maximal size of t */
2146  );
2147 
2148 /** extract the next token as a integer value if it is one; in case no value is parsed the endptr is set to @p str
2149  *
2150  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2151  */
2154  const char* str, /**< string to search */
2155  int* value, /**< pointer to store the parsed value */
2156  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2157  );
2158 
2159 /** extract the next token as a double value if it is one; in case a value is parsed the endptr is set to @p str
2160  *
2161  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2162  */
2165  const char* str, /**< string to search */
2166  SCIP_Real* value, /**< pointer to store the parsed value */
2167  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2168  );
2169 
2170 /** copies the first size characters between a start and end character of str into token, if no error occured endptr
2171  * will point to the position after the read part, otherwise it will point to @p str
2172  */
2174 void SCIPstrCopySection(
2175  const char* str, /**< string to search */
2176  char startchar, /**< character which defines the beginning */
2177  char endchar, /**< character which defines the ending */
2178  char* token, /**< string to store the copy */
2179  int size, /**< size of the token char array */
2180  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2181  );
2182 
2183 /**@} */
2184 
2185 /*
2186  * File methods
2187  */
2188 
2189 /**@defgroup FileMethods File Methods
2190  * @ingroup MiscellaneousMethods
2191  * @brief commonly used file methods
2192  *
2193  * @{
2194  */
2195 
2196 /** returns, whether the given file exists */
2199  const char* filename /**< file name */
2200  );
2201 
2202 /** splits filename into path, name, and extension */
2204 void SCIPsplitFilename(
2205  char* filename, /**< filename to split; is destroyed (but not freed) during process */
2206  char** path, /**< pointer to store path, or NULL if not needed */
2207  char** name, /**< pointer to store name, or NULL if not needed */
2208  char** extension, /**< pointer to store extension, or NULL if not needed */
2209  char** compression /**< pointer to store compression extension, or NULL if not needed */
2210  );
2211 
2212 /**@} */
2213 
2214 #ifdef __cplusplus
2215 }
2216 #endif
2217 
2218 #endif
SCIP_EXPORT int SCIPprofileGetEarliestFeasibleStart(SCIP_PROFILE *profile, int est, int lst, int duration, int height, SCIP_Bool *infeasible)
Definition: misc.c:6899
SCIP_EXPORT int SCIPcalcMultihashSize(int minsize)
Definition: misc.c:1455
SCIP_EXPORT SCIP_RETCODE SCIPqueueInsertUInt(SCIP_QUEUE *queue, unsigned int elem)
Definition: misc.c:1044
SCIP_EXPORT void ** SCIPdigraphGetSuccessorsData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7565
SCIP_EXPORT SCIP_Real SCIPstudentTGetCriticalValue(SCIP_CONFIDENCELEVEL clevel, int df)
Definition: misc.c:94
SCIP_EXPORT SCIP_Longint SCIPcalcBinomCoef(int n, int m)
Definition: misc.c:9782
SCIP_EXPORT void * SCIPpqueueRemove(SCIP_PQUEUE *pqueue)
Definition: misc.c:1307
SCIP_EXPORT void SCIPescapeString(char *t, int bufsize, const char *s)
Definition: misc.c:10235
SCIP_EXPORT SCIP_Bool SCIPmultihashExists(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1967
SCIP_EXPORT SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2973
SCIP_EXPORT SCIP_RETCODE SCIPrandomGetSubset(SCIP_RANDNUMGEN *randgen, void **set, int nelems, void **subset, int nsubelems)
Definition: misc.c:9721
SCIP_EXPORT void SCIPgmlWriteEdge(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:583
SCIP_EXPORT SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
Definition: misc.c:8385
SCIP_EXPORT SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2396
SCIP_EXPORT int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2594
SCIP_EXPORT int SCIPqueueNElems(SCIP_QUEUE *queue)
Definition: misc.c:1186
SCIP_EXPORT void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
Definition: misc.c:1259
SCIP_EXPORT unsigned int SCIPqueueRemoveUInt(SCIP_QUEUE *queue)
Definition: misc.c:1103
SCIP_EXPORT SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2364
SCIP_EXPORT SCIP_Real SCIPcalcMachineEpsilon(void)
Definition: misc.c:8667
SCIP_EXPORT int SCIPdigraphGetNNodes(SCIP_DIGRAPH *digraph)
Definition: misc.c:7474
SCIP_EXPORT int SCIPactivityGetDuration(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6455
internal miscellaneous methods for linear constraints
SCIP_EXPORT int SCIPdigraphGetNComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7854
SCIP_EXPORT void SCIPhashsetRemoveAll(SCIP_HASHSET *hashset)
Definition: misc.c:3833
type definitions for miscellaneous datastructures
SCIP_EXPORT void * SCIPmultihashRetrieveNext(SCIP_MULTIHASH *multihash, SCIP_MULTIHASHLIST **multihashlist, void *key)
Definition: misc.c:1931
SCIP_EXPORT void * SCIPpqueueFirst(SCIP_PQUEUE *pqueue)
Definition: misc.c:1348
SCIP_EXPORT SCIP_BTNODE * SCIPbtnodeGetSibling(SCIP_BTNODE *node)
Definition: misc.c:8395
static void message(unsigned int type, const CURF *curf, const char *msg,...)
Definition: grphload.c:317
SCIP_EXPORT SCIP_Bool SCIPfileExists(const char *filename)
Definition: misc.c:10466
SCIP_EXPORT SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8375
SCIP_EXPORT int SCIPprofileGetLoad(SCIP_PROFILE *profile, int pos)
Definition: misc.c:6618
SCIP_EXPORT int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
Definition: misc.c:10656
SCIP_EXPORT void * SCIPhashtableGetEntry(SCIP_HASHTABLE *hashtable, int entryidx)
Definition: misc.c:2602
SCIP_EXPORT int SCIPhashmapGetNElements(SCIP_HASHMAP *hashmap)
Definition: misc.c:3350
SCIP_EXPORT SCIP_Longint SCIPhashtableGetNElements(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2584
SCIP_EXPORT int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
Definition: misc.c:10763
SCIP_EXPORT SCIP_RETCODE SCIPqueueInsert(SCIP_QUEUE *queue, void *elem)
Definition: misc.c:1018
SCIP_EXPORT SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2476
SCIP_EXPORT SCIP_RETCODE SCIPcomputeArraysSetminus(int *array1, int narray1, int *array2, int narray2, int *setminusarray, int *nsetminusarray)
Definition: misc.c:10090
SCIP_EXPORT void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:2425
SCIP_EXPORT void SCIPsparseSolGetFirstSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
Definition: misc.c:808
SCIP_EXPORT void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
Definition: misc.c:9941
SCIP_EXPORT SCIP_RETCODE SCIPregressionCreate(SCIP_REGRESSION **regression)
Definition: misc.c:404
SCIP_EXPORT SCIP_RETCODE SCIPdigraphComputeDirectedComponents(SCIP_DIGRAPH *digraph, int compidx, int *strongcomponents, int *strongcompstartidx, int *nstrongcomponents)
Definition: misc.c:7999
SCIP_EXPORT SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8690
SCIP_EXPORT SCIP_RETCODE SCIPmultihashSafeInsert(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1883
#define SCIP_EXPORT
Definition: def.h:98
SCIP_EXPORT SCIP_Real SCIPcomputeTwoSampleTTestValue(SCIP_Real meanx, SCIP_Real meany, SCIP_Real variancex, SCIP_Real variancey, SCIP_Real countx, SCIP_Real county)
Definition: misc.c:111
#define INLINE
Definition: def.h:111
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
Definition: misc.c:8425
SCIP_EXPORT SCIP_BTNODE * SCIPbtnodeGetParent(SCIP_BTNODE *node)
Definition: misc.c:8365
SCIP_EXPORT SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
Definition: misc.c:3009
SCIP_EXPORT SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
Definition: misc.c:8527
SCIP_EXPORT void * SCIPqueueRemove(SCIP_QUEUE *queue)
Definition: misc.c:1069
SCIP_EXPORT void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:10394
SCIP_EXPORT void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3387
SCIP_EXPORT SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:9640
miscellaneous datastructures
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_EXPORT int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7532
SCIP_EXPORT SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString)
Definition: misc.c:2659
SCIP_EXPORT int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
Definition: misc.c:1362
SCIP_EXPORT void * SCIPmultihashRetrieve(SCIP_MULTIHASH *multihash, void *key)
Definition: misc.c:1902
SCIP_EXPORT SCIP_RETCODE SCIPdigraphAddArcSafe(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7424
SCIP_EXPORT void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
Definition: misc.c:7306
SCIP_EXPORT void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3078
SCIP_EXPORT void SCIPhashtableClear(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2215
SCIP_EXPORT int SCIPhashmapEntryGetImageInt(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3397
SCIP_EXPORT void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
Definition: misc.c:9878
SCIP_EXPORT SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2494
type definitions for return codes for SCIP methods
SCIP_EXPORT SCIP_RETCODE SCIPmultihashInsert(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1842
SCIP_EXPORT void SCIPqueueClear(SCIP_QUEUE *queue)
Definition: misc.c:967
SCIP_EXPORT void SCIPdigraphPrintComponents(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:8193
SCIP_EXPORT SCIP_Longint * SCIPsparseSolGetLbs(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:788
SCIP_EXPORT char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
Definition: misc.c:10221
SCIP_EXPORT SCIP_RETCODE SCIPdigraphResize(SCIP_DIGRAPH *digraph, int nnodes)
Definition: misc.c:7168
SCIP_EXPORT void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3377
SCIP_EXPORT SCIP_Real SCIPmultihashGetLoad(SCIP_MULTIHASH *multihash)
Definition: misc.c:2059
SCIP_EXPORT void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:6544
SCIP_VAR ** x
Definition: circlepacking.c:54
SCIP_EXPORT void SCIPpqueueClear(SCIP_PQUEUE *pqueue)
Definition: misc.c:1270
real eps
SCIP_EXPORT void * SCIPbtnodeGetData(SCIP_BTNODE *node)
Definition: misc.c:8355
SCIP_EXPORT void SCIPbtnodeSetData(SCIP_BTNODE *node, void *dataptr)
Definition: misc.c:8474
SCIP_EXPORT SCIP_Real SCIPerf(SCIP_Real x)
Definition: misc.c:144
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8435
SCIP_EXPORT void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
Definition: misc.c:671
SCIP_EXPORT void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:627
SCIP_EXPORT SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
Definition: misc.c:2113
SCIP_EXPORT SCIP_Real SCIPregressionGetIntercept(SCIP_REGRESSION *regression)
Definition: misc.c:262
SCIP_EXPORT int SCIPregressionGetNObservations(SCIP_REGRESSION *regression)
Definition: misc.c:242
SCIP_EXPORT int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3098
SCIP_EXPORT void SCIPregressionRemoveObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
Definition: misc.c:337
SCIP_EXPORT SCIP_Bool SCIPqueueIsEmpty(SCIP_QUEUE *queue)
Definition: misc.c:1173
SCIP_EXPORT SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3240
SCIP_EXPORT SCIP_RETCODE SCIPdigraphComputeUndirectedComponents(SCIP_DIGRAPH *digraph, int minsize, int *components, int *ncomponents)
Definition: misc.c:7659
SCIP_EXPORT int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6576
SCIP_EXPORT SCIP_Bool SCIPhashsetExists(SCIP_HASHSET *hashset, void *element)
Definition: misc.c:3634
SCIP_EXPORT SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
Definition: misc.c:3366
SCIP_EXPORT SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
Definition: misc.c:10571
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
Definition: type_misc.h:44
SCIP_EXPORT void SCIPregressionReset(SCIP_REGRESSION *regression)
Definition: misc.c:388
SCIP_EXPORT int SCIPstrncpy(char *t, const char *s, int size)
Definition: misc.c:10306
SCIP_EXPORT void SCIPhashsetPrintStatistics(SCIP_HASHSET *hashset, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:3750
SCIP_EXPORT int SCIPactivityGetDemand(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6465
SCIP_EXPORT SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10364
SCIP_EXPORT SCIP_RETCODE SCIPactivityCreate(SCIP_RESOURCEACTIVITY **activity, SCIP_VAR *var, int duration, int demand)
Definition: misc.c:6400
SCIP_EXPORT SCIP_Real SCIPregressionGetSlope(SCIP_REGRESSION *regression)
Definition: misc.c:252
SCIP_EXPORT int SCIPprofileGetCapacity(SCIP_PROFILE *profile)
Definition: misc.c:6566
SCIP_EXPORT void SCIPdisjointsetUnion(SCIP_DISJOINTSET *djset, int p, int q, SCIP_Bool forcerepofp)
Definition: misc.c:10683
SCIP_EXPORT int SCIPhashsetGetNSlots(SCIP_HASHSET *hashset)
Definition: misc.c:3817
SCIP_EXPORT void SCIPmultihashPrintStatistics(SCIP_MULTIHASH *multihash, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:2069
static INLINE uint32_t SCIPrealHashCode(double x)
Definition: pub_misc.h:509
SCIP_EXPORT int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
Definition: misc.c:3358
SCIP_EXPORT void SCIPbtPrintGml(SCIP_BT *tree, FILE *file)
Definition: misc.c:8598
SCIP_EXPORT void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
Definition: misc.c:8310
SCIP_EXPORT SCIP_Longint * SCIPsparseSolGetUbs(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:798
SCIP_EXPORT int SCIPdisjointsetGetComponentCount(SCIP_DISJOINTSET *djset)
Definition: misc.c:10753
SCIP_EXPORT SCIP_RETCODE SCIPmultihashCreate(SCIP_MULTIHASH **multihash, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
Definition: misc.c:1778
SCIP_EXPORT SCIP_Bool SCIPsparseSolGetNextSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
Definition: misc.c:831
SCIP_EXPORT void SCIPhashmapEntrySetImageReal(SCIP_HASHMAPENTRY *entry, SCIP_Real image)
Definition: misc.c:3439
SCIP_EXPORT void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
Definition: misc.c:10482
SCIP_EXPORT SCIP_RETCODE SCIPhashmapInsertReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
Definition: misc.c:3045
SCIP_EXPORT void SCIPdigraphGetComponent(SCIP_DIGRAPH *digraph, int compidx, int **nodes, int *nnodes)
Definition: misc.c:7867
SCIP_EXPORT void SCIPswapInts(int *value1, int *value2)
Definition: misc.c:9865
SCIP_EXPORT SCIP_Real SCIPnormalCDF(SCIP_Real mean, SCIP_Real variance, SCIP_Real value)
Definition: misc.c:184
type definitions for problem variables
Definition: grphload.c:88
SCIP_EXPORT SCIP_RETCODE SCIPqueueCreate(SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac)
Definition: misc.c:932
SCIP_EXPORT SCIP_Bool SCIPfindSimpleRational(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
Definition: misc.c:9335
SCIP_EXPORT SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)))
Definition: misc.c:1234
SCIP_EXPORT void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
Definition: misc.c:3607
SCIP_EXPORT SCIP_Real SCIPhashtableGetLoad(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2611
SCIP_EXPORT SCIP_RETCODE SCIPhashsetCreate(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size)
Definition: misc.c:3576
SCIP_EXPORT int SCIPrandomGetInt(SCIP_RANDNUMGEN *randgen, int minrandval, int maxrandval)
Definition: misc.c:9618
SCIP_EXPORT void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
Definition: misc.c:2163
SCIP_EXPORT void SCIPdisjointsetClear(SCIP_DISJOINTSET *djset)
Definition: misc.c:10639
#define SCIP_Bool
Definition: def.h:70
SCIP_EXPORT SCIP_VAR * SCIPactivityGetVar(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6445
SCIP_EXPORT SCIP_RETCODE SCIPhashsetRemove(SCIP_HASHSET *hashset, void *element)
Definition: misc.c:3675
SCIP_EXPORT SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2891
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
Definition: misc.c:8415
SCIP_EXPORT SCIP_RETCODE SCIPgetRandomSubset(void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
Definition: misc.c:9975
SCIP_EXPORT void SCIPsparseSolFree(SCIP_SPARSESOL **sparsesol)
Definition: misc.c:754
SCIP_EXPORT SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int height)
Definition: misc.c:6809
SCIP_EXPORT int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7547
SCIP_EXPORT void SCIPactivityFree(SCIP_RESOURCEACTIVITY **activity)
Definition: misc.c:6419
SCIP_EXPORT int SCIPprofileGetTime(SCIP_PROFILE *profile, int pos)
Definition: misc.c:6606
SCIP_EXPORT void SCIPbtSetRoot(SCIP_BT *tree, SCIP_BTNODE *root)
Definition: misc.c:8651
SCIP_EXPORT SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
Definition: misc.c:8963
SCIP_EXPORT SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
Definition: misc.c:6632
SCIP_EXPORT void SCIPgmlWriteClosing(FILE *file)
Definition: misc.c:687
SCIP_EXPORT void SCIPmultihashFree(SCIP_MULTIHASH **multihash)
Definition: misc.c:1811
SCIP_EXPORT SCIP_RETCODE SCIPdigraphSetNSuccessors(SCIP_DIGRAPH *digraph, int node, int nsuccessors)
Definition: misc.c:7458
SCIP_EXPORT SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
Definition: misc.c:8246
static const unsigned int randseed
Definition: circle.c:46
SCIP_EXPORT void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randgen, int *array, int begin, int end)
Definition: misc.c:9659
SCIP_EXPORT SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
Definition: misc.c:8628
SCIP_EXPORT SCIP_Real SCIPhashmapEntryGetImageReal(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3407
SCIP_EXPORT unsigned int SCIPqueueFirstUInt(SCIP_QUEUE *queue)
Definition: misc.c:1155
SCIP_EXPORT SCIP_Bool SCIPhashsetIsEmpty(SCIP_HASHSET *hashset)
Definition: misc.c:3801
SCIP_EXPORT SCIP_RETCODE SCIPdigraphSetSizes(SCIP_DIGRAPH *digraph, int *sizes)
Definition: misc.c:7282
SCIP_EXPORT int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
Definition: misc.c:6596
SCIP_EXPORT SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
Definition: misc.c:8638
SCIP_EXPORT SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
Definition: misc.c:3450
SCIP_EXPORT SCIP_Real SCIPcomputeGap(SCIP_Real eps, SCIP_Real inf, SCIP_Real primalbound, SCIP_Real dualbound)
Definition: misc.c:10589
SCIP_EXPORT void SCIPswapPointers(void **pointer1, void **pointer2)
Definition: misc.c:9891
SCIP_EXPORT void SCIPregressionFree(SCIP_REGRESSION **regression)
Definition: misc.c:420
SCIP_EXPORT SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
Definition: misc.c:8933
SCIP_EXPORT SCIP_VAR ** SCIPsparseSolGetVars(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:768
SCIP_EXPORT SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3118
SCIP_EXPORT void SCIPhashmapPrintStatistics(SCIP_HASHMAP *hashmap, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:3302
SCIP_EXPORT void SCIPpermuteIntArray(int *array, int begin, int end, unsigned int *randseed)
Definition: misc.c:9907
SCIP_EXPORT int SCIPprofileGetLatestFeasibleStart(SCIP_PROFILE *profile, int lb, int ub, int duration, int height, SCIP_Bool *infeasible)
Definition: misc.c:7048
methods for sorting joint arrays of various types
SCIP_EXPORT void SCIPmultihashRemoveAll(SCIP_MULTIHASH *multihash)
Definition: misc.c:2028
SCIP_EXPORT int SCIPdigraphGetNArcs(SCIP_DIGRAPH *digraph)
Definition: misc.c:7514
SCIP_EXPORT void ** SCIPpqueueElems(SCIP_PQUEUE *pqueue)
Definition: misc.c:1373
SCIP_EXPORT SCIP_RETCODE SCIPhashsetInsert(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element)
Definition: misc.c:3617
SCIP_EXPORT SCIP_RETCODE SCIPmultihashRemove(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1994
SCIP_EXPORT int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6586
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:172
SCIP_EXPORT void SCIPhashtableRemoveAll(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2572
SCIP_EXPORT void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
Definition: misc.c:8488
SCIP_EXPORT int SCIPgetRandomInt(int minrandval, int maxrandval, unsigned int *seedp)
Definition: misc.c:9501
SCIP_EXPORT void SCIPgmlWriteNodeWeight(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor, SCIP_Real weight)
Definition: misc.c:533
SCIP_EXPORT SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString)
Definition: misc.c:2668
SCIP_EXPORT void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
Definition: misc.c:8502
SCIP_EXPORT void SCIPprofileFree(SCIP_PROFILE **profile)
Definition: misc.c:6528
SCIP_EXPORT int SCIPactivityGetEnergy(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6475
SCIP_EXPORT int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10263
SCIP_EXPORT void SCIPhashtablePrintStatistics(SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:2621
SCIP_EXPORT void * SCIPdigraphGetNodeData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7484
SCIP_EXPORT void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
Definition: misc.c:8516
SCIP_EXPORT SCIP_Real SCIPgetRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
Definition: misc.c:9514
SCIP_EXPORT void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2925
SCIP_EXPORT SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)
Definition: misc.c:9378
SCIP_EXPORT void SCIPdigraphPrintGml(SCIP_DIGRAPH *digraph, FILE *file)
Definition: misc.c:8154
#define SCIP_Real
Definition: def.h:164
SCIP_VAR ** y
Definition: circlepacking.c:55
SCIP_EXPORT SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
Definition: misc.c:8453
SCIP_EXPORT SCIP_RETCODE SCIPcomputeArraysIntersection(int *array1, int narray1, int *array2, int narray2, int *intersectarray, int *nintersectarray)
Definition: misc.c:10034
SCIP_EXPORT SCIP_RETCODE SCIPdigraphTopoSortComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7788
SCIP_EXPORT void SCIPhashmapEntrySetImageInt(SCIP_HASHMAPENTRY *entry, int image)
Definition: misc.c:3428
SCIP_EXPORT void SCIPprintSysError(const char *message)
Definition: misc.c:10172
#define SCIP_Longint
Definition: def.h:149
SCIP_EXPORT SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard)
Definition: misc.c:2687
type definitions for message output methods
SCIP_EXPORT void SCIPdigraphPrint(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:8119
#define nnodes
Definition: gastrans.c:65
SCIP_EXPORT void SCIPqueueFree(SCIP_QUEUE **queue)
Definition: misc.c:956
SCIP_EXPORT void SCIPregressionAddObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
Definition: misc.c:369
common defines and data types used in all packages of SCIP
SCIP_EXPORT void SCIPdigraphSetNodeData(SCIP_DIGRAPH *digraph, void *dataptr, int node)
Definition: misc.c:7500
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:427
SCIP_EXPORT SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
Definition: misc.c:10333
SCIP_EXPORT SCIP_RETCODE SCIPhashmapSetImageReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
Definition: misc.c:3208
SCIP_EXPORT void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
Definition: misc.c:485
SCIP_EXPORT SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)
Definition: misc.c:9123
SCIP_EXPORT int SCIPsparseSolGetNVars(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:778
SCIP_EXPORT SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8942
SCIP_EXPORT SCIP_Bool SCIPhashmapIsEmpty(SCIP_HASHMAP *hashmap)
Definition: misc.c:3340
SCIP_EXPORT SCIP_RETCODE SCIPsparseSolCreate(SCIP_SPARSESOL **sparsesol, SCIP_VAR **vars, int nvars, SCIP_Bool cleared)
Definition: misc.c:702
SCIP_EXPORT void SCIPbtFree(SCIP_BT **tree)
Definition: misc.c:8546
SCIP_EXPORT void ** SCIPhashsetGetSlots(SCIP_HASHSET *hashset)
Definition: misc.c:3825
SCIP_EXPORT SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int height, int *pos, SCIP_Bool *infeasible)
Definition: misc.c:6779
SCIP_EXPORT SCIP_Longint SCIPmultihashGetNElements(SCIP_MULTIHASH *multihash)
Definition: misc.c:2049
SCIP_EXPORT void * SCIPqueueFirst(SCIP_QUEUE *queue)
Definition: misc.c:1137
SCIP_EXPORT int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
Definition: misc.c:10147
SCIP_EXPORT SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3256
SCIP_EXPORT void SCIPhashmapEntrySetImage(SCIP_HASHMAPENTRY *entry, void *image)
Definition: misc.c:3417
SCIP_EXPORT void SCIPdigraphFreeComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:8087
SCIP_EXPORT SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
Definition: misc.c:6514
SCIP_EXPORT int SCIPhashsetGetNElements(SCIP_HASHSET *hashset)
Definition: misc.c:3809
SCIP_EXPORT void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randgen, void **array, int begin, int end)
Definition: misc.c:9689
SCIP_EXPORT SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:3140
SCIP_EXPORT SCIP_Real SCIPnormalGetCriticalValue(SCIP_CONFIDENCELEVEL clevel)
Definition: misc.c:171
SCIP_EXPORT SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7396
methods for selecting (weighted) k-medians
SCIP_EXPORT SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
Definition: misc.c:1280
SCIP_EXPORT SCIP_RETCODE SCIPhashmapSetImageInt(SCIP_HASHMAP *hashmap, void *origin, int image)
Definition: misc.c:3174
memory allocation routines