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-2018 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SCIP is distributed under the terms of the ZIB Academic License. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SCIP; see the file COPYING. If not email to 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 
52 /* in optimized mode some of the function are handled via defines, for that the structs are needed */
53 #ifdef NDEBUG
54 #include "scip/struct_misc.h"
55 #endif
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /*
62  * methods for statistical tests
63  */
64 
65 /**@defgroup STATISTICALTESTS Statistical tests
66  * @ingroup MiscellaneousMethods
67  * @brief public methods for statistical tests
68  *
69  * Below are the public methods for statistical tests inside of \SCIP
70  *
71  * @{
72  */
73 
74 /** get critical value of a Student-T distribution for a given number of degrees of freedom at a confidence level */
75 extern
77  SCIP_CONFIDENCELEVEL clevel, /**< (one-sided) confidence level */
78  int df /**< degrees of freedom */
79  );
80 
81 /** compute a t-value for the hypothesis that x and y are from the same population; Assuming that
82  * x and y represent normally distributed random samples with equal variance, the returned value
83  * comes from a Student-T distribution with countx + county - 2 degrees of freedom; this
84  * value can be compared with a critical value (see also SCIPstudentTGetCriticalValue()) at
85  * a predefined confidence level for checking if x and y significantly differ in location
86  */
87 extern
89  SCIP_Real meanx, /**< the mean of the first distribution */
90  SCIP_Real meany, /**< the mean of the second distribution */
91  SCIP_Real variancex, /**< the variance of the x-distribution */
92  SCIP_Real variancey, /**< the variance of the y-distribution */
93  SCIP_Real countx, /**< number of samples of x */
94  SCIP_Real county /**< number of samples of y */
95  );
96 
97 /** returns the value of the Gauss error function evaluated at a given point */
98 extern
100  SCIP_Real x /**< value to evaluate */
101  );
102 
103 /** get critical value of a standard normal distribution at a given confidence level */
104 extern
106  SCIP_CONFIDENCELEVEL clevel /**< (one-sided) confidence level */
107  );
108 
109 /** calculates the cumulative distribution P(-infinity <= x <= value) that a normally distributed
110  * random variable x takes a value between -infinity and parameter \p value.
111  *
112  * The distribution is given by the respective mean and deviation. This implementation
113  * uses the error function erf().
114  */
115 extern
117  SCIP_Real mean, /**< the mean value of the distribution */
118  SCIP_Real variance, /**< the square of the deviation of the distribution */
119  SCIP_Real value /**< the upper limit of the calculated distribution integral */
120  );
121 
122 /**@} */
123 
124 /**@defgroup Regression Linear Regression
125  * @ingroup MiscellaneousMethods
126  * @brief methods for linear regression
127  *
128  * Below are the public methods for incremental linear regression of observations pairs \f$(X_i,Y_i), i=1\dots,n\f$
129  *
130  * @{
131  */
132 
133 /** returns the number of observations of this regression */
134 extern
136  SCIP_REGRESSION* regression /**< regression data structure */
137  );
138 
139 /** return the current slope of the regression */
140 extern
142  SCIP_REGRESSION* regression /**< regression data structure */
143  );
144 
145 /** get the current y-intercept of the regression */
146 extern
148  SCIP_REGRESSION* regression /**< regression data structure */
149  );
150 
151 /** removes an observation (x,y) from the regression */
152 extern
154  SCIP_REGRESSION* regression, /**< regression data structure */
155  SCIP_Real x, /**< X of observation */
156  SCIP_Real y /**< Y of the observation */
157  );
158 
159 /** update regression by a new observation (x,y) */
160 extern
162  SCIP_REGRESSION* regression, /**< regression data structure */
163  SCIP_Real x, /**< X of observation */
164  SCIP_Real y /**< Y of the observation */
165  );
166 
167 /** reset regression data structure */
168 extern
170  SCIP_REGRESSION* regression /**< regression data structure */
171  );
172 
173 /** creates and resets a regression */
174 extern
176  SCIP_REGRESSION** regression /**< regression data structure */
177  );
178 
179 /** frees a regression */
180 extern
181 void SCIPregressionFree(
182  SCIP_REGRESSION** regression /**< regression data structure */
183  );
184 
185 /**@} */
186 
187 /*
188  */
189 
190 /**@defgroup GMLgraph GML Graphical Printing
191  * @ingroup MiscellaneousMethods
192  * @brief GML graph printing methods
193  *
194  * For a detailed format decription see http://docs.yworks.com/yfiles/doc/developers-guide/gml.html
195  *
196  * @{
197  */
198 
199 
200 /** writes a node section to the given graph file */
201 extern
202 void SCIPgmlWriteNode(
203  FILE* file, /**< file to write to */
204  unsigned int id, /**< id of the node */
205  const char* label, /**< label of the node */
206  const char* nodetype, /**< type of the node, or NULL */
207  const char* fillcolor, /**< color of the node's interior, or NULL */
208  const char* bordercolor /**< color of the node's border, or NULL */
209  );
210 
211 /** writes a node section including weight to the given graph file */
212 extern
214  FILE* file, /**< file to write to */
215  unsigned int id, /**< id of the node */
216  const char* label, /**< label of the node */
217  const char* nodetype, /**< type of the node, or NULL */
218  const char* fillcolor, /**< color of the node's interior, or NULL */
219  const char* bordercolor, /**< color of the node's border, or NULL */
220  SCIP_Real weight /**< weight of node */
221  );
222 
223 /** writes an edge section to the given graph file */
224 extern
225 void SCIPgmlWriteEdge(
226  FILE* file, /**< file to write to */
227  unsigned int source, /**< source node id of the node */
228  unsigned int target, /**< target node id of the edge */
229  const char* label, /**< label of the edge, or NULL */
230  const char* color /**< color of the edge, or NULL */
231  );
232 
233 /** writes an arc section to the given graph file */
234 extern
235 void SCIPgmlWriteArc(
236  FILE* file, /**< file to write to */
237  unsigned int source, /**< source node id of the node */
238  unsigned int target, /**< target node id of the edge */
239  const char* label, /**< label of the edge, or NULL */
240  const char* color /**< color of the edge, or NULL */
241  );
242 
243 /** writes the starting line to a GML graph file, does not open a file */
244 extern
246  FILE* file, /**< file to write to */
247  SCIP_Bool directed /**< is the graph directed */
248  );
249 
250 /** writes the ending lines to a GML graph file, does not close a file */
251 extern
253  FILE* file /**< file to close */
254  );
255 
256 /**@} */
257 
258 /*
259  * Sparse solution
260  */
261 
262 /**@defgroup SparseSol Sparse Solution
263  * @ingroup DataStructures
264  * @brief sparse storage for multiple integer solutions
265  *
266  * @{
267  */
268 
269 /** creates a sparse solution */
270 extern
272  SCIP_SPARSESOL** sparsesol, /**< pointer to store the created sparse solution */
273  SCIP_VAR** vars, /**< variables in the sparse solution, must not contain continuous variables */
274  int nvars, /**< number of variables to store, size of the lower and upper bound arrays */
275  SCIP_Bool cleared /**< should the lower and upper bound arrays be cleared (entries set to 0) */
276  );
277 
278 /** frees sparse solution */
279 extern
280 void SCIPsparseSolFree(
281  SCIP_SPARSESOL** sparsesol /**< pointer to a sparse solution */
282  );
283 
284 /** returns the variables in the given sparse solution */
285 extern
287  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
288  );
289 
290 /** returns the number of variables in the given sparse solution */
291 extern
293  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
294  );
295 
296 /** returns the the lower bound array for all variables for a given sparse solution */
297 extern
299  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
300  );
301 
302 /** returns the the upper bound array for all variables for a given sparse solution */
303 extern
305  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
306  );
307 
308 /** constructs the first solution of sparse solution (all variables are set to their lower bound value */
309 extern
311  SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
312  SCIP_Longint* sol, /**< array to store the first solution */
313  int nvars /**< number of variables */
314  );
315 
316 /** constructs the next solution of the sparse solution and return whether there was one more or not */
317 extern
319  SCIP_SPARSESOL* sparsesol, /**< sparse solutions */
320  SCIP_Longint* sol, /**< current solution array which get changed to the next solution */
321  int nvars /**< number of variables */
322  );
323 
324 /**@} */
325 
326 
327 /*
328  * Queue
329  */
330 
331 /**@defgroup Queue Queue
332  * @ingroup DataStructures
333  * @brief circular FIFO queue
334  *
335  * @{
336  */
337 
338 
339 /** creates a (circular) queue, best used if the size will be fixed or will not be increased that much */
340 extern
342  SCIP_QUEUE** queue, /**< pointer to the new queue */
343  int initsize, /**< initial number of available element slots */
344  SCIP_Real sizefac /**< memory growing factor applied, if more element slots are needed */
345  );
346 
347 
348 /** frees queue, but not the data elements themselves */
349 extern
350 void SCIPqueueFree(
351  SCIP_QUEUE** queue /**< pointer to a queue */
352  );
353 
354 /** clears the queue, but doesn't free the data elements themselves */
355 extern
356 void SCIPqueueClear(
357  SCIP_QUEUE* queue /**< queue */
358  );
359 
360 /** inserts element at the end of the queue */
361 extern
363  SCIP_QUEUE* queue, /**< queue */
364  void* elem /**< element to be inserted */
365  );
366 
367 /** removes and returns the first element of the queue */
368 extern
369 void* SCIPqueueRemove(
370  SCIP_QUEUE* queue /**< queue */
371  );
372 
373 /** returns the first element of the queue without removing it */
374 extern
375 void* SCIPqueueFirst(
376  SCIP_QUEUE* queue /**< queue */
377  );
378 
379 /** returns whether the queue is empty */
380 extern
382  SCIP_QUEUE* queue /**< queue */
383  );
384 
385 /** returns the number of elements in the queue */
386 extern
387 int SCIPqueueNElems(
388  SCIP_QUEUE* queue /**< queue */
389  );
390 
391 /**@} */
392 
393 /*
394  * Priority Queue
395  */
396 
397 /**@defgroup PriorityQueue Priority Queue
398  * @ingroup DataStructures
399  * @brief priority queue with O(1) access to the minimum element
400  *
401  * @{
402  */
403 
404 /** creates priority queue */
405 extern
407  SCIP_PQUEUE** pqueue, /**< pointer to a priority queue */
408  int initsize, /**< initial number of available element slots */
409  SCIP_Real sizefac, /**< memory growing factor applied, if more element slots are needed */
410  SCIP_DECL_SORTPTRCOMP((*ptrcomp)) /**< data element comparator */
411  );
412 
413 /** frees priority queue, but not the data elements themselves */
414 extern
415 void SCIPpqueueFree(
416  SCIP_PQUEUE** pqueue /**< pointer to a priority queue */
417  );
418 
419 /** clears the priority queue, but doesn't free the data elements themselves */
420 extern
421 void SCIPpqueueClear(
422  SCIP_PQUEUE* pqueue /**< priority queue */
423  );
424 
425 /** inserts element into priority queue */
426 extern
428  SCIP_PQUEUE* pqueue, /**< priority queue */
429  void* elem /**< element to be inserted */
430  );
431 
432 /** removes and returns best element from the priority queue */
433 extern
434 void* SCIPpqueueRemove(
435  SCIP_PQUEUE* pqueue /**< priority queue */
436  );
437 
438 /** returns the best element of the queue without removing it */
439 extern
440 void* SCIPpqueueFirst(
441  SCIP_PQUEUE* pqueue /**< priority queue */
442  );
443 
444 /** returns the number of elements in the queue */
445 extern
446 int SCIPpqueueNElems(
447  SCIP_PQUEUE* pqueue /**< priority queue */
448  );
449 
450 /** returns the elements of the queue; changing the returned array may destroy the queue's ordering! */
451 extern
452 void** SCIPpqueueElems(
453  SCIP_PQUEUE* pqueue /**< priority queue */
454  );
455 
456 /**@} */
457 
458 
459 /*
460  * Hash Table
461  */
462 
463 /**@defgroup HashTable Hash Table
464  * @ingroup DataStructures
465  * @brief hash table that resolves conflicts by probing
466  *
467  *@{
468  */
469 
470 /* fast 2-universal hash functions for two and four elements */
471 
472 #define SCIPhashSignature64(a) (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26))
473 #define SCIPhashTwo(a, b) ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32))
474 
475 #define SCIPhashFour(a, b, c, d) ((uint32_t)((((uint64_t)(a) + 0xbd5c89185f082658ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) + \
476  ((uint64_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(d) + 0x926f2d4dc4a67218ULL))>>32 ))
477 
478 /* helpers to use above hashfuncions */
479 #define SCIPcombineTwoInt(a, b) (((uint64_t) (a) << 32) | (uint64_t) (b) )
480 
481 #define SCIPcombineThreeInt(a, b, c) (((uint64_t) (a) << 43) + ((uint64_t) (b) << 21) + ((uint64_t) (c)) )
482 
483 #define SCIPcombineFourInt(a, b, c, d) (((uint64_t) (a) << 48) + ((uint64_t) (b) << 32) + ((uint64_t) (c) << 16) + ((uint64_t) (d)) )
484 
485 /** computes a hashcode for double precision floating point values containing
486  * 15 significant bits, the sign and the exponent
487  */
488 INLINE static
489 uint32_t SCIPrealHashCode(double x)
490 {
491  int exp;
492  return (((uint32_t)(uint16_t)(int16_t)ldexp(frexp(x, &exp), 15))<<16) | (uint32_t)(uint16_t)exp;
493 }
494 
495 /** creates a hash table */
496 extern
498  SCIP_HASHTABLE** hashtable, /**< pointer to store the created hash table */
499  BMS_BLKMEM* blkmem, /**< block memory used to store hash table entries */
500  int tablesize, /**< size of the hash table */
501  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
502  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
503  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
504  void* userptr /**< user pointer */
505  );
506 
507 /** frees the hash table */
508 extern
509 void SCIPhashtableFree(
510  SCIP_HASHTABLE** hashtable /**< pointer to the hash table */
511  );
512 
513 /** removes all elements of the hash table
514  *
515  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
516  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
517  *
518  * @deprecated Please use SCIPhashtableRemoveAll()
519  */
520 extern
521 void SCIPhashtableClear(
522  SCIP_HASHTABLE* hashtable /**< hash table */
523  );
524 
525 /** inserts element in hash table (multiple inserts of same element override the previous entry) */
526 extern
528  SCIP_HASHTABLE* hashtable, /**< hash table */
529  void* element /**< element to insert into the table */
530  );
531 
532 /** inserts element in hash table (multiple insertion of same element is checked and results in an error) */
533 extern
535  SCIP_HASHTABLE* hashtable, /**< hash table */
536  void* element /**< element to insert into the table */
537  );
538 
539 /** retrieve element with key from hash table, returns NULL if not existing */
540 extern
542  SCIP_HASHTABLE* hashtable, /**< hash table */
543  void* key /**< key to retrieve */
544  );
545 
546 /** returns whether the given element exists in the table */
547 extern
549  SCIP_HASHTABLE* hashtable, /**< hash table */
550  void* element /**< element to search in the table */
551  );
552 
553 /** removes element from the hash table, if it exists */
554 extern
556  SCIP_HASHTABLE* hashtable, /**< hash table */
557  void* element /**< element to remove from the table */
558  );
559 
560 /** removes all elements of the hash table */
561 extern
563  SCIP_HASHTABLE* hashtable /**< hash table */
564  );
565 
566 /** returns number of hash table elements */
567 extern
569  SCIP_HASHTABLE* hashtable /**< hash table */
570  );
571 
572 /** gives the number of entries in the internal arrays of a hash table */
573 extern
575  SCIP_HASHTABLE* hashtable /**< hash table */
576  );
577 
578 /** gives the element at the given index or NULL if entry at that index has no element */
579 extern
581  SCIP_HASHTABLE* hashtable, /**< hash table */
582  int entryidx /**< index of hash table entry */
583  );
584 
585 /** returns the load of the given hash table in percentage */
586 extern
588  SCIP_HASHTABLE* hashtable /**< hash table */
589  );
590 
591 /** prints statistics about hash table usage */
592 extern
594  SCIP_HASHTABLE* hashtable, /**< hash table */
595  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
596  );
597 
598 /**@} */
599 
600 /*
601  * MultiHash Table
602  */
603 
604 /**@defgroup MultiHash Multi Hash table
605  * @ingroup DataStructures
606  * @brief hash table that resolves conflicts by queueing, thereby allowing for duplicate entries
607  *
608  *@{
609  */
610 
611 /** returns a reasonable hash table size (a prime number) that is at least as large as the specified value */
612 extern
614  int minsize /**< minimal size of the hash table */
615  );
616 
617 /** creates a multihash table */
618 extern
620  SCIP_MULTIHASH** multihash, /**< pointer to store the created multihash table */
621  BMS_BLKMEM* blkmem, /**< block memory used to store multihash table entries */
622  int tablesize, /**< size of the hash table */
623  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
624  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
625  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
626  void* userptr /**< user pointer */
627  );
628 
629 /** frees the multihash table */
630 extern
631 void SCIPmultihashFree(
632  SCIP_MULTIHASH** multihash /**< pointer to the multihash table */
633  );
634 
635 /** inserts element in multihash table (multiple inserts of same element possible)
636  *
637  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding an element
638  * to the hash table, due to dynamic resizing.
639  */
640 extern
642  SCIP_MULTIHASH* multihash, /**< multihash table */
643  void* element /**< element to insert into the table */
644  );
645 
646 /** inserts element in multihash table (multiple insertion of same element is checked and results in an error)
647  *
648  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding a new
649  * element to the multihash table, due to dynamic resizing.
650  */
651 extern
653  SCIP_MULTIHASH* multihash, /**< multihash table */
654  void* element /**< element to insert into the table */
655  );
656 
657 /** retrieve element with key from multihash table, returns NULL if not existing */
658 extern
660  SCIP_MULTIHASH* multihash, /**< multihash table */
661  void* key /**< key to retrieve */
662  );
663 
664 /** retrieve element with key from multihash table, returns NULL if not existing
665  * can be used to retrieve all entries with the same key (one-by-one)
666  *
667  * @note The returned multimultihashlist pointer might get invalid when adding a new element to the multihash table.
668  */
669 extern
671  SCIP_MULTIHASH* multihash, /**< multihash table */
672  SCIP_MULTIHASHLIST** multihashlist, /**< input: entry in hash table list from which to start searching, or NULL
673  * output: entry in hash table list corresponding to element after
674  * retrieved one, or NULL */
675  void* key /**< key to retrieve */
676  );
677 
678 /** returns whether the given element exists in the multihash table */
679 extern
681  SCIP_MULTIHASH* multihash, /**< multihash table */
682  void* element /**< element to search in the table */
683  );
684 
685 /** removes element from the multihash table, if it exists */
686 extern
688  SCIP_MULTIHASH* multihash, /**< multihash table */
689  void* element /**< element to remove from the table */
690  );
691 
692 /** removes all elements of the multihash table
693  *
694  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
695  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
696  */
697 extern
699  SCIP_MULTIHASH* multihash /**< multihash table */
700  );
701 
702 /** returns number of multihash table elements */
703 extern
705  SCIP_MULTIHASH* multihash /**< multihash table */
706  );
707 
708 /** returns the load of the given multihash table in percentage */
709 extern
711  SCIP_MULTIHASH* multihash /**< multihash table */
712  );
713 
714 /** prints statistics about multihash table usage */
715 extern
717  SCIP_MULTIHASH* multihash, /**< multihash table */
718  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
719  );
720 
721 /** standard hash key comparator for string keys */
722 extern
723 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString);
724 
725 /** standard hashing function for string keys */
726 extern
727 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString);
728 
729 /** gets the element as the key */
730 extern
731 SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard);
732 
733 /** returns TRUE iff both keys(pointer) are equal */
734 extern
735 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqPtr);
736 
737 /** returns the hash value of the key */
738 extern
739 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValPtr);
740 
741 /**@} */
742 
743 
744 /*
745  * Hash Map
746  */
747 
748 /**@defgroup HashMap Hash Map
749  * @ingroup DataStructures
750  * @brief hash map to store key-value pairs (called \p origin and \p image)
751  *
752  * @{
753  */
754 
755 /** creates a hash map mapping pointers to pointers */
756 extern
758  SCIP_HASHMAP** hashmap, /**< pointer to store the created hash map */
759  BMS_BLKMEM* blkmem, /**< block memory used to store hash map entries */
760  int mapsize /**< size of the hash map */
761  );
762 
763 /** frees the hash map */
764 extern
765 void SCIPhashmapFree(
766  SCIP_HASHMAP** hashmap /**< pointer to the hash map */
767  );
768 
769 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
770 extern
772  SCIP_HASHMAP* hashmap, /**< hash map */
773  void* origin, /**< origin to set image for */
774  void* image /**< new image for origin */
775  );
776 
777 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
778 extern
780  SCIP_HASHMAP* hashmap, /**< hash map */
781  void* origin, /**< origin to set image for */
782  SCIP_Real image /**< new image for origin */
783  );
784 
785 /** retrieves image of given origin from the hash map, or NULL if no image exists */
786 extern
787 void* SCIPhashmapGetImage(
788  SCIP_HASHMAP* hashmap, /**< hash map */
789  void* origin /**< origin to retrieve image for */
790  );
791 
792 /** retrieves image of given origin from the hash map, or NULL if no image exists */
793 extern
795  SCIP_HASHMAP* hashmap, /**< hash map */
796  void* origin /**< origin to retrieve image for */
797  );
798 
799 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
800  * new origin->image pair
801  */
802 extern
804  SCIP_HASHMAP* hashmap, /**< hash map */
805  void* origin, /**< origin to set image for */
806  void* image /**< new image for origin */
807  );
808 
809 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
810  * new origin->image pair
811  */
812 extern
814  SCIP_HASHMAP* hashmap, /**< hash map */
815  void* origin, /**< origin to set image for */
816  SCIP_Real image /**< new image for origin */
817  );
818 
819 /** checks whether an image to the given origin exists in the hash map */
820 extern
822  SCIP_HASHMAP* hashmap, /**< hash map */
823  void* origin /**< origin to search for */
824  );
825 
826 /** removes origin->image pair from the hash map, if it exists */
827 extern
829  SCIP_HASHMAP* hashmap, /**< hash map */
830  void* origin /**< origin to remove from the list */
831  );
832 
833 /** prints statistics about hash map usage */
834 extern
836  SCIP_HASHMAP* hashmap, /**< hash map */
837  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
838  );
839 
840 /** indicates whether a hash map has no entries */
841 extern
843  SCIP_HASHMAP* hashmap /**< hash map */
844  );
845 
846 /** gives the number of elements in a hash map */
847 extern
849  SCIP_HASHMAP* hashmap /**< hash map */
850  );
851 
852 /** gives the number of entries in the internal arrays of a hash map */
853 extern
855  SCIP_HASHMAP* hashmap /**< hash map */
856  );
857 
858 /** gives the hashmap entry at the given index or NULL if entry has no element */
859 extern
861  SCIP_HASHMAP* hashmap, /**< hash map */
862  int entryidx /**< index of hash map entry */
863  );
864 
865 /** gives the origin of the hashmap entry */
866 extern
868  SCIP_HASHMAPENTRY* entry /**< hash map entry */
869  );
870 
871 /** gives the image of the hashmap entry */
872 extern
874  SCIP_HASHMAPENTRY* entry /**< hash map entry */
875  );
876 
877 /** gives the image of the hashmap entry */
878 extern
880  SCIP_HASHMAPENTRY* entry /**< hash map entry */
881  );
882 
883 /** sets pointer image of a hashmap entry */
884 extern
886  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
887  void* image /**< new image */
888  );
889 
890 /** sets real image of a hashmap entry */
891 extern
893  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
894  SCIP_Real image /**< new image */
895  );
896 
897 /** removes all entries in a hash map. */
898 extern
900  SCIP_HASHMAP* hashmap /**< hash map */
901  );
902 
903 /**@} */
904 
905 
906 /*
907  * Hash Set
908  */
909 
910 /**@defgroup HashSet Hash Set
911  * @ingroup DataStructures
912  * @brief very lightweight hash set of pointers
913  *
914  * @{
915  */
916 
917 /** creates a hash set of pointers */
918 extern
920  SCIP_HASHSET** hashset, /**< pointer to store the created hash set */
921  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
922  int size /**< initial size of the hash set; it is guaranteed that the set is not
923  * resized if at most that many elements are inserted */
924  );
925 
926 /** frees the hash set */
927 extern
928 void SCIPhashsetFree(
929  SCIP_HASHSET** hashset, /**< pointer to the hash set */
930  BMS_BLKMEM* blkmem /**< block memory used to store hash set entries */
931  );
932 
933 /** inserts new element into the hash set */
934 extern
936  SCIP_HASHSET* hashset, /**< hash set */
937  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
938  void* element /**< element to insert */
939  );
940 
941 /** checks whether an element exists in the hash set */
942 extern
944  SCIP_HASHSET* hashset, /**< hash set */
945  void* element /**< element to search for */
946  );
947 
948 /** removes an element from the hash set, if it exists */
949 extern
951  SCIP_HASHSET* hashset, /**< hash set */
952  void* element /**< origin to remove from the list */
953  );
954 
955 /** prints statistics about hash set usage */
956 extern
958  SCIP_HASHSET* hashset, /**< hash set */
959  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
960  );
961 
962 /** indicates whether a hash set has no entries */
963 extern
965  SCIP_HASHSET* hashset /**< hash set */
966  );
967 
968 /** gives the number of elements in a hash set */
969 extern
971  SCIP_HASHSET* hashset /**< hash set */
972  );
973 
974 /** gives the number of slots of a hash set */
975 extern
977  SCIP_HASHSET* hashset /**< hash set */
978  );
979 
980 /** gives the array of hash set slots; contains all elements in indetermined order and may contain NULL values */
981 extern
982 void** SCIPhashsetGetSlots(
983  SCIP_HASHSET* hashset /**< hash set */
984  );
985 
986 /** removes all entries in a hash set. */
987 extern
989  SCIP_HASHSET* hashset /**< hash set */
990  );
991 
992 #ifdef NDEBUG
993 
994 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
995  * speed up the algorithms.
996  */
997 
998 #define SCIPhashsetIsEmpty(hashset) ((hashset)->nelements == 0)
999 #define SCIPhashsetGetNElements(hashset) ((hashset)->nelements)
1000 #define SCIPhashsetGetNSlots(hashset) (1u << (64 - (hashset)->shift))
1001 #define SCIPhashsetGetSlots(hashset) ((hashset)->slots)
1002 
1003 #endif
1004 
1005 /**@} */
1006 
1007 
1008 /*
1009  * Activity
1010  */
1011 
1012 /**@defgroup ResourceActivity Resource Activity
1013  * @ingroup DataStructures
1014  * @brief ressource activity data structure
1015  *
1016  * @{
1017  */
1018 
1019 /** create a resource activity */
1020 extern
1022  SCIP_RESOURCEACTIVITY** activity, /**< pointer to store the resource activity */
1023  SCIP_VAR* var, /**< start time variable of the activity */
1024  int duration, /**< duration of the activity */
1025  int demand /**< demand of the activity */
1026  );
1027 
1028 /** frees a resource activity */
1029 extern
1030 void SCIPactivityFree(
1031  SCIP_RESOURCEACTIVITY** activity /**< pointer to the resource activity */
1032  );
1033 
1034 #ifndef NDEBUG
1035 
1036 /** returns the start time variable of the resource activity */
1037 extern
1039  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1040  );
1041 
1042 /** returns the duration of the resource activity */
1043 extern
1045  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1046  );
1047 
1048 /** returns the demand of the resource activity */
1049 extern
1051  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1052  );
1053 
1054 /** returns the energy of the resource activity */
1055 extern
1057  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1058  );
1059 
1060 #else
1061 
1062 #define SCIPactivityGetVar(activity) ((activity)->var)
1063 #define SCIPactivityGetDuration(activity) ((activity)->duration)
1064 #define SCIPactivityGetDemand(activity) ((activity)->demand)
1065 #define SCIPactivityGetEnergy(activity) ((activity)->duration * (activity)->demand)
1066 
1067 #endif
1068 
1069 /**@} */
1070 
1071 
1072 /*
1073  * Resource Profile
1074  */
1075 
1076 /**@defgroup ResourceProfile Resource Profile
1077  * @ingroup DataStructures
1078  * @brief ressource profile data structure
1079  *
1080  * @{
1081  */
1082 
1083 /** creates resource profile */
1084 extern
1086  SCIP_PROFILE** profile, /**< pointer to store the resource profile */
1087  int capacity /**< resource capacity */
1088  );
1089 
1090 /** frees given resource profile */
1091 extern
1092 void SCIPprofileFree(
1093  SCIP_PROFILE** profile /**< pointer to the resource profile */
1094  );
1095 
1096 /** output of the given resource profile */
1097 extern
1098 void SCIPprofilePrint(
1099  SCIP_PROFILE* profile, /**< resource profile to output */
1100  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1101  FILE* file /**< output file (or NULL for standard output) */
1102  );
1103 
1104 /** returns the capacity of the resource profile */
1105 extern
1107  SCIP_PROFILE* profile /**< resource profile to use */
1108  );
1109 
1110 /** returns the number time points of the resource profile */
1111 extern
1113  SCIP_PROFILE* profile /**< resource profile to use */
1114  );
1115 
1116 /** returns the time points of the resource profile */
1117 extern
1119  SCIP_PROFILE* profile /**< resource profile to use */
1120  );
1121 
1122 /** returns the loads of the resource profile */
1123 extern
1124 int* SCIPprofileGetLoads(
1125  SCIP_PROFILE* profile /**< resource profile to use */
1126  );
1127 
1128 /** returns the time point for given position of the resource profile */
1129 extern
1130 int SCIPprofileGetTime(
1131  SCIP_PROFILE* profile, /**< resource profile to use */
1132  int pos /**< position */
1133  );
1134 
1135 /** returns the loads of the resource profile at the given position */
1136 extern
1137 int SCIPprofileGetLoad(
1138  SCIP_PROFILE* profile, /**< resource profile */
1139  int pos /**< position */
1140  );
1141 
1142 /** returns if the given time point exists in the resource profile and stores the position of the given time point if it
1143  * exists; otherwise the position of the next smaller existing time point is stored
1144  */
1145 extern
1147  SCIP_PROFILE* profile, /**< resource profile to search */
1148  int timepoint, /**< time point to search for */
1149  int* pos /**< pointer to store the position */
1150  );
1151 
1152 /** insert a core into resource profile; if the core is non-empty the resource profile will be updated otherwise nothing
1153  * happens
1154  */
1155 extern
1157  SCIP_PROFILE* profile, /**< resource profile to use */
1158  int left, /**< left side of the core */
1159  int right, /**< right side of the core */
1160  int height, /**< height of the core */
1161  int* pos, /**< pointer to store the first position were it gets infeasible */
1162  SCIP_Bool* infeasible /**< pointer to store if the core does not fit due to capacity */
1163  );
1164 
1165 /** subtracts the height from the resource profile during core time */
1166 extern
1168  SCIP_PROFILE* profile, /**< resource profile to use */
1169  int left, /**< left side of the core */
1170  int right, /**< right side of the core */
1171  int height /**< height of the core */
1172  );
1173 
1174 /** return the earliest possible starting point within the time interval [lb,ub] for a given core (given by its height
1175  * and duration)
1176  */
1177 extern
1179  SCIP_PROFILE* profile, /**< resource profile to use */
1180  int est, /**< earliest starting time of the given core */
1181  int lst, /**< latest starting time of the given core */
1182  int duration, /**< duration of the core */
1183  int height, /**< height of the core */
1184  SCIP_Bool* infeasible /**< pointer store if the corer cannot be inserted */
1185  );
1186 
1187 /** return the latest possible starting point within the time interval [lb,ub] for a given core (given by its height and
1188  * duration)
1189  */
1190 extern
1192  SCIP_PROFILE* profile, /**< resource profile to use */
1193  int lb, /**< earliest possible start point */
1194  int ub, /**< latest possible start point */
1195  int duration, /**< duration of the core */
1196  int height, /**< height of the core */
1197  SCIP_Bool* infeasible /**< pointer store if the core cannot be inserted */
1198  );
1199 
1200 /**@} */
1201 
1202 /*
1203  * Directed graph
1204  */
1205 
1206 /**@addtogroup DirectedGraph
1207  *
1208  * @{
1209  */
1210 
1211 /** resize directed graph structure */
1212 extern
1214  SCIP_DIGRAPH* digraph, /**< directed graph */
1215  int nnodes /**< new number of nodes */
1216  );
1217 
1218 /** sets the sizes of the successor lists for the nodes in a directed graph and allocates memory for the lists */
1219 extern
1221  SCIP_DIGRAPH* digraph, /**< directed graph */
1222  int* sizes /**< sizes of the successor lists */
1223  );
1224 
1225 /** frees given directed graph structure */
1226 extern
1227 void SCIPdigraphFree(
1228  SCIP_DIGRAPH** digraph /**< pointer to the directed graph */
1229  );
1230 
1231 /** add (directed) arc and a related data to the directed graph structure
1232  *
1233  * @note if the arc is already contained, it is added a second time
1234  */
1235 extern
1237  SCIP_DIGRAPH* digraph, /**< directed graph */
1238  int startnode, /**< start node of the arc */
1239  int endnode, /**< start node of the arc */
1240  void* data /**< data that should be stored for the arc; or NULL */
1241  );
1242 
1243 /** add (directed) arc to the directed graph structure, if it is not contained, yet
1244  *
1245  * @note if there already exists an arc from startnode to endnode, the new arc is not added,
1246  * even if its data is different
1247  */
1248 extern
1250  SCIP_DIGRAPH* digraph, /**< directed graph */
1251  int startnode, /**< start node of the arc */
1252  int endnode, /**< start node of the arc */
1253  void* data /**< data that should be stored for the arc; or NULL */
1254  );
1255 
1256 /** sets the number of successors to a given value */
1257 extern
1259  SCIP_DIGRAPH* digraph, /**< directed graph */
1260  int node, /**< node for which the number of successors has to be changed */
1261  int nsuccessors /**< new number of successors */
1262  );
1263 
1264 /** returns the number of nodes of the given digraph */
1265 extern
1267  SCIP_DIGRAPH* digraph /**< directed graph */
1268  );
1269 
1270 /** returns the node data, or NULL if no data exist */
1271 extern
1273  SCIP_DIGRAPH* digraph, /**< directed graph */
1274  int node /**< node for which the node data is returned */
1275  );
1276 
1277 /** sets the node data */
1278 extern
1280  SCIP_DIGRAPH* digraph, /**< directed graph */
1281  void* dataptr, /**< user node data pointer, or NULL */
1282  int node /**< node for which the node data is returned */
1283  );
1284 
1285 /** returns the total number of arcs in the given digraph */
1286 extern
1288  SCIP_DIGRAPH* digraph /**< directed graph */
1289  );
1290 
1291 /** returns the number of successor nodes of the given node */
1292 extern
1294  SCIP_DIGRAPH* digraph, /**< directed graph */
1295  int node /**< node for which the number of outgoing arcs is returned */
1296  );
1297 
1298 /** returns the array of indices of the successor nodes; this array must not be changed from outside */
1299 extern
1301  SCIP_DIGRAPH* digraph, /**< directed graph */
1302  int node /**< node for which the array of outgoing arcs is returned */
1303  );
1304 
1305 /** returns the array of data corresponding to the arcs originating at the given node, or NULL if no data exist; this
1306  * array must not be changed from outside
1307  */
1308 extern
1310  SCIP_DIGRAPH* digraph, /**< directed graph */
1311  int node /**< node for which the data corresponding to the outgoing arcs is returned */
1312  );
1313 
1314 /** Compute undirected connected components on the given graph.
1315  *
1316  * @note For each arc, its reverse is added, so the graph does not need to be the directed representation of an
1317  * undirected graph.
1318  */
1319 extern
1321  SCIP_DIGRAPH* digraph, /**< directed graph */
1322  int minsize, /**< all components with less nodes are ignored */
1323  int* components, /**< array with as many slots as there are nodes in the directed graph
1324  * to store for each node the component to which it belongs
1325  * (components are numbered 0 to ncomponents - 1); or NULL, if components
1326  * are accessed one-by-one using SCIPdigraphGetComponent() */
1327  int* ncomponents /**< pointer to store the number of components; or NULL, if the
1328  * number of components is accessed by SCIPdigraphGetNComponents() */
1329  );
1330 
1331 /** Computes all strongly connected components of an undirected connected component with Tarjan's Algorithm.
1332  * The resulting strongly connected components are sorted topologically (starting from the end of the
1333  * strongcomponents array).
1334  *
1335  * @note In general a topological sort of the strongly connected components is not unique.
1336  */
1337 extern
1339  SCIP_DIGRAPH* digraph, /**< directed graph */
1340  int compidx, /**< number of the undirected connected component */
1341  int* strongcomponents, /**< array to store the strongly connected components
1342  * (length >= size of the component) */
1343  int* strongcompstartidx, /**< array to store the start indices of the strongly connected
1344  * components (length >= size of the component) */
1345  int* nstrongcomponents /**< pointer to store the number of strongly connected
1346  * components */
1347  );
1348 
1349 /** Performes an (almost) topological sort on the undirected components of the given directed graph. The undirected
1350  * components should be computed before using SCIPdigraphComputeUndirectedComponents().
1351  *
1352  * @note In general a topological sort is not unique. Note, that there might be directed cycles, that are randomly
1353  * broken, which is the reason for having only almost topologically sorted arrays.
1354  */
1355 extern
1357  SCIP_DIGRAPH* digraph /**< directed graph */
1358  );
1359 
1360 /** returns the number of previously computed undirected components for the given directed graph */
1361 extern
1363  SCIP_DIGRAPH* digraph /**< directed graph */
1364  );
1365 
1366 /** Returns the previously computed undirected component of the given number for the given directed graph.
1367  * If the components were sorted using SCIPdigraphTopoSortComponents(), the component is (almost) topologically sorted.
1368  */
1369 extern
1371  SCIP_DIGRAPH* digraph, /**< directed graph */
1372  int compidx, /**< number of the component to return */
1373  int** nodes, /**< pointer to store the nodes in the component; or NULL, if not needed */
1374  int* nnodes /**< pointer to store the number of nodes in the component;
1375  * or NULL, if not needed */
1376  );
1377 
1378 /** frees the component information for the given directed graph */
1379 extern
1381  SCIP_DIGRAPH* digraph /**< directed graph */
1382  );
1383 
1384 /** output of the given directed graph via the given message handler */
1385 extern
1386 void SCIPdigraphPrint(
1387  SCIP_DIGRAPH* digraph, /**< directed graph */
1388  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1389  FILE* file /**< output file (or NULL for standard output) */
1390  );
1391 
1392 /** prints the given directed graph structure in GML format into the given file */
1393 extern
1394 void SCIPdigraphPrintGml(
1395  SCIP_DIGRAPH* digraph, /**< directed graph */
1396  FILE* file /**< file to write to */
1397  );
1398 
1399 
1400 /** output of the given directed graph via the given message handler */
1401 extern
1403  SCIP_DIGRAPH* digraph, /**< directed graph */
1404  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1405  FILE* file /**< output file (or NULL for standard output) */
1406  );
1407 
1408 /**@} */
1409 
1410 /*
1411  * Binary search tree
1412  */
1413 
1414 /**@defgroup BinaryTree Binary Search Tree
1415  * @ingroup DataStructures
1416  * @brief binary search tree data structure
1417  *@{
1418  */
1419 
1420 /** creates a binary tree node with sorting value and user data */
1421 extern
1423  SCIP_BT* tree, /**< binary search tree */
1424  SCIP_BTNODE** node, /**< pointer to store the created search node */
1425  void* dataptr /**< user node data pointer, or NULL */
1426  );
1427 
1428 /** frees the binary node including the rooted subtree
1429  *
1430  * @note The user pointer (object) is not freed. If needed, it has to be done by the user.
1431  */
1432 extern
1433 void SCIPbtnodeFree(
1434  SCIP_BT* tree, /**< binary tree */
1435  SCIP_BTNODE** node /**< node to be freed */
1436  );
1437 
1438 /** returns the user data pointer stored in that node */
1439 extern
1440 void* SCIPbtnodeGetData(
1441  SCIP_BTNODE* node /**< node */
1442  );
1443 
1444 /** returns the parent which can be NULL if the given node is the root */
1445 extern
1447  SCIP_BTNODE* node /**< node */
1448  );
1449 
1450 /** returns left child which can be NULL if the given node is a leaf */
1451 extern
1453  SCIP_BTNODE* node /**< node */
1454  );
1455 
1456 /** returns right child which can be NULL if the given node is a leaf */
1457 extern
1459  SCIP_BTNODE* node /**< node */
1460  );
1461 
1462 /** returns the sibling of the node or NULL if does not exist */
1463 extern
1465  SCIP_BTNODE* node /**< node */
1466  );
1467 
1468 /** returns whether the node is a root node */
1469 extern
1471  SCIP_BTNODE* node /**< node */
1472  );
1473 
1474 /** returns whether the node is a leaf */
1475 extern
1477  SCIP_BTNODE* node /**< node */
1478  );
1479 
1480 /** returns TRUE if the given node is left child */
1481 extern
1483  SCIP_BTNODE* node /**< node */
1484  );
1485 
1486 /** returns TRUE if the given node is right child */
1487 extern
1489  SCIP_BTNODE* node /**< node */
1490  );
1491 
1492 #ifdef NDEBUG
1493 
1494 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1495  * speed up the algorithms.
1496  */
1497 
1498 #define SCIPbtnodeGetData(node) ((node)->dataptr)
1499 #define SCIPbtnodeGetParent(node) ((node)->parent)
1500 #define SCIPbtnodeGetLeftchild(node) ((node)->left)
1501 #define SCIPbtnodeGetRightchild(node) ((node)->right)
1502 #define SCIPbtnodeGetSibling(node) ((node)->parent == NULL ? NULL : \
1503  (node)->parent->left == (node) ? (node)->parent->right : (node)->parent->left)
1504 #define SCIPbtnodeIsRoot(node) ((node)->parent == NULL)
1505 #define SCIPbtnodeIsLeaf(node) ((node)->left == NULL && (node)->right == NULL)
1506 #define SCIPbtnodeIsLeftchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->left == (node) ? TRUE : FALSE)
1507 #define SCIPbtnodeIsRightchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->right == (node) ? TRUE : FALSE)
1508 
1509 #endif
1510 
1511 /** sets the give node data
1512  *
1513  * @note The old user pointer is not freed.
1514  */
1515 extern
1516 void SCIPbtnodeSetData(
1517  SCIP_BTNODE* node, /**< node */
1518  void* dataptr /**< node user data pointer */
1519  );
1520 
1521 /** sets parent node
1522  *
1523  * @note The old parent including the rooted subtree is not delete.
1524  */
1525 extern
1526 void SCIPbtnodeSetParent(
1527  SCIP_BTNODE* node, /**< node */
1528  SCIP_BTNODE* parent /**< new parent node, or NULL */
1529  );
1530 
1531 /** sets left child
1532  *
1533  * @note The old left child including the rooted subtree is not delete.
1534  */
1535 extern
1537  SCIP_BTNODE* node, /**< node */
1538  SCIP_BTNODE* left /**< new left child, or NULL */
1539  );
1540 
1541 /** sets right child
1542  *
1543  * @note The old right child including the rooted subtree is not delete.
1544  */
1545 extern
1547  SCIP_BTNODE* node, /**< node */
1548  SCIP_BTNODE* right /**< new right child, or NULL */
1549  );
1550 
1551 /** creates an binary tree */
1552 extern
1554  SCIP_BT** tree, /**< pointer to store the created binary tree */
1555  BMS_BLKMEM* blkmem /**< block memory used to create nodes */
1556  );
1557 
1558 /** frees binary tree
1559  *
1560  * @note The user pointers (object) of the search nodes are not freed. If needed, it has to be done by the user.
1561  */
1562 extern
1563 void SCIPbtFree(
1564  SCIP_BT** tree /**< pointer to binary tree */
1565  );
1566 
1567 /** prints the binary tree in GML format into the given file */
1568 extern
1569 void SCIPbtPrintGml(
1570  SCIP_BT* tree, /**< binary tree */
1571  FILE* file /**< file to write to */
1572  );
1573 
1574 /** returns whether the binary tree is empty (has no nodes) */
1575 extern
1577  SCIP_BT * tree /**< binary tree */
1578  );
1579 
1580 /** returns the root node of the binary tree or NULL if the binary tree is empty */
1581 extern
1583  SCIP_BT* tree /**< tree to be evaluated */
1584  );
1585 
1586 #ifdef NDEBUG
1587 
1588 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1589  * speed up the algorithms.
1590  */
1591 
1592 #define SCIPbtIsEmpty(tree) (tree->root == NULL)
1593 #define SCIPbtGetRoot(tree) (tree->root)
1594 
1595 #endif
1596 
1597 /** sets root node
1598  *
1599  * @note The old root including the rooted subtree is not delete.
1600  */
1601 extern
1602 void SCIPbtSetRoot(
1603  SCIP_BT* tree, /**< tree to be evaluated */
1604  SCIP_BTNODE* root /**< new root, or NULL */
1605  );
1606 
1607 /**@} */
1608 
1609 /**@addtogroup DisjointSet
1610  *
1611  * @{
1612  */
1613 
1614 /*
1615  * Disjoined Set data structure
1616  */
1617 
1618 /** clears the disjoint set (union find) structure \p uf */
1619 extern
1621  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1622  );
1623 
1624 /** finds and returns the component identifier of this \p element */
1625 extern
1627  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1628  int element /**< element to be found */
1629  );
1630 
1631 /** merges the components containing the elements \p p and \p q */
1632 extern
1634  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1635  int p, /**< first element */
1636  int q, /**< second element */
1637  SCIP_Bool forcerepofp /**< force representative of p to be new representative */
1638  );
1639 
1640 /** returns the number of independent components in this disjoint set (union find) data structure */
1641 extern
1643  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1644  );
1645 
1646 /** returns the size (number of nodes) of this disjoint set (union find) data structure */
1647 extern
1649  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1650  );
1651 
1652 /* @} */
1653 
1654 /*
1655  * Numerical methods
1656  */
1657 
1658 /**@defgroup NumericalMethods Numerical Methods
1659  * @ingroup MiscellaneousMethods
1660  * @brief commonly used numerical methods
1661  *
1662  * @{
1663  */
1664 
1665 /** returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0 */
1666 extern
1668  void
1669  );
1670 
1671 /** returns the next representable value of from in the direction of to */
1672 extern
1674  SCIP_Real from, /**< value from which the next representable value should be returned */
1675  SCIP_Real to /**< direction in which the next representable value should be returned */
1676  );
1677 
1678 /** calculates the greatest common divisor of the two given values */
1679 extern
1681  SCIP_Longint val1, /**< first value of greatest common devisor calculation */
1682  SCIP_Longint val2 /**< second value of greatest common devisor calculation */
1683  );
1684 
1685 /** calculates the smallest common multiple of the two given values */
1686 extern
1688  SCIP_Longint val1, /**< first value of smallest common multiple calculation */
1689  SCIP_Longint val2 /**< second value of smallest common multiple calculation */
1690  );
1691 
1692 /** calculates a binomial coefficient n over m, choose m elements out of n, maximal value will be 33 over 16 (because
1693  * 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
1694  * big numbers or an negative value m (and m < n) and -1 will be returned
1695  */
1696 extern
1698  int n, /**< number of different elements */
1699  int m /**< number to choose out of the above */
1700  );
1701 
1702 /** converts a real number into a (approximate) rational representation, and returns TRUE iff the conversion was
1703  * successful
1704  */
1705 extern
1707  SCIP_Real val, /**< real value r to convert into rational number */
1708  SCIP_Real mindelta, /**< minimal allowed difference r - q of real r and rational q = n/d */
1709  SCIP_Real maxdelta, /**< maximal allowed difference r - q of real r and rational q = n/d */
1710  SCIP_Longint maxdnom, /**< maximal denominator allowed */
1711  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1712  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1713  );
1714 
1715 /** tries to find a value, such that all given values, if scaled with this value become integral in relative allowed
1716  * difference in between mindelta and maxdelta
1717  */
1718 extern
1720  SCIP_Real* vals, /**< values to scale */
1721  int nvals, /**< number of values to scale */
1722  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1723  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1724  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1725  SCIP_Real maxscale, /**< maximal allowed scalar */
1726  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1727  SCIP_Bool* success /**< stores whether returned value is valid */
1728  );
1729 
1730 /** given a (usually very small) interval, tries to find a rational number with simple denominator (i.e. a small
1731  * number, probably multiplied with powers of 10) out of this interval; returns TRUE iff a valid rational
1732  * number inside the interval was found
1733  */
1734 extern
1736  SCIP_Real lb, /**< lower bound of the interval */
1737  SCIP_Real ub, /**< upper bound of the interval */
1738  SCIP_Longint maxdnom, /**< maximal denominator allowed for resulting rational number */
1739  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1740  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1741  );
1742 
1743 /** given a (usually very small) interval, selects a value inside this interval; it is tried to select a rational number
1744  * with simple denominator (i.e. a small number, probably multiplied with powers of 10);
1745  * if no valid rational number inside the interval was found, selects the central value of the interval
1746  */
1747 extern
1749  SCIP_Real lb, /**< lower bound of the interval */
1750  SCIP_Real ub, /**< upper bound of the interval */
1751  SCIP_Longint maxdnom /**< maximal denominator allowed for resulting rational number */
1752  );
1753 
1754 /* The C99 standard defines the function (or macro) isfinite.
1755  * On MacOS X, isfinite is also available.
1756  * From the BSD world, there comes a function finite.
1757  * On SunOS, finite is also available.
1758  * In the MS compiler world, there is a function _finite.
1759  * As last resort, we check whether x == x does not hold, but this works only for NaN's, not for infinities!
1760  */
1761 #if _XOPEN_SOURCE >= 600 || defined(_ISOC99_SOURCE) || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__)
1762 #define SCIPisFinite isfinite
1763 #elif defined(_BSD_SOURCE) || defined(__sun)
1764 #define SCIPisFinite finite
1765 #elif defined(_MSC_VER)
1766 #define SCIPisFinite _finite
1767 #else
1768 #define SCIPisFinite(x) ((x) == (x))
1769 #endif
1770 
1771 /* In debug mode, the following methods are implemented as function calls to ensure
1772  * type validity.
1773  */
1774 
1775 /** returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0) */
1776 extern
1778  SCIP_Real val1, /**< first value to be compared */
1779  SCIP_Real val2 /**< second value to be compared */
1780  );
1781 
1782 #ifdef NDEBUG
1783 
1784 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1785  * speed up the algorithms.
1786  */
1787 
1788 #define SCIPrelDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) )
1789 
1790 #endif
1791 
1792 /** computes the gap from the primal and the dual bound */
1793 extern
1795  SCIP_Real eps, /**< the value treated as zero */
1796  SCIP_Real inf, /**< the value treated as infinity */
1797  SCIP_Real primalbound, /**< the primal bound */
1798  SCIP_Real dualbound /**< the dual bound */
1799  );
1800 
1801 /**@} */
1802 
1803 
1804 /*
1805  * Random Numbers
1806  */
1807 
1808 /**@defgroup RandomNumbers Random Numbers
1809  * @ingroup MiscellaneousMethods
1810  * @brief structures and methods for pseudo random number generation
1811  *
1812  *@{
1813  */
1814 
1815 /** returns a random integer between minrandval and maxrandval
1816  *
1817  * @deprecated Please use SCIPrandomGetInt() to request a random integer.
1818  */
1819 extern
1820 int SCIPgetRandomInt(
1821  int minrandval, /**< minimal value to return */
1822  int maxrandval, /**< maximal value to return */
1823  unsigned int* seedp /**< pointer to seed value */
1824  );
1825 
1826 
1827 /** returns a random integer between minrandval and maxrandval */
1828 extern
1829 int SCIPrandomGetInt(
1830  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1831  int minrandval, /**< minimal value to return */
1832  int maxrandval /**< maximal value to return */
1833  );
1834 
1835 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1836  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1837  */
1838 extern
1840  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1841  void** set, /**< original set, from which elements should be drawn */
1842  int nelems, /**< number of elements in original set */
1843  void** subset, /**< subset in which drawn elements should be stored */
1844  int nsubelems /**< number of elements that should be drawn and stored */
1845  );
1846 
1847 /** returns a random real between minrandval and maxrandval */
1848 extern
1850  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1851  SCIP_Real minrandval, /**< minimal value to return */
1852  SCIP_Real maxrandval /**< maximal value to return */
1853  );
1854 
1855 /** returns a random real between minrandval and maxrandval
1856  *
1857  * @deprecated Please use SCIPrandomGetReal() to request a random real.
1858  */
1859 extern
1861  SCIP_Real minrandval, /**< minimal value to return */
1862  SCIP_Real maxrandval, /**< maximal value to return */
1863  unsigned int* seedp /**< pointer to seed value */
1864  );
1865 
1866 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1867  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1868  *
1869  * @deprecated Please use SCIPrandomGetSubset()
1870  */
1871 extern
1873  void** set, /**< original set, from which elements should be drawn */
1874  int nelems, /**< number of elements in original set */
1875  void** subset, /**< subset in which drawn elements should be stored */
1876  int nsubelems, /**< number of elements that should be drawn and stored */
1877  unsigned int randseed /**< seed value for random generator */
1878  );
1879 
1880 
1881 /**@} */
1882 
1883 /*
1884  * Permutations / Shuffling
1885  */
1886 
1887 /**@defgroup PermutationsShuffling Permutations Shuffling
1888  * @ingroup MiscellaneousMethods
1889  * @brief methods for shuffling arrays
1890  *
1891  * @{
1892  */
1893 
1894 /** swaps two ints */
1895 extern
1896 void SCIPswapInts(
1897  int* value1, /**< pointer to first integer */
1898  int* value2 /**< pointer to second integer */
1899  );
1900 
1901 /** swaps two real values */
1902 extern
1903 void SCIPswapReals(
1904  SCIP_Real* value1, /**< pointer to first real value */
1905  SCIP_Real* value2 /**< pointer to second real value */
1906 );
1907 
1908 /** swaps the addresses of two pointers */
1909 extern
1910 void SCIPswapPointers(
1911  void** pointer1, /**< first pointer */
1912  void** pointer2 /**< second pointer */
1913  );
1914 
1915 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm
1916  *
1917  * @deprecated Please use SCIPrandomPermuteIntArray()
1918  */
1919 extern
1920 void SCIPpermuteIntArray(
1921  int* array, /**< array to be shuffled */
1922  int begin, /**< first included index that should be subject to shuffling
1923  * (0 for first array entry)
1924  */
1925  int end, /**< first excluded index that should not be subject to shuffling
1926  * (array size for last array entry)
1927  */
1928  unsigned int* randseed /**< seed value for the random generator */
1929  );
1930 
1931 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm */
1932 extern
1934  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1935  int* array, /**< array to be shuffled */
1936  int begin, /**< first included index that should be subject to shuffling
1937  * (0 for first array entry)
1938  */
1939  int end /**< first excluded index that should not be subject to shuffling
1940  * (array size for last array entry)
1941  */
1942  );
1943 
1944 /** randomly shuffles parts of an array using the Fisher-Yates algorithm */
1945 extern
1947  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1948  void** array, /**< array to be shuffled */
1949  int begin, /**< first included index that should be subject to shuffling
1950  * (0 for first array entry)
1951  */
1952  int end /**< first excluded index that should not be subject to shuffling
1953  * (array size for last array entry)
1954  */
1955  );
1956 
1957 /** randomly shuffles parts of an array using the Fisher-Yates algorithm
1958  *
1959  * @deprecated Please use SCIPrandomPermuteArray()
1960  */
1961 extern
1962 void SCIPpermuteArray(
1963  void** array, /**< array to be shuffled */
1964  int begin, /**< first included index that should be subject to shuffling
1965  * (0 for first array entry)
1966  */
1967  int end, /**< first excluded index that should not be subject to shuffling
1968  * (array size for last array entry)
1969  */
1970  unsigned int* randseed /**< pointer to seed value for the random generator */
1971  );
1972 
1973 /**@} */
1974 
1975 
1976 /*
1977  * Arrays
1978  */
1979 
1980 /**@defgroup Arrays Arrays
1981  * @ingroup MiscellaneousMethods
1982  * @brief miscellaneous methods for arrays
1983  *
1984  * @{
1985  */
1986 
1987 
1988 /** computes set intersection (duplicates removed) of two arrays that are ordered ascendingly */
1989 extern
1991  int* array1, /**< first array (in ascending order) */
1992  int narray1, /**< number of entries of first array */
1993  int* array2, /**< second array (in ascending order) */
1994  int narray2, /**< number of entries of second array */
1995  int* intersectarray, /**< intersection of array1 and array2
1996  * (note: it is possible to use array1 for this input argument) */
1997  int* nintersectarray /**< pointer to store number of entries of intersection array
1998  * (note: it is possible to use narray1 for this input argument) */
1999  );
2000 
2001 /** computes set difference (duplicates removed) of two arrays that are ordered ascendingly */
2002 extern
2004  int* array1, /**< first array (in ascending order) */
2005  int narray1, /**< number of entries of first array */
2006  int* array2, /**< second array (in ascending order) */
2007  int narray2, /**< number of entries of second array */
2008  int* setminusarray, /**< array to store entries of array1 that are not an entry of array2
2009  * (note: it is possible to use array1 for this input argument) */
2010  int* nsetminusarray /**< pointer to store number of entries of setminus array
2011  * (note: it is possible to use narray1 for this input argument) */
2012  );
2013 
2014 /**@} */
2015 
2016 
2017 /*
2018  * Strings
2019  */
2020 
2021 /**@defgroup StringMethods String Methods
2022  * @ingroup MiscellaneousMethods
2023  * @brief commonly used methods for strings
2024  *
2025  *@{
2026  */
2027 
2028 /** copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after
2029  * 'cnt' characters have been copied, whichever comes first.
2030  *
2031  * @note undefined behaviuor on overlapping arrays
2032  */
2033 extern
2034 int SCIPmemccpy(
2035  char* dest, /**< destination pointer to copy to */
2036  const char* src, /**< source pointer to copy to */
2037  char stop, /**< character when found stop copying */
2038  unsigned int cnt /**< maximal number of characters to copy too */
2039  );
2040 
2041 /** prints an error message containing of the given string followed by a string describing the current system error;
2042  * prefers to use the strerror_r method, which is threadsafe; on systems where this method does not exist,
2043  * NO_STRERROR_R should be defined (see INSTALL), in this case, srerror is used which is not guaranteed to be
2044  * threadsafe (on SUN-systems, it actually is)
2045  */
2046 extern
2047 void SCIPprintSysError(
2048  const char* message /**< first part of the error message, e.g. the filename */
2049  );
2050 
2051 /** extracts tokens from strings - wrapper method for strtok_r() */
2052 extern
2053 char* SCIPstrtok(
2054  char* s, /**< string to parse */
2055  const char* delim, /**< delimiters for parsing */
2056  char** ptrptr /**< pointer to working char pointer - must stay the same while parsing */
2057  );
2058 
2059 /** translates the given string into a string where symbols ", ', and spaces are escaped with a \ prefix */
2060 extern
2061 void SCIPescapeString(
2062  char* t, /**< target buffer to store escaped string */
2063  int bufsize, /**< size of buffer t */
2064  const char* s /**< string to transform into escaped string */
2065  );
2066 
2067 /** safe version of snprintf */
2068 extern
2069 int SCIPsnprintf(
2070  char* t, /**< target string */
2071  int len, /**< length of the string to copy */
2072  const char* s, /**< source string */
2073  ... /**< further parameters */
2074  );
2075 
2076 /** 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
2077  *
2078  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2079  */
2080 extern
2082  const char* str, /**< string to search */
2083  int* value, /**< pointer to store the parsed value */
2084  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2085  );
2086 
2087 /** 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
2088  *
2089  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2090  */
2091 extern
2093  const char* str, /**< string to search */
2094  SCIP_Real* value, /**< pointer to store the parsed value */
2095  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2096  );
2097 
2098 /** copies the first size characters between a start and end character of str into token, if no error occured endptr
2099  * will point to the position after the read part, otherwise it will point to @p str
2100  */
2101 extern
2102 void SCIPstrCopySection(
2103  const char* str, /**< string to search */
2104  char startchar, /**< character which defines the beginning */
2105  char endchar, /**< character which defines the ending */
2106  char* token, /**< string to store the copy */
2107  int size, /**< size of the token char array */
2108  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2109  );
2110 
2111 /**@} */
2112 
2113 /*
2114  * File methods
2115  */
2116 
2117 /**@defgroup FileMethods File Methods
2118  * @ingroup MiscellaneousMethods
2119  * @brief commonly used file methods
2120  *
2121  * @{
2122  */
2123 
2124 /** returns, whether the given file exists */
2125 extern
2127  const char* filename /**< file name */
2128  );
2129 
2130 /** splits filename into path, name, and extension */
2131 extern
2132 void SCIPsplitFilename(
2133  char* filename, /**< filename to split; is destroyed (but not freed) during process */
2134  char** path, /**< pointer to store path, or NULL if not needed */
2135  char** name, /**< pointer to store name, or NULL if not needed */
2136  char** extension, /**< pointer to store extension, or NULL if not needed */
2137  char** compression /**< pointer to store compression extension, or NULL if not needed */
2138  );
2139 
2140 /**@} */
2141 
2142 #ifdef __cplusplus
2143 }
2144 #endif
2145 
2146 #endif
void SCIPmultihashFree(SCIP_MULTIHASH **multihash)
Definition: misc.c:1712
void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
Definition: misc.c:9689
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
Definition: misc.c:8004
void ** SCIPdigraphGetSuccessorsData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7323
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
Definition: misc.c:1263
void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
Definition: misc.c:8068
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3172
SCIP_Real SCIPnormalGetCriticalValue(SCIP_CONFIDENCELEVEL clevel)
Definition: misc.c:171
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
Definition: misc.c:9895
SCIP_Real SCIPerf(SCIP_Real x)
Definition: misc.c:144
void SCIPhashmapEntrySetImageReal(SCIP_HASHMAPENTRY *entry, SCIP_Real image)
Definition: misc.c:3203
SCIP_RETCODE SCIPhashsetRemove(SCIP_HASHSET *hashset, void *element)
Definition: misc.c:3439
void SCIPdisjointsetUnion(SCIP_DISJOINTSET *djset, int p, int q, SCIP_Bool forcerepofp)
Definition: misc.c:10403
void * SCIPhashtableGetEntry(SCIP_HASHTABLE *hashtable, int entryidx)
Definition: misc.c:2503
void SCIPsparseSolGetFirstSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
Definition: misc.c:808
type definitions for miscellaneous datastructures
SCIP_BTNODE * SCIPbtnodeGetSibling(SCIP_BTNODE *node)
Definition: misc.c:8153
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int height)
Definition: misc.c:6566
void * SCIPbtnodeGetData(SCIP_BTNODE *node)
Definition: misc.c:8113
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2265
SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString)
Definition: misc.c:2569
void SCIPdigraphFreeComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7845
int SCIPhashsetGetNElements(SCIP_HASHSET *hashset)
Definition: misc.c:3573
void ** SCIPhashsetGetSlots(SCIP_HASHSET *hashset)
Definition: misc.c:3589
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:627
SCIP_RETCODE SCIPdigraphComputeUndirectedComponents(SCIP_DIGRAPH *digraph, int minsize, int *components, int *ncomponents)
Definition: misc.c:7417
int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7305
SCIP_RETCODE SCIPqueueInsert(SCIP_QUEUE *queue, void *elem)
Definition: misc.c:978
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
Definition: misc.c:485
void SCIPsplitFilename(char *filename, char **path, char **name, char **extension, char **compression)
Definition: misc.c:10200
#define INLINE
Definition: def.h:96
void * SCIPhashmapEntryGetOrigin(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3162
SCIP_Bool SCIPsparseSolGetNextSol(SCIP_SPARSESOL *sparsesol, SCIP_Longint *sol, int nvars)
Definition: misc.c:831
int SCIPprofileGetTime(SCIP_PROFILE *profile, int pos)
Definition: misc.c:6363
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:1679
void SCIPgmlWriteClosing(FILE *file)
Definition: misc.c:687
void SCIPswapPointers(void **pointer1, void **pointer2)
Definition: misc.c:9639
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
Definition: misc.c:8274
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
Definition: misc.c:2793
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
Definition: misc.c:10289
int SCIPprofileGetEarliestFeasibleStart(SCIP_PROFILE *profile, int est, int lst, int duration, int height, SCIP_Bool *infeasible)
Definition: misc.c:6656
miscellaneous datastructures
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10011
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randgen, void **array, int begin, int end)
Definition: misc.c:9437
SCIP_RETCODE SCIPhashsetCreate(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size)
Definition: misc.c:3340
enum SCIP_Retcode SCIP_RETCODE
Definition: type_retcode.h:53
SCIP_RETCODE SCIPdigraphSetSizes(SCIP_DIGRAPH *digraph, int *sizes)
Definition: misc.c:7040
void SCIPdigraphPrintComponents(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:7951
SCIP_VAR * SCIPactivityGetVar(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6202
void * SCIPpqueueFirst(SCIP_PQUEUE *pqueue)
Definition: misc.c:1249
SCIPInterval exp(const SCIPInterval &x)
SCIP_Bool SCIPhashsetExists(SCIP_HASHSET *hashset, void *element)
Definition: misc.c:3398
SCIP_Real SCIPregressionGetIntercept(SCIP_REGRESSION *regression)
Definition: misc.c:262
void SCIPhashtableClear(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2116
SCIP_RETCODE SCIPcomputeArraysIntersection(int *array1, int narray1, int *array2, int narray2, int *intersectarray, int *nintersectarray)
Definition: misc.c:9782
void SCIPregressionAddObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
Definition: misc.c:369
void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
Definition: misc.c:9626
int SCIPdigraphGetNComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7612
SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
Definition: misc.c:10051
void SCIPpqueueFree(SCIP_PQUEUE **pqueue)
Definition: misc.c:1160
SCIP_RETCODE SCIPprofileInsertCore(SCIP_PROFILE *profile, int left, int right, int height, int *pos, SCIP_Bool *infeasible)
Definition: misc.c:6536
type definitions for return codes for SCIP methods
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randgen, int minrandval, int maxrandval)
Definition: misc.c:9366
SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)
Definition: misc.c:9126
void SCIPdigraphGetComponent(SCIP_DIGRAPH *digraph, int compidx, int **nodes, int *nnodes)
Definition: misc.c:7625
SCIP_Bool SCIPhashmapIsEmpty(SCIP_HASHMAP *hashmap)
Definition: misc.c:3125
int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
Definition: misc.c:10484
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2931
SCIP_Bool SCIPqueueIsEmpty(SCIP_QUEUE *queue)
Definition: misc.c:1074
int SCIPprofileGetLoad(SCIP_PROFILE *profile, int pos)
Definition: misc.c:6375
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2950
int SCIPhashsetGetNSlots(SCIP_HASHSET *hashset)
Definition: misc.c:3581
SCIP_RETCODE SCIPdigraphTopoSortComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7546
SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
Definition: misc.c:8173
real eps
void SCIPmultihashRemoveAll(SCIP_MULTIHASH *multihash)
Definition: misc.c:1929
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:2014
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3025
SCIP_Longint SCIPmultihashGetNElements(SCIP_MULTIHASH *multihash)
Definition: misc.c:1950
SCIP_Bool SCIPhashsetIsEmpty(SCIP_HASHSET *hashset)
Definition: misc.c:3565
SCIP_Bool SCIPfileExists(const char *filename)
Definition: misc.c:10184
void SCIPqueueClear(SCIP_QUEUE *queue)
Definition: misc.c:967
int SCIPdigraphGetNNodes(SCIP_DIGRAPH *digraph)
Definition: misc.c:7232
int SCIPprofileGetCapacity(SCIP_PROFILE *profile)
Definition: misc.c:6323
SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
Definition: misc.c:8721
SCIP_RETCODE SCIPactivityCreate(SCIP_RESOURCEACTIVITY **activity, SCIP_VAR *var, int duration, int demand)
Definition: misc.c:6157
void SCIPregressionRemoveObservation(SCIP_REGRESSION *regression, SCIP_Real x, SCIP_Real y)
Definition: misc.c:337
SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString)
Definition: misc.c:2560
void SCIPhashsetRemoveAll(SCIP_HASHSET *hashset)
Definition: misc.c:3597
void SCIPdisjointsetClear(SCIP_DISJOINTSET *djset)
Definition: misc.c:10359
enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL
Definition: type_misc.h:44
SCIP_Longint * SCIPsparseSolGetLbs(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:788
int SCIPqueueNElems(SCIP_QUEUE *queue)
Definition: misc.c:1087
SCIP_Bool SCIPmultihashExists(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1868
SCIP_BTNODE * SCIPbtnodeGetParent(SCIP_BTNODE *node)
Definition: misc.c:8123
SCIP_RETCODE SCIPdigraphSetNSuccessors(SCIP_DIGRAPH *digraph, int node, int nsuccessors)
Definition: misc.c:7216
void SCIPhashmapPrintStatistics(SCIP_HASHMAP *hashmap, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:3087
int SCIPactivityGetEnergy(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6232
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
Definition: misc.c:3143
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
Definition: misc.c:3151
void SCIPbtnodeSetLeftchild(SCIP_BTNODE *node, SCIP_BTNODE *left)
Definition: misc.c:8260
void * SCIPdigraphGetNodeData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7242
void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
Definition: misc.c:3371
static INLINE uint32_t SCIPrealHashCode(double x)
Definition: pub_misc.h:489
void SCIPdigraphSetNodeData(SCIP_DIGRAPH *digraph, void *dataptr, int node)
Definition: misc.c:7258
void SCIPescapeString(char *t, int bufsize, const char *s)
Definition: misc.c:9983
void SCIPhashmapEntrySetImage(SCIP_HASHMAPENTRY *entry, void *image)
Definition: misc.c:3192
void SCIPstrCopySection(const char *str, char startchar, char endchar, char *token, int size, char **endptr)
Definition: misc.c:10112
SCIP_RETCODE SCIPmultihashSafeInsert(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1784
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
Definition: misc.c:2826
void SCIPdigraphPrint(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:7877
void SCIPactivityFree(SCIP_RESOURCEACTIVITY **activity)
Definition: misc.c:6176
int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
Definition: misc.c:10376
void SCIPgmlWriteEdge(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
Definition: misc.c:583
void SCIPhashtableRemoveAll(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2473
type definitions for problem variables
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2395
SCIP_RETCODE SCIPprofileCreate(SCIP_PROFILE **profile, int capacity)
Definition: misc.c:6271
void SCIPqueueFree(SCIP_QUEUE **queue)
Definition: misc.c:956
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7154
SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
Definition: misc.c:8211
SCIP_Real SCIPmultihashGetLoad(SCIP_MULTIHASH *multihash)
Definition: misc.c:1960
void * SCIPpqueueRemove(SCIP_PQUEUE *pqueue)
Definition: misc.c:1208
int SCIPdisjointsetGetComponentCount(SCIP_DISJOINTSET *djset)
Definition: misc.c:10474
SCIP_RETCODE SCIPgetRandomSubset(void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
Definition: misc.c:9723
SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
Definition: misc.c:8396
SCIP_RETCODE SCIPhashmapInsertReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
Definition: misc.c:2904
void SCIPregressionFree(SCIP_REGRESSION **regression)
Definition: misc.c:420
SCIP_RETCODE SCIPcomputeArraysSetminus(int *array1, int narray1, int *array2, int narray2, int *setminusarray, int *nsetminusarray)
Definition: misc.c:9838
SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard)
Definition: misc.c:2588
void SCIPhashtablePrintStatistics(SCIP_HASHTABLE *hashtable, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:2522
SCIP_BTNODE * SCIPbtnodeGetRightchild(SCIP_BTNODE *node)
Definition: misc.c:8143
SCIP_RETCODE SCIPdigraphAddArcSafe(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7182
int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7290
#define SCIP_Bool
Definition: def.h:61
SCIP_Longint * SCIPsparseSolGetUbs(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:798
void SCIPprintSysError(const char *message)
Definition: misc.c:9920
SCIP_RETCODE SCIPsparseSolCreate(SCIP_SPARSESOL **sparsesol, SCIP_VAR **vars, int nvars, SCIP_Bool cleared)
Definition: misc.c:702
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
Definition: misc.c:3214
SCIP_RETCODE SCIPmultihashInsert(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1743
SCIP_Bool SCIPprofileFindLeft(SCIP_PROFILE *profile, int timepoint, int *pos)
Definition: misc.c:6389
SCIP_RETCODE SCIPdigraphResize(SCIP_DIGRAPH *digraph, int nnodes)
Definition: misc.c:6926
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randgen, int *array, int begin, int end)
Definition: misc.c:9407
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10082
int SCIPdigraphGetNArcs(SCIP_DIGRAPH *digraph)
Definition: misc.c:7272
void SCIPbtFree(SCIP_BT **tree)
Definition: misc.c:8304
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2297
SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8193
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
Definition: misc.c:8691
static const unsigned int randseed
Definition: circle.c:46
SCIP_RETCODE SCIPdigraphComputeDirectedComponents(SCIP_DIGRAPH *digraph, int compidx, int *strongcomponents, int *strongcompstartidx, int *nstrongcomponents)
Definition: misc.c:7757
void * SCIPmultihashRetrieveNext(SCIP_MULTIHASH *multihash, SCIP_MULTIHASHLIST **multihashlist, void *key)
Definition: misc.c:1832
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
void ** SCIPpqueueElems(SCIP_PQUEUE *pqueue)
Definition: misc.c:1274
void SCIPprofilePrint(SCIP_PROFILE *profile, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:6301
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_Bool SCIPfindSimpleRational(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
Definition: misc.c:9085
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:2326
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6343
SCIP_VAR ** SCIPsparseSolGetVars(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:768
SCIP_Real SCIPrandomGetReal(SCIP_RANDNUMGEN *randgen, SCIP_Real minrandval, SCIP_Real maxrandval)
Definition: misc.c:9388
int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
Definition: misc.c:6353
int SCIPgetRandomInt(int minrandval, int maxrandval, unsigned int *seedp)
Definition: misc.c:9249
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
Definition: misc.c:2064
SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
Definition: misc.c:8386
SCIP_Real SCIPgetRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
Definition: misc.c:9262
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8133
methods for sorting joint arrays of various types
int SCIPsparseSolGetNVars(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:778
void SCIPbtSetRoot(SCIP_BT *tree, SCIP_BTNODE *root)
Definition: misc.c:8409
SCIP_RETCODE SCIPhashmapSetImageReal(SCIP_HASHMAP *hashmap, void *origin, SCIP_Real image)
Definition: misc.c:2999
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:3041
void SCIPbtnodeSetParent(SCIP_BTNODE *node, SCIP_BTNODE *parent)
Definition: misc.c:8246
int SCIPhashmapGetNElements(SCIP_HASHMAP *hashmap)
Definition: misc.c:3135
SCIP_Real SCIPstudentTGetCriticalValue(SCIP_CONFIDENCELEVEL clevel, int df)
Definition: misc.c:94
SCIP_RETCODE SCIPqueueCreate(SCIP_QUEUE **queue, int initsize, SCIP_Real sizefac)
Definition: misc.c:932
SCIP_RETCODE SCIPpqueueInsert(SCIP_PQUEUE *pqueue, void *elem)
Definition: misc.c:1181
SCIP_Real SCIPcalcMachineEpsilon(void)
Definition: misc.c:8425
SCIP_RETCODE SCIPpqueueCreate(SCIP_PQUEUE **pqueue, int initsize, SCIP_Real sizefac, SCIP_DECL_SORTPTRCOMP((*ptrcomp)))
Definition: misc.c:1135
SCIP_Real SCIPhashmapEntryGetImageReal(SCIP_HASHMAPENTRY *entry)
Definition: misc.c:3182
#define SCIP_DECL_SORTPTRCOMP(x)
Definition: type_misc.h:163
void * SCIPmultihashRetrieve(SCIP_MULTIHASH *multihash, void *key)
Definition: misc.c:1803
SCIP_Real SCIPnormalCDF(SCIP_Real mean, SCIP_Real variance, SCIP_Real value)
Definition: misc.c:184
SCIP_Real SCIPregressionGetSlope(SCIP_REGRESSION *regression)
Definition: misc.c:252
int SCIPactivityGetDuration(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6212
void SCIPhashsetPrintStatistics(SCIP_HASHSET *hashset, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:3514
SCIP_RETCODE SCIPhashsetInsert(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element)
Definition: misc.c:3381
SCIP_RETCODE SCIPhashmapSetImage(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2971
#define SCIP_Real
Definition: def.h:149
void SCIPmultihashPrintStatistics(SCIP_MULTIHASH *multihash, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:1970
void SCIPpermuteIntArray(int *array, int begin, int end, unsigned int *randseed)
Definition: misc.c:9655
SCIP_RETCODE SCIPrandomGetSubset(SCIP_RANDNUMGEN *randgen, void **set, int nelems, void **subset, int nsubelems)
Definition: misc.c:9469
SCIP_Longint SCIPcalcBinomCoef(int n, int m)
Definition: misc.c:9530
int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2495
#define SCIP_Longint
Definition: def.h:134
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:8881
void SCIPregressionReset(SCIP_REGRESSION *regression)
Definition: misc.c:388
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2377
void * SCIPqueueRemove(SCIP_QUEUE *queue)
Definition: misc.c:1022
type definitions for message output methods
SCIP_RETCODE SCIPmultihashRemove(SCIP_MULTIHASH *multihash, void *element)
Definition: misc.c:1895
#define nnodes
Definition: gastrans.c:65
int SCIPprofileGetLatestFeasibleStart(SCIP_PROFILE *profile, int lb, int ub, int duration, int height, SCIP_Bool *infeasible)
Definition: misc.c:6806
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
Definition: misc.c:671
int SCIPcalcMultihashSize(int minsize)
Definition: misc.c:1356
SCIP_RETCODE SCIPregressionCreate(SCIP_REGRESSION **regression)
Definition: misc.c:404
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
Definition: misc.c:2874
SCIP_Real SCIPhashtableGetLoad(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2512
common defines and data types used in all packages of SCIP
void * SCIPqueueFirst(SCIP_QUEUE *queue)
Definition: misc.c:1056
void SCIPswapInts(int *value1, int *value2)
Definition: misc.c:9613
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
Definition: misc.c:8285
int SCIPactivityGetDemand(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6222
void SCIPbtnodeSetData(SCIP_BTNODE *node, void *dataptr)
Definition: misc.c:8232
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
Definition: misc.c:7064
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6333
void SCIPpqueueClear(SCIP_PQUEUE *pqueue)
Definition: misc.c:1171
int SCIPregressionGetNObservations(SCIP_REGRESSION *regression)
Definition: misc.c:242
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
Definition: misc.c:9969
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8448
void SCIPdigraphPrintGml(SCIP_DIGRAPH *digraph, FILE *file)
Definition: misc.c:7912
void SCIPbtPrintGml(SCIP_BT *tree, FILE *file)
Definition: misc.c:8356
SCIP_Longint SCIPhashtableGetNElements(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2485
SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8700
SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
Definition: misc.c:8183
void SCIPsparseSolFree(SCIP_SPARSESOL **sparsesol)
Definition: misc.c:754
SCIP_Real SCIPcomputeGap(SCIP_Real eps, SCIP_Real inf, SCIP_Real primalbound, SCIP_Real dualbound)
Definition: misc.c:10307
void SCIPprofileFree(SCIP_PROFILE **profile)
Definition: misc.c:6285
methods for selecting (weighted) k-medians
memory allocation routines