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 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 */
76 extern
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  */
88 extern
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 */
99 extern
101  SCIP_Real x /**< value to evaluate */
102  );
103 
104 /** get critical value of a standard normal distribution at a given confidence level */
105 extern
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  */
116 extern
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 */
135 extern
137  SCIP_REGRESSION* regression /**< regression data structure */
138  );
139 
140 /** return the current slope of the regression */
141 extern
143  SCIP_REGRESSION* regression /**< regression data structure */
144  );
145 
146 /** get the current y-intercept of the regression */
147 extern
149  SCIP_REGRESSION* regression /**< regression data structure */
150  );
151 
152 /** removes an observation (x,y) from the regression */
153 extern
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) */
161 extern
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 */
169 extern
171  SCIP_REGRESSION* regression /**< regression data structure */
172  );
173 
174 /** creates and resets a regression */
175 extern
177  SCIP_REGRESSION** regression /**< regression data structure */
178  );
179 
180 /** frees a regression */
181 extern
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 */
202 extern
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 */
213 extern
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 */
225 extern
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 */
235 extern
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 */
245 extern
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 */
252 extern
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 */
271 extern
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 */
280 extern
281 void SCIPsparseSolFree(
282  SCIP_SPARSESOL** sparsesol /**< pointer to a sparse solution */
283  );
284 
285 /** returns the variables in the given sparse solution */
286 extern
288  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
289  );
290 
291 /** returns the number of variables in the given sparse solution */
292 extern
294  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
295  );
296 
297 /** returns the the lower bound array for all variables for a given sparse solution */
298 extern
300  SCIP_SPARSESOL* sparsesol /**< a sparse solution */
301  );
302 
303 /** returns the the upper bound array for all variables for a given sparse solution */
304 extern
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 */
310 extern
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 */
318 extern
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 */
341 extern
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 */
350 extern
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 */
356 extern
357 void SCIPqueueClear(
358  SCIP_QUEUE* queue /**< queue */
359  );
360 
361 /** inserts element at the end of the queue */
362 extern
364  SCIP_QUEUE* queue, /**< queue */
365  void* elem /**< element to be inserted */
366  );
367 
368 /** removes and returns the first element of the queue */
369 extern
370 void* SCIPqueueRemove(
371  SCIP_QUEUE* queue /**< queue */
372  );
373 
374 /** returns the first element of the queue without removing it */
375 extern
376 void* SCIPqueueFirst(
377  SCIP_QUEUE* queue /**< queue */
378  );
379 
380 /** returns whether the queue is empty */
381 extern
383  SCIP_QUEUE* queue /**< queue */
384  );
385 
386 /** returns the number of elements in the queue */
387 extern
388 int SCIPqueueNElems(
389  SCIP_QUEUE* queue /**< queue */
390  );
391 
392 /**@} */
393 
394 /*
395  * Priority Queue
396  */
397 
398 /**@defgroup PriorityQueue Priority Queue
399  * @ingroup DataStructures
400  * @brief priority queue with O(1) access to the minimum element
401  *
402  * @{
403  */
404 
405 /** creates priority queue */
406 extern
408  SCIP_PQUEUE** pqueue, /**< pointer to a priority queue */
409  int initsize, /**< initial number of available element slots */
410  SCIP_Real sizefac, /**< memory growing factor applied, if more element slots are needed */
411  SCIP_DECL_SORTPTRCOMP((*ptrcomp)) /**< data element comparator */
412  );
413 
414 /** frees priority queue, but not the data elements themselves */
415 extern
416 void SCIPpqueueFree(
417  SCIP_PQUEUE** pqueue /**< pointer to a priority queue */
418  );
419 
420 /** clears the priority queue, but doesn't free the data elements themselves */
421 extern
422 void SCIPpqueueClear(
423  SCIP_PQUEUE* pqueue /**< priority queue */
424  );
425 
426 /** inserts element into priority queue */
427 extern
429  SCIP_PQUEUE* pqueue, /**< priority queue */
430  void* elem /**< element to be inserted */
431  );
432 
433 /** removes and returns best element from the priority queue */
434 extern
435 void* SCIPpqueueRemove(
436  SCIP_PQUEUE* pqueue /**< priority queue */
437  );
438 
439 /** returns the best element of the queue without removing it */
440 extern
441 void* SCIPpqueueFirst(
442  SCIP_PQUEUE* pqueue /**< priority queue */
443  );
444 
445 /** returns the number of elements in the queue */
446 extern
447 int SCIPpqueueNElems(
448  SCIP_PQUEUE* pqueue /**< priority queue */
449  );
450 
451 /** returns the elements of the queue; changing the returned array may destroy the queue's ordering! */
452 extern
453 void** SCIPpqueueElems(
454  SCIP_PQUEUE* pqueue /**< priority queue */
455  );
456 
457 /**@} */
458 
459 
460 /*
461  * Hash Table
462  */
463 
464 /**@defgroup HashTable Hash Table
465  * @ingroup DataStructures
466  * @brief hash table that resolves conflicts by probing
467  *
468  *@{
469  */
470 
471 /* fast 2-universal hash functions for two and four elements */
472 
473 #define SCIPhashSignature64(a) (UINT64_C(0x8000000000000000)>>((UINT32_C(0x9e3779b9) * ((uint32_t)(a)))>>26))
474 #define SCIPhashTwo(a, b) ((uint32_t)((((uint64_t)(a) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) )>>32))
475 
476 #define SCIPhashFour(a, b, c, d) ((uint32_t)((((uint64_t)(a) + 0xbd5c89185f082658ULL) * ((uint64_t)(b) + 0xe5fcc163aef32782ULL) + \
477  ((uint64_t)(c) + 0xd37e9a1ce2148403ULL) * ((uint64_t)(d) + 0x926f2d4dc4a67218ULL))>>32 ))
478 
479 /* helpers to use above hashfuncions */
480 #define SCIPcombineTwoInt(a, b) (((uint64_t) (a) << 32) | (uint64_t) (b) )
481 
482 #define SCIPcombineThreeInt(a, b, c) (((uint64_t) (a) << 43) + ((uint64_t) (b) << 21) + ((uint64_t) (c)) )
483 
484 #define SCIPcombineFourInt(a, b, c, d) (((uint64_t) (a) << 48) + ((uint64_t) (b) << 32) + ((uint64_t) (c) << 16) + ((uint64_t) (d)) )
485 
486 /** computes a hashcode for double precision floating point values containing
487  * 15 significant bits, the sign and the exponent
488  */
489 INLINE static
490 uint32_t SCIPrealHashCode(double x)
491 {
492  int theexp;
493  return (((uint32_t)(uint16_t)(int16_t)ldexp(frexp(x, &theexp), 15))<<16) | (uint32_t)(uint16_t)theexp;
494 }
495 
496 /** creates a hash table */
497 extern
499  SCIP_HASHTABLE** hashtable, /**< pointer to store the created hash table */
500  BMS_BLKMEM* blkmem, /**< block memory used to store hash table entries */
501  int tablesize, /**< size of the hash table */
502  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
503  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
504  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
505  void* userptr /**< user pointer */
506  );
507 
508 /** frees the hash table */
509 extern
510 void SCIPhashtableFree(
511  SCIP_HASHTABLE** hashtable /**< pointer to the hash table */
512  );
513 
514 /** removes all elements of the hash table
515  *
516  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
517  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
518  *
519  * @deprecated Please use SCIPhashtableRemoveAll()
520  */
521 extern
522 void SCIPhashtableClear(
523  SCIP_HASHTABLE* hashtable /**< hash table */
524  );
525 
526 /** inserts element in hash table (multiple inserts of same element override the previous entry) */
527 extern
529  SCIP_HASHTABLE* hashtable, /**< hash table */
530  void* element /**< element to insert into the table */
531  );
532 
533 /** inserts element in hash table (multiple insertion of same element is checked and results in an error) */
534 extern
536  SCIP_HASHTABLE* hashtable, /**< hash table */
537  void* element /**< element to insert into the table */
538  );
539 
540 /** retrieve element with key from hash table, returns NULL if not existing */
541 extern
543  SCIP_HASHTABLE* hashtable, /**< hash table */
544  void* key /**< key to retrieve */
545  );
546 
547 /** returns whether the given element exists in the table */
548 extern
550  SCIP_HASHTABLE* hashtable, /**< hash table */
551  void* element /**< element to search in the table */
552  );
553 
554 /** removes element from the hash table, if it exists */
555 extern
557  SCIP_HASHTABLE* hashtable, /**< hash table */
558  void* element /**< element to remove from the table */
559  );
560 
561 /** removes all elements of the hash table */
562 extern
564  SCIP_HASHTABLE* hashtable /**< hash table */
565  );
566 
567 /** returns number of hash table elements */
568 extern
570  SCIP_HASHTABLE* hashtable /**< hash table */
571  );
572 
573 /** gives the number of entries in the internal arrays of a hash table */
574 extern
576  SCIP_HASHTABLE* hashtable /**< hash table */
577  );
578 
579 /** gives the element at the given index or NULL if entry at that index has no element */
580 extern
582  SCIP_HASHTABLE* hashtable, /**< hash table */
583  int entryidx /**< index of hash table entry */
584  );
585 
586 /** returns the load of the given hash table in percentage */
587 extern
589  SCIP_HASHTABLE* hashtable /**< hash table */
590  );
591 
592 /** prints statistics about hash table usage */
593 extern
595  SCIP_HASHTABLE* hashtable, /**< hash table */
596  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
597  );
598 
599 /**@} */
600 
601 /*
602  * MultiHash Table
603  */
604 
605 /**@defgroup MultiHash Multi Hash table
606  * @ingroup DataStructures
607  * @brief hash table that resolves conflicts by queueing, thereby allowing for duplicate entries
608  *
609  *@{
610  */
611 
612 /** returns a reasonable hash table size (a prime number) that is at least as large as the specified value */
613 extern
615  int minsize /**< minimal size of the hash table */
616  );
617 
618 /** creates a multihash table */
619 extern
621  SCIP_MULTIHASH** multihash, /**< pointer to store the created multihash table */
622  BMS_BLKMEM* blkmem, /**< block memory used to store multihash table entries */
623  int tablesize, /**< size of the hash table */
624  SCIP_DECL_HASHGETKEY((*hashgetkey)), /**< gets the key of the given element */
625  SCIP_DECL_HASHKEYEQ ((*hashkeyeq)), /**< returns TRUE iff both keys are equal */
626  SCIP_DECL_HASHKEYVAL((*hashkeyval)), /**< returns the hash value of the key */
627  void* userptr /**< user pointer */
628  );
629 
630 /** frees the multihash table */
631 extern
632 void SCIPmultihashFree(
633  SCIP_MULTIHASH** multihash /**< pointer to the multihash table */
634  );
635 
636 /** inserts element in multihash table (multiple inserts of same element possible)
637  *
638  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding an element
639  * to the hash table, due to dynamic resizing.
640  */
641 extern
643  SCIP_MULTIHASH* multihash, /**< multihash table */
644  void* element /**< element to insert into the table */
645  );
646 
647 /** inserts element in multihash table (multiple insertion of same element is checked and results in an error)
648  *
649  * @note A pointer to a multihashlist returned by SCIPmultihashRetrieveNext() might get invalid when adding a new
650  * element to the multihash table, due to dynamic resizing.
651  */
652 extern
654  SCIP_MULTIHASH* multihash, /**< multihash table */
655  void* element /**< element to insert into the table */
656  );
657 
658 /** retrieve element with key from multihash table, returns NULL if not existing */
659 extern
661  SCIP_MULTIHASH* multihash, /**< multihash table */
662  void* key /**< key to retrieve */
663  );
664 
665 /** retrieve element with key from multihash table, returns NULL if not existing
666  * can be used to retrieve all entries with the same key (one-by-one)
667  *
668  * @note The returned multimultihashlist pointer might get invalid when adding a new element to the multihash table.
669  */
670 extern
672  SCIP_MULTIHASH* multihash, /**< multihash table */
673  SCIP_MULTIHASHLIST** multihashlist, /**< input: entry in hash table list from which to start searching, or NULL
674  * output: entry in hash table list corresponding to element after
675  * retrieved one, or NULL */
676  void* key /**< key to retrieve */
677  );
678 
679 /** returns whether the given element exists in the multihash table */
680 extern
682  SCIP_MULTIHASH* multihash, /**< multihash table */
683  void* element /**< element to search in the table */
684  );
685 
686 /** removes element from the multihash table, if it exists */
687 extern
689  SCIP_MULTIHASH* multihash, /**< multihash table */
690  void* element /**< element to remove from the table */
691  );
692 
693 /** removes all elements of the multihash table
694  *
695  * @note From a performance point of view you should not fill and clear a hash table too often since the clearing can
696  * be expensive. Clearing is done by looping over all buckets and removing the hash table lists one-by-one.
697  */
698 extern
700  SCIP_MULTIHASH* multihash /**< multihash table */
701  );
702 
703 /** returns number of multihash table elements */
704 extern
706  SCIP_MULTIHASH* multihash /**< multihash table */
707  );
708 
709 /** returns the load of the given multihash table in percentage */
710 extern
712  SCIP_MULTIHASH* multihash /**< multihash table */
713  );
714 
715 /** prints statistics about multihash table usage */
716 extern
718  SCIP_MULTIHASH* multihash, /**< multihash table */
719  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
720  );
721 
722 /** standard hash key comparator for string keys */
723 extern
724 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqString);
725 
726 /** standard hashing function for string keys */
727 extern
728 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString);
729 
730 /** gets the element as the key */
731 extern
732 SCIP_DECL_HASHGETKEY(SCIPhashGetKeyStandard);
733 
734 /** returns TRUE iff both keys(pointer) are equal */
735 extern
736 SCIP_DECL_HASHKEYEQ(SCIPhashKeyEqPtr);
737 
738 /** returns the hash value of the key */
739 extern
740 SCIP_DECL_HASHKEYVAL(SCIPhashKeyValPtr);
741 
742 /**@} */
743 
744 
745 /*
746  * Hash Map
747  */
748 
749 /**@defgroup HashMap Hash Map
750  * @ingroup DataStructures
751  * @brief hash map to store key-value pairs (called \p origin and \p image)
752  *
753  * @{
754  */
755 
756 /** creates a hash map mapping pointers to pointers */
757 extern
759  SCIP_HASHMAP** hashmap, /**< pointer to store the created hash map */
760  BMS_BLKMEM* blkmem, /**< block memory used to store hash map entries */
761  int mapsize /**< size of the hash map */
762  );
763 
764 /** frees the hash map */
765 extern
766 void SCIPhashmapFree(
767  SCIP_HASHMAP** hashmap /**< pointer to the hash map */
768  );
769 
770 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
771 extern
773  SCIP_HASHMAP* hashmap, /**< hash map */
774  void* origin, /**< origin to set image for */
775  void* image /**< new image for origin */
776  );
777 
778 /** inserts new origin->image pair in hash map (must not be called for already existing origins!) */
779 extern
781  SCIP_HASHMAP* hashmap, /**< hash map */
782  void* origin, /**< origin to set image for */
783  SCIP_Real image /**< new image for origin */
784  );
785 
786 /** retrieves image of given origin from the hash map, or NULL if no image exists */
787 extern
788 void* SCIPhashmapGetImage(
789  SCIP_HASHMAP* hashmap, /**< hash map */
790  void* origin /**< origin to retrieve image for */
791  );
792 
793 /** retrieves image of given origin from the hash map, or NULL if no image exists */
794 extern
796  SCIP_HASHMAP* hashmap, /**< hash map */
797  void* origin /**< origin to retrieve image for */
798  );
799 
800 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
801  * new origin->image pair
802  */
803 extern
805  SCIP_HASHMAP* hashmap, /**< hash map */
806  void* origin, /**< origin to set image for */
807  void* image /**< new image for origin */
808  );
809 
810 /** sets image for given origin in the hash map, either by modifying existing origin->image pair or by appending a
811  * new origin->image pair
812  */
813 extern
815  SCIP_HASHMAP* hashmap, /**< hash map */
816  void* origin, /**< origin to set image for */
817  SCIP_Real image /**< new image for origin */
818  );
819 
820 /** checks whether an image to the given origin exists in the hash map */
821 extern
823  SCIP_HASHMAP* hashmap, /**< hash map */
824  void* origin /**< origin to search for */
825  );
826 
827 /** removes origin->image pair from the hash map, if it exists */
828 extern
830  SCIP_HASHMAP* hashmap, /**< hash map */
831  void* origin /**< origin to remove from the list */
832  );
833 
834 /** prints statistics about hash map usage */
835 extern
837  SCIP_HASHMAP* hashmap, /**< hash map */
838  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
839  );
840 
841 /** indicates whether a hash map has no entries */
842 extern
844  SCIP_HASHMAP* hashmap /**< hash map */
845  );
846 
847 /** gives the number of elements in a hash map */
848 extern
850  SCIP_HASHMAP* hashmap /**< hash map */
851  );
852 
853 /** gives the number of entries in the internal arrays of a hash map */
854 extern
856  SCIP_HASHMAP* hashmap /**< hash map */
857  );
858 
859 /** gives the hashmap entry at the given index or NULL if entry has no element */
860 extern
862  SCIP_HASHMAP* hashmap, /**< hash map */
863  int entryidx /**< index of hash map entry */
864  );
865 
866 /** gives the origin of the hashmap entry */
867 extern
869  SCIP_HASHMAPENTRY* entry /**< hash map entry */
870  );
871 
872 /** gives the image of the hashmap entry */
873 extern
875  SCIP_HASHMAPENTRY* entry /**< hash map entry */
876  );
877 
878 /** gives the image of the hashmap entry */
879 extern
881  SCIP_HASHMAPENTRY* entry /**< hash map entry */
882  );
883 
884 /** sets pointer image of a hashmap entry */
885 extern
887  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
888  void* image /**< new image */
889  );
890 
891 /** sets real image of a hashmap entry */
892 extern
894  SCIP_HASHMAPENTRY* entry, /**< hash map entry */
895  SCIP_Real image /**< new image */
896  );
897 
898 /** removes all entries in a hash map. */
899 extern
901  SCIP_HASHMAP* hashmap /**< hash map */
902  );
903 
904 /**@} */
905 
906 
907 /*
908  * Hash Set
909  */
910 
911 /**@defgroup HashSet Hash Set
912  * @ingroup DataStructures
913  * @brief very lightweight hash set of pointers
914  *
915  * @{
916  */
917 
918 /** creates a hash set of pointers */
919 extern
921  SCIP_HASHSET** hashset, /**< pointer to store the created hash set */
922  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
923  int size /**< initial size of the hash set; it is guaranteed that the set is not
924  * resized if at most that many elements are inserted */
925  );
926 
927 /** frees the hash set */
928 extern
929 void SCIPhashsetFree(
930  SCIP_HASHSET** hashset, /**< pointer to the hash set */
931  BMS_BLKMEM* blkmem /**< block memory used to store hash set entries */
932  );
933 
934 /** inserts new element into the hash set */
935 extern
937  SCIP_HASHSET* hashset, /**< hash set */
938  BMS_BLKMEM* blkmem, /**< block memory used to store hash set entries */
939  void* element /**< element to insert */
940  );
941 
942 /** checks whether an element exists in the hash set */
943 extern
945  SCIP_HASHSET* hashset, /**< hash set */
946  void* element /**< element to search for */
947  );
948 
949 /** removes an element from the hash set, if it exists */
950 extern
952  SCIP_HASHSET* hashset, /**< hash set */
953  void* element /**< origin to remove from the list */
954  );
955 
956 /** prints statistics about hash set usage */
957 extern
959  SCIP_HASHSET* hashset, /**< hash set */
960  SCIP_MESSAGEHDLR* messagehdlr /**< message handler */
961  );
962 
963 /** indicates whether a hash set has no entries */
964 extern
966  SCIP_HASHSET* hashset /**< hash set */
967  );
968 
969 /** gives the number of elements in a hash set */
970 extern
972  SCIP_HASHSET* hashset /**< hash set */
973  );
974 
975 /** gives the number of slots of a hash set */
976 extern
978  SCIP_HASHSET* hashset /**< hash set */
979  );
980 
981 /** gives the array of hash set slots; contains all elements in indetermined order and may contain NULL values */
982 extern
983 void** SCIPhashsetGetSlots(
984  SCIP_HASHSET* hashset /**< hash set */
985  );
986 
987 /** removes all entries in a hash set. */
988 extern
990  SCIP_HASHSET* hashset /**< hash set */
991  );
992 
993 #ifdef NDEBUG
994 
995 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
996  * speed up the algorithms.
997  */
998 
999 #define SCIPhashsetIsEmpty(hashset) ((hashset)->nelements == 0)
1000 #define SCIPhashsetGetNElements(hashset) ((hashset)->nelements)
1001 #define SCIPhashsetGetNSlots(hashset) (1u << (64 - (hashset)->shift))
1002 #define SCIPhashsetGetSlots(hashset) ((hashset)->slots)
1003 
1004 #endif
1005 
1006 /**@} */
1007 
1008 
1009 /*
1010  * Activity
1011  */
1012 
1013 /**@defgroup ResourceActivity Resource Activity
1014  * @ingroup DataStructures
1015  * @brief ressource activity data structure
1016  *
1017  * @{
1018  */
1019 
1020 /** create a resource activity */
1021 extern
1023  SCIP_RESOURCEACTIVITY** activity, /**< pointer to store the resource activity */
1024  SCIP_VAR* var, /**< start time variable of the activity */
1025  int duration, /**< duration of the activity */
1026  int demand /**< demand of the activity */
1027  );
1028 
1029 /** frees a resource activity */
1030 extern
1031 void SCIPactivityFree(
1032  SCIP_RESOURCEACTIVITY** activity /**< pointer to the resource activity */
1033  );
1034 
1035 #ifndef NDEBUG
1036 
1037 /** returns the start time variable of the resource activity */
1038 extern
1040  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1041  );
1042 
1043 /** returns the duration of the resource activity */
1044 extern
1046  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1047  );
1048 
1049 /** returns the demand of the resource activity */
1050 extern
1052  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1053  );
1054 
1055 /** returns the energy of the resource activity */
1056 extern
1058  SCIP_RESOURCEACTIVITY* activity /**< resource activity */
1059  );
1060 
1061 #else
1062 
1063 #define SCIPactivityGetVar(activity) ((activity)->var)
1064 #define SCIPactivityGetDuration(activity) ((activity)->duration)
1065 #define SCIPactivityGetDemand(activity) ((activity)->demand)
1066 #define SCIPactivityGetEnergy(activity) ((activity)->duration * (activity)->demand)
1067 
1068 #endif
1069 
1070 /**@} */
1071 
1072 
1073 /*
1074  * Resource Profile
1075  */
1076 
1077 /**@defgroup ResourceProfile Resource Profile
1078  * @ingroup DataStructures
1079  * @brief ressource profile data structure
1080  *
1081  * @{
1082  */
1083 
1084 /** creates resource profile */
1085 extern
1087  SCIP_PROFILE** profile, /**< pointer to store the resource profile */
1088  int capacity /**< resource capacity */
1089  );
1090 
1091 /** frees given resource profile */
1092 extern
1093 void SCIPprofileFree(
1094  SCIP_PROFILE** profile /**< pointer to the resource profile */
1095  );
1096 
1097 /** output of the given resource profile */
1098 extern
1099 void SCIPprofilePrint(
1100  SCIP_PROFILE* profile, /**< resource profile to output */
1101  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1102  FILE* file /**< output file (or NULL for standard output) */
1103  );
1104 
1105 /** returns the capacity of the resource profile */
1106 extern
1108  SCIP_PROFILE* profile /**< resource profile to use */
1109  );
1110 
1111 /** returns the number time points of the resource profile */
1112 extern
1114  SCIP_PROFILE* profile /**< resource profile to use */
1115  );
1116 
1117 /** returns the time points of the resource profile */
1118 extern
1120  SCIP_PROFILE* profile /**< resource profile to use */
1121  );
1122 
1123 /** returns the loads of the resource profile */
1124 extern
1125 int* SCIPprofileGetLoads(
1126  SCIP_PROFILE* profile /**< resource profile to use */
1127  );
1128 
1129 /** returns the time point for given position of the resource profile */
1130 extern
1131 int SCIPprofileGetTime(
1132  SCIP_PROFILE* profile, /**< resource profile to use */
1133  int pos /**< position */
1134  );
1135 
1136 /** returns the loads of the resource profile at the given position */
1137 extern
1138 int SCIPprofileGetLoad(
1139  SCIP_PROFILE* profile, /**< resource profile */
1140  int pos /**< position */
1141  );
1142 
1143 /** returns if the given time point exists in the resource profile and stores the position of the given time point if it
1144  * exists; otherwise the position of the next smaller existing time point is stored
1145  */
1146 extern
1148  SCIP_PROFILE* profile, /**< resource profile to search */
1149  int timepoint, /**< time point to search for */
1150  int* pos /**< pointer to store the position */
1151  );
1152 
1153 /** insert a core into resource profile; if the core is non-empty the resource profile will be updated otherwise nothing
1154  * happens
1155  */
1156 extern
1158  SCIP_PROFILE* profile, /**< resource profile to use */
1159  int left, /**< left side of the core */
1160  int right, /**< right side of the core */
1161  int height, /**< height of the core */
1162  int* pos, /**< pointer to store the first position were it gets infeasible */
1163  SCIP_Bool* infeasible /**< pointer to store if the core does not fit due to capacity */
1164  );
1165 
1166 /** subtracts the height from the resource profile during core time */
1167 extern
1169  SCIP_PROFILE* profile, /**< resource profile to use */
1170  int left, /**< left side of the core */
1171  int right, /**< right side of the core */
1172  int height /**< height of the core */
1173  );
1174 
1175 /** return the earliest possible starting point within the time interval [lb,ub] for a given core (given by its height
1176  * and duration)
1177  */
1178 extern
1180  SCIP_PROFILE* profile, /**< resource profile to use */
1181  int est, /**< earliest starting time of the given core */
1182  int lst, /**< latest starting time of the given core */
1183  int duration, /**< duration of the core */
1184  int height, /**< height of the core */
1185  SCIP_Bool* infeasible /**< pointer store if the corer cannot be inserted */
1186  );
1187 
1188 /** return the latest possible starting point within the time interval [lb,ub] for a given core (given by its height and
1189  * duration)
1190  */
1191 extern
1193  SCIP_PROFILE* profile, /**< resource profile to use */
1194  int lb, /**< earliest possible start point */
1195  int ub, /**< latest possible start point */
1196  int duration, /**< duration of the core */
1197  int height, /**< height of the core */
1198  SCIP_Bool* infeasible /**< pointer store if the core cannot be inserted */
1199  );
1200 
1201 /**@} */
1202 
1203 /*
1204  * Directed graph
1205  */
1206 
1207 /**@addtogroup DirectedGraph
1208  *
1209  * @{
1210  */
1211 
1212 /** resize directed graph structure */
1213 extern
1215  SCIP_DIGRAPH* digraph, /**< directed graph */
1216  int nnodes /**< new number of nodes */
1217  );
1218 
1219 /** sets the sizes of the successor lists for the nodes in a directed graph and allocates memory for the lists */
1220 extern
1222  SCIP_DIGRAPH* digraph, /**< directed graph */
1223  int* sizes /**< sizes of the successor lists */
1224  );
1225 
1226 /** frees given directed graph structure */
1227 extern
1228 void SCIPdigraphFree(
1229  SCIP_DIGRAPH** digraph /**< pointer to the directed graph */
1230  );
1231 
1232 /** add (directed) arc and a related data to the directed graph structure
1233  *
1234  * @note if the arc is already contained, it is added a second time
1235  */
1236 extern
1238  SCIP_DIGRAPH* digraph, /**< directed graph */
1239  int startnode, /**< start node of the arc */
1240  int endnode, /**< start node of the arc */
1241  void* data /**< data that should be stored for the arc; or NULL */
1242  );
1243 
1244 /** add (directed) arc to the directed graph structure, if it is not contained, yet
1245  *
1246  * @note if there already exists an arc from startnode to endnode, the new arc is not added,
1247  * even if its data is different
1248  */
1249 extern
1251  SCIP_DIGRAPH* digraph, /**< directed graph */
1252  int startnode, /**< start node of the arc */
1253  int endnode, /**< start node of the arc */
1254  void* data /**< data that should be stored for the arc; or NULL */
1255  );
1256 
1257 /** sets the number of successors to a given value */
1258 extern
1260  SCIP_DIGRAPH* digraph, /**< directed graph */
1261  int node, /**< node for which the number of successors has to be changed */
1262  int nsuccessors /**< new number of successors */
1263  );
1264 
1265 /** returns the number of nodes of the given digraph */
1266 extern
1268  SCIP_DIGRAPH* digraph /**< directed graph */
1269  );
1270 
1271 /** returns the node data, or NULL if no data exist */
1272 extern
1274  SCIP_DIGRAPH* digraph, /**< directed graph */
1275  int node /**< node for which the node data is returned */
1276  );
1277 
1278 /** sets the node data */
1279 extern
1281  SCIP_DIGRAPH* digraph, /**< directed graph */
1282  void* dataptr, /**< user node data pointer, or NULL */
1283  int node /**< node for which the node data is returned */
1284  );
1285 
1286 /** returns the total number of arcs in the given digraph */
1287 extern
1289  SCIP_DIGRAPH* digraph /**< directed graph */
1290  );
1291 
1292 /** returns the number of successor nodes of the given node */
1293 extern
1295  SCIP_DIGRAPH* digraph, /**< directed graph */
1296  int node /**< node for which the number of outgoing arcs is returned */
1297  );
1298 
1299 /** returns the array of indices of the successor nodes; this array must not be changed from outside */
1300 extern
1302  SCIP_DIGRAPH* digraph, /**< directed graph */
1303  int node /**< node for which the array of outgoing arcs is returned */
1304  );
1305 
1306 /** returns the array of data corresponding to the arcs originating at the given node, or NULL if no data exist; this
1307  * array must not be changed from outside
1308  */
1309 extern
1311  SCIP_DIGRAPH* digraph, /**< directed graph */
1312  int node /**< node for which the data corresponding to the outgoing arcs is returned */
1313  );
1314 
1315 /** Compute undirected connected components on the given graph.
1316  *
1317  * @note For each arc, its reverse is added, so the graph does not need to be the directed representation of an
1318  * undirected graph.
1319  */
1320 extern
1322  SCIP_DIGRAPH* digraph, /**< directed graph */
1323  int minsize, /**< all components with less nodes are ignored */
1324  int* components, /**< array with as many slots as there are nodes in the directed graph
1325  * to store for each node the component to which it belongs
1326  * (components are numbered 0 to ncomponents - 1); or NULL, if components
1327  * are accessed one-by-one using SCIPdigraphGetComponent() */
1328  int* ncomponents /**< pointer to store the number of components; or NULL, if the
1329  * number of components is accessed by SCIPdigraphGetNComponents() */
1330  );
1331 
1332 /** Computes all strongly connected components of an undirected connected component with Tarjan's Algorithm.
1333  * The resulting strongly connected components are sorted topologically (starting from the end of the
1334  * strongcomponents array).
1335  *
1336  * @note In general a topological sort of the strongly connected components is not unique.
1337  */
1338 extern
1340  SCIP_DIGRAPH* digraph, /**< directed graph */
1341  int compidx, /**< number of the undirected connected component */
1342  int* strongcomponents, /**< array to store the strongly connected components
1343  * (length >= size of the component) */
1344  int* strongcompstartidx, /**< array to store the start indices of the strongly connected
1345  * components (length >= size of the component) */
1346  int* nstrongcomponents /**< pointer to store the number of strongly connected
1347  * components */
1348  );
1349 
1350 /** Performes an (almost) topological sort on the undirected components of the given directed graph. The undirected
1351  * components should be computed before using SCIPdigraphComputeUndirectedComponents().
1352  *
1353  * @note In general a topological sort is not unique. Note, that there might be directed cycles, that are randomly
1354  * broken, which is the reason for having only almost topologically sorted arrays.
1355  */
1356 extern
1358  SCIP_DIGRAPH* digraph /**< directed graph */
1359  );
1360 
1361 /** returns the number of previously computed undirected components for the given directed graph */
1362 extern
1364  SCIP_DIGRAPH* digraph /**< directed graph */
1365  );
1366 
1367 /** Returns the previously computed undirected component of the given number for the given directed graph.
1368  * If the components were sorted using SCIPdigraphTopoSortComponents(), the component is (almost) topologically sorted.
1369  */
1370 extern
1372  SCIP_DIGRAPH* digraph, /**< directed graph */
1373  int compidx, /**< number of the component to return */
1374  int** nodes, /**< pointer to store the nodes in the component; or NULL, if not needed */
1375  int* nnodes /**< pointer to store the number of nodes in the component;
1376  * or NULL, if not needed */
1377  );
1378 
1379 /** frees the component information for the given directed graph */
1380 extern
1382  SCIP_DIGRAPH* digraph /**< directed graph */
1383  );
1384 
1385 /** output of the given directed graph via the given message handler */
1386 extern
1387 void SCIPdigraphPrint(
1388  SCIP_DIGRAPH* digraph, /**< directed graph */
1389  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1390  FILE* file /**< output file (or NULL for standard output) */
1391  );
1392 
1393 /** prints the given directed graph structure in GML format into the given file */
1394 extern
1395 void SCIPdigraphPrintGml(
1396  SCIP_DIGRAPH* digraph, /**< directed graph */
1397  FILE* file /**< file to write to */
1398  );
1399 
1400 
1401 /** output of the given directed graph via the given message handler */
1402 extern
1404  SCIP_DIGRAPH* digraph, /**< directed graph */
1405  SCIP_MESSAGEHDLR* messagehdlr, /**< message handler */
1406  FILE* file /**< output file (or NULL for standard output) */
1407  );
1408 
1409 /**@} */
1410 
1411 /*
1412  * Binary search tree
1413  */
1414 
1415 /**@defgroup BinaryTree Binary Search Tree
1416  * @ingroup DataStructures
1417  * @brief binary search tree data structure
1418  *@{
1419  */
1420 
1421 /** creates a binary tree node with sorting value and user data */
1422 extern
1424  SCIP_BT* tree, /**< binary search tree */
1425  SCIP_BTNODE** node, /**< pointer to store the created search node */
1426  void* dataptr /**< user node data pointer, or NULL */
1427  );
1428 
1429 /** frees the binary node including the rooted subtree
1430  *
1431  * @note The user pointer (object) is not freed. If needed, it has to be done by the user.
1432  */
1433 extern
1434 void SCIPbtnodeFree(
1435  SCIP_BT* tree, /**< binary tree */
1436  SCIP_BTNODE** node /**< node to be freed */
1437  );
1438 
1439 /** returns the user data pointer stored in that node */
1440 extern
1441 void* SCIPbtnodeGetData(
1442  SCIP_BTNODE* node /**< node */
1443  );
1444 
1445 /** returns the parent which can be NULL if the given node is the root */
1446 extern
1448  SCIP_BTNODE* node /**< node */
1449  );
1450 
1451 /** returns left child which can be NULL if the given node is a leaf */
1452 extern
1454  SCIP_BTNODE* node /**< node */
1455  );
1456 
1457 /** returns right child which can be NULL if the given node is a leaf */
1458 extern
1460  SCIP_BTNODE* node /**< node */
1461  );
1462 
1463 /** returns the sibling of the node or NULL if does not exist */
1464 extern
1466  SCIP_BTNODE* node /**< node */
1467  );
1468 
1469 /** returns whether the node is a root node */
1470 extern
1472  SCIP_BTNODE* node /**< node */
1473  );
1474 
1475 /** returns whether the node is a leaf */
1476 extern
1478  SCIP_BTNODE* node /**< node */
1479  );
1480 
1481 /** returns TRUE if the given node is left child */
1482 extern
1484  SCIP_BTNODE* node /**< node */
1485  );
1486 
1487 /** returns TRUE if the given node is right child */
1488 extern
1490  SCIP_BTNODE* node /**< node */
1491  );
1492 
1493 #ifdef NDEBUG
1494 
1495 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1496  * speed up the algorithms.
1497  */
1498 
1499 #define SCIPbtnodeGetData(node) ((node)->dataptr)
1500 #define SCIPbtnodeGetParent(node) ((node)->parent)
1501 #define SCIPbtnodeGetLeftchild(node) ((node)->left)
1502 #define SCIPbtnodeGetRightchild(node) ((node)->right)
1503 #define SCIPbtnodeGetSibling(node) ((node)->parent == NULL ? NULL : \
1504  (node)->parent->left == (node) ? (node)->parent->right : (node)->parent->left)
1505 #define SCIPbtnodeIsRoot(node) ((node)->parent == NULL)
1506 #define SCIPbtnodeIsLeaf(node) ((node)->left == NULL && (node)->right == NULL)
1507 #define SCIPbtnodeIsLeftchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->left == (node) ? TRUE : FALSE)
1508 #define SCIPbtnodeIsRightchild(node) ((node)->parent == NULL ? FALSE : (node)->parent->right == (node) ? TRUE : FALSE)
1509 
1510 #endif
1511 
1512 /** sets the give node data
1513  *
1514  * @note The old user pointer is not freed.
1515  */
1516 extern
1517 void SCIPbtnodeSetData(
1518  SCIP_BTNODE* node, /**< node */
1519  void* dataptr /**< node user data pointer */
1520  );
1521 
1522 /** sets parent node
1523  *
1524  * @note The old parent including the rooted subtree is not delete.
1525  */
1526 extern
1527 void SCIPbtnodeSetParent(
1528  SCIP_BTNODE* node, /**< node */
1529  SCIP_BTNODE* parent /**< new parent node, or NULL */
1530  );
1531 
1532 /** sets left child
1533  *
1534  * @note The old left child including the rooted subtree is not delete.
1535  */
1536 extern
1538  SCIP_BTNODE* node, /**< node */
1539  SCIP_BTNODE* left /**< new left child, or NULL */
1540  );
1541 
1542 /** sets right child
1543  *
1544  * @note The old right child including the rooted subtree is not delete.
1545  */
1546 extern
1548  SCIP_BTNODE* node, /**< node */
1549  SCIP_BTNODE* right /**< new right child, or NULL */
1550  );
1551 
1552 /** creates an binary tree */
1553 extern
1555  SCIP_BT** tree, /**< pointer to store the created binary tree */
1556  BMS_BLKMEM* blkmem /**< block memory used to create nodes */
1557  );
1558 
1559 /** frees binary tree
1560  *
1561  * @note The user pointers (object) of the search nodes are not freed. If needed, it has to be done by the user.
1562  */
1563 extern
1564 void SCIPbtFree(
1565  SCIP_BT** tree /**< pointer to binary tree */
1566  );
1567 
1568 /** prints the binary tree in GML format into the given file */
1569 extern
1570 void SCIPbtPrintGml(
1571  SCIP_BT* tree, /**< binary tree */
1572  FILE* file /**< file to write to */
1573  );
1574 
1575 /** returns whether the binary tree is empty (has no nodes) */
1576 extern
1578  SCIP_BT * tree /**< binary tree */
1579  );
1580 
1581 /** returns the root node of the binary tree or NULL if the binary tree is empty */
1582 extern
1584  SCIP_BT* tree /**< tree to be evaluated */
1585  );
1586 
1587 #ifdef NDEBUG
1588 
1589 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1590  * speed up the algorithms.
1591  */
1592 
1593 #define SCIPbtIsEmpty(tree) (tree->root == NULL)
1594 #define SCIPbtGetRoot(tree) (tree->root)
1595 
1596 #endif
1597 
1598 /** sets root node
1599  *
1600  * @note The old root including the rooted subtree is not delete.
1601  */
1602 extern
1603 void SCIPbtSetRoot(
1604  SCIP_BT* tree, /**< tree to be evaluated */
1605  SCIP_BTNODE* root /**< new root, or NULL */
1606  );
1607 
1608 /**@} */
1609 
1610 /**@addtogroup DisjointSet
1611  *
1612  * @{
1613  */
1614 
1615 /*
1616  * Disjoined Set data structure
1617  */
1618 
1619 /** clears the disjoint set (union find) structure \p uf */
1620 extern
1622  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1623  );
1624 
1625 /** finds and returns the component identifier of this \p element */
1626 extern
1628  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1629  int element /**< element to be found */
1630  );
1631 
1632 /** merges the components containing the elements \p p and \p q */
1633 extern
1635  SCIP_DISJOINTSET* djset, /**< disjoint set (union find) data structure */
1636  int p, /**< first element */
1637  int q, /**< second element */
1638  SCIP_Bool forcerepofp /**< force representative of p to be new representative */
1639  );
1640 
1641 /** returns the number of independent components in this disjoint set (union find) data structure */
1642 extern
1644  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1645  );
1646 
1647 /** returns the size (number of nodes) of this disjoint set (union find) data structure */
1648 extern
1650  SCIP_DISJOINTSET* djset /**< disjoint set (union find) data structure */
1651  );
1652 
1653 /* @} */
1654 
1655 /*
1656  * Numerical methods
1657  */
1658 
1659 /**@defgroup NumericalMethods Numerical Methods
1660  * @ingroup MiscellaneousMethods
1661  * @brief commonly used numerical methods
1662  *
1663  * @{
1664  */
1665 
1666 /** returns the machine epsilon: the smallest number eps > 0, for which 1.0 + eps > 1.0 */
1667 extern
1669  void
1670  );
1671 
1672 /** returns the next representable value of from in the direction of to */
1673 extern
1675  SCIP_Real from, /**< value from which the next representable value should be returned */
1676  SCIP_Real to /**< direction in which the next representable value should be returned */
1677  );
1678 
1679 /** calculates the greatest common divisor of the two given values */
1680 extern
1682  SCIP_Longint val1, /**< first value of greatest common devisor calculation */
1683  SCIP_Longint val2 /**< second value of greatest common devisor calculation */
1684  );
1685 
1686 /** calculates the smallest common multiple of the two given values */
1687 extern
1689  SCIP_Longint val1, /**< first value of smallest common multiple calculation */
1690  SCIP_Longint val2 /**< second value of smallest common multiple calculation */
1691  );
1692 
1693 /** calculates a binomial coefficient n over m, choose m elements out of n, maximal value will be 33 over 16 (because
1694  * 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
1695  * big numbers or an negative value m (and m < n) and -1 will be returned
1696  */
1697 extern
1699  int n, /**< number of different elements */
1700  int m /**< number to choose out of the above */
1701  );
1702 
1703 /** converts a real number into a (approximate) rational representation, and returns TRUE iff the conversion was
1704  * successful
1705  */
1706 extern
1708  SCIP_Real val, /**< real value r to convert into rational number */
1709  SCIP_Real mindelta, /**< minimal allowed difference r - q of real r and rational q = n/d */
1710  SCIP_Real maxdelta, /**< maximal allowed difference r - q of real r and rational q = n/d */
1711  SCIP_Longint maxdnom, /**< maximal denominator allowed */
1712  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1713  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1714  );
1715 
1716 /** tries to find a value, such that all given values, if scaled with this value become integral in relative allowed
1717  * difference in between mindelta and maxdelta
1718  */
1719 extern
1721  SCIP_Real* vals, /**< values to scale */
1722  int nvals, /**< number of values to scale */
1723  SCIP_Real mindelta, /**< minimal relative allowed difference of scaled coefficient s*c and integral i */
1724  SCIP_Real maxdelta, /**< maximal relative allowed difference of scaled coefficient s*c and integral i */
1725  SCIP_Longint maxdnom, /**< maximal denominator allowed in rational numbers */
1726  SCIP_Real maxscale, /**< maximal allowed scalar */
1727  SCIP_Real* intscalar, /**< pointer to store scalar that would make the coefficients integral, or NULL */
1728  SCIP_Bool* success /**< stores whether returned value is valid */
1729  );
1730 
1731 /** given a (usually very small) interval, tries to find a rational number with simple denominator (i.e. a small
1732  * number, probably multiplied with powers of 10) out of this interval; returns TRUE iff a valid rational
1733  * number inside the interval was found
1734  */
1735 extern
1737  SCIP_Real lb, /**< lower bound of the interval */
1738  SCIP_Real ub, /**< upper bound of the interval */
1739  SCIP_Longint maxdnom, /**< maximal denominator allowed for resulting rational number */
1740  SCIP_Longint* nominator, /**< pointer to store the nominator n of the rational number */
1741  SCIP_Longint* denominator /**< pointer to store the denominator d of the rational number */
1742  );
1743 
1744 /** given a (usually very small) interval, selects a value inside this interval; it is tried to select a rational number
1745  * with simple denominator (i.e. a small number, probably multiplied with powers of 10);
1746  * if no valid rational number inside the interval was found, selects the central value of the interval
1747  */
1748 extern
1750  SCIP_Real lb, /**< lower bound of the interval */
1751  SCIP_Real ub, /**< upper bound of the interval */
1752  SCIP_Longint maxdnom /**< maximal denominator allowed for resulting rational number */
1753  );
1754 
1755 /* The C99 standard defines the function (or macro) isfinite.
1756  * On MacOS X, isfinite is also available.
1757  * From the BSD world, there comes a function finite.
1758  * On SunOS, finite is also available.
1759  * In the MS compiler world, there is a function _finite.
1760  * As last resort, we check whether x == x does not hold, but this works only for NaN's, not for infinities!
1761  */
1762 #if _XOPEN_SOURCE >= 600 || defined(_ISOC99_SOURCE) || _POSIX_C_SOURCE >= 200112L || defined(__APPLE__)
1763 #define SCIPisFinite isfinite
1764 #elif defined(_BSD_SOURCE) || defined(__sun)
1765 #define SCIPisFinite finite
1766 #elif defined(_MSC_VER)
1767 #define SCIPisFinite _finite
1768 #else
1769 #define SCIPisFinite(x) ((x) == (x))
1770 #endif
1771 
1772 /* In debug mode, the following methods are implemented as function calls to ensure
1773  * type validity.
1774  */
1775 
1776 /** returns the relative difference: (val1-val2)/max(|val1|,|val2|,1.0) */
1777 extern
1779  SCIP_Real val1, /**< first value to be compared */
1780  SCIP_Real val2 /**< second value to be compared */
1781  );
1782 
1783 #ifdef NDEBUG
1784 
1785 /* In optimized mode, the function calls are overwritten by defines to reduce the number of function calls and
1786  * speed up the algorithms.
1787  */
1788 
1789 #define SCIPrelDiff(val1, val2) ( ((val1)-(val2))/(MAX3(1.0,REALABS(val1),REALABS(val2))) )
1790 
1791 #endif
1792 
1793 /** computes the gap from the primal and the dual bound */
1794 extern
1796  SCIP_Real eps, /**< the value treated as zero */
1797  SCIP_Real inf, /**< the value treated as infinity */
1798  SCIP_Real primalbound, /**< the primal bound */
1799  SCIP_Real dualbound /**< the dual bound */
1800  );
1801 
1802 /**@} */
1803 
1804 
1805 /*
1806  * Random Numbers
1807  */
1808 
1809 /**@defgroup RandomNumbers Random Numbers
1810  * @ingroup MiscellaneousMethods
1811  * @brief structures and methods for pseudo random number generation
1812  *
1813  *@{
1814  */
1815 
1816 /** returns a random integer between minrandval and maxrandval
1817  *
1818  * @deprecated Please use SCIPrandomGetInt() to request a random integer.
1819  */
1820 extern
1821 int SCIPgetRandomInt(
1822  int minrandval, /**< minimal value to return */
1823  int maxrandval, /**< maximal value to return */
1824  unsigned int* seedp /**< pointer to seed value */
1825  );
1826 
1827 
1828 /** returns a random integer between minrandval and maxrandval */
1829 extern
1830 int SCIPrandomGetInt(
1831  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1832  int minrandval, /**< minimal value to return */
1833  int maxrandval /**< maximal value to return */
1834  );
1835 
1836 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1837  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1838  */
1839 extern
1841  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1842  void** set, /**< original set, from which elements should be drawn */
1843  int nelems, /**< number of elements in original set */
1844  void** subset, /**< subset in which drawn elements should be stored */
1845  int nsubelems /**< number of elements that should be drawn and stored */
1846  );
1847 
1848 /** returns a random real between minrandval and maxrandval */
1849 extern
1851  SCIP_RANDNUMGEN* randgen, /**< random number generator data */
1852  SCIP_Real minrandval, /**< minimal value to return */
1853  SCIP_Real maxrandval /**< maximal value to return */
1854  );
1855 
1856 /** returns a random real between minrandval and maxrandval
1857  *
1858  * @deprecated Please use SCIPrandomGetReal() to request a random real.
1859  */
1860 extern
1862  SCIP_Real minrandval, /**< minimal value to return */
1863  SCIP_Real maxrandval, /**< maximal value to return */
1864  unsigned int* seedp /**< pointer to seed value */
1865  );
1866 
1867 /** draws a random subset of disjoint elements from a given set of disjoint elements;
1868  * this implementation is suited for the case that nsubelems is considerably smaller then nelems
1869  *
1870  * @deprecated Please use SCIPrandomGetSubset()
1871  */
1872 extern
1874  void** set, /**< original set, from which elements should be drawn */
1875  int nelems, /**< number of elements in original set */
1876  void** subset, /**< subset in which drawn elements should be stored */
1877  int nsubelems, /**< number of elements that should be drawn and stored */
1878  unsigned int randseed /**< seed value for random generator */
1879  );
1880 
1881 
1882 /**@} */
1883 
1884 /*
1885  * Permutations / Shuffling
1886  */
1887 
1888 /**@defgroup PermutationsShuffling Permutations Shuffling
1889  * @ingroup MiscellaneousMethods
1890  * @brief methods for shuffling arrays
1891  *
1892  * @{
1893  */
1894 
1895 /** swaps two ints */
1896 extern
1897 void SCIPswapInts(
1898  int* value1, /**< pointer to first integer */
1899  int* value2 /**< pointer to second integer */
1900  );
1901 
1902 /** swaps two real values */
1903 extern
1904 void SCIPswapReals(
1905  SCIP_Real* value1, /**< pointer to first real value */
1906  SCIP_Real* value2 /**< pointer to second real value */
1907 );
1908 
1909 /** swaps the addresses of two pointers */
1910 extern
1911 void SCIPswapPointers(
1912  void** pointer1, /**< first pointer */
1913  void** pointer2 /**< second pointer */
1914  );
1915 
1916 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm
1917  *
1918  * @deprecated Please use SCIPrandomPermuteIntArray()
1919  */
1920 extern
1921 void SCIPpermuteIntArray(
1922  int* array, /**< array to be shuffled */
1923  int begin, /**< first included index that should be subject to shuffling
1924  * (0 for first array entry)
1925  */
1926  int end, /**< first excluded index that should not be subject to shuffling
1927  * (array size for last array entry)
1928  */
1929  unsigned int* randseed /**< seed value for the random generator */
1930  );
1931 
1932 /** randomly shuffles parts of an integer array using the Fisher-Yates algorithm */
1933 extern
1935  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1936  int* array, /**< array to be shuffled */
1937  int begin, /**< first included index that should be subject to shuffling
1938  * (0 for first array entry)
1939  */
1940  int end /**< first excluded index that should not be subject to shuffling
1941  * (array size for last array entry)
1942  */
1943  );
1944 
1945 /** randomly shuffles parts of an array using the Fisher-Yates algorithm */
1946 extern
1948  SCIP_RANDNUMGEN* randgen, /**< random number generator */
1949  void** array, /**< array to be shuffled */
1950  int begin, /**< first included index that should be subject to shuffling
1951  * (0 for first array entry)
1952  */
1953  int end /**< first excluded index that should not be subject to shuffling
1954  * (array size for last array entry)
1955  */
1956  );
1957 
1958 /** randomly shuffles parts of an array using the Fisher-Yates algorithm
1959  *
1960  * @deprecated Please use SCIPrandomPermuteArray()
1961  */
1962 extern
1963 void SCIPpermuteArray(
1964  void** array, /**< array to be shuffled */
1965  int begin, /**< first included index that should be subject to shuffling
1966  * (0 for first array entry)
1967  */
1968  int end, /**< first excluded index that should not be subject to shuffling
1969  * (array size for last array entry)
1970  */
1971  unsigned int* randseed /**< pointer to seed value for the random generator */
1972  );
1973 
1974 /**@} */
1975 
1976 
1977 /*
1978  * Arrays
1979  */
1980 
1981 /**@defgroup Arrays Arrays
1982  * @ingroup MiscellaneousMethods
1983  * @brief miscellaneous methods for arrays
1984  *
1985  * @{
1986  */
1987 
1988 
1989 /** computes set intersection (duplicates removed) of two arrays that are ordered ascendingly */
1990 extern
1992  int* array1, /**< first array (in ascending order) */
1993  int narray1, /**< number of entries of first array */
1994  int* array2, /**< second array (in ascending order) */
1995  int narray2, /**< number of entries of second array */
1996  int* intersectarray, /**< intersection of array1 and array2
1997  * (note: it is possible to use array1 for this input argument) */
1998  int* nintersectarray /**< pointer to store number of entries of intersection array
1999  * (note: it is possible to use narray1 for this input argument) */
2000  );
2001 
2002 /** computes set difference (duplicates removed) of two arrays that are ordered ascendingly */
2003 extern
2005  int* array1, /**< first array (in ascending order) */
2006  int narray1, /**< number of entries of first array */
2007  int* array2, /**< second array (in ascending order) */
2008  int narray2, /**< number of entries of second array */
2009  int* setminusarray, /**< array to store entries of array1 that are not an entry of array2
2010  * (note: it is possible to use array1 for this input argument) */
2011  int* nsetminusarray /**< pointer to store number of entries of setminus array
2012  * (note: it is possible to use narray1 for this input argument) */
2013  );
2014 
2015 /**@} */
2016 
2017 
2018 /*
2019  * Strings
2020  */
2021 
2022 /**@defgroup StringMethods String Methods
2023  * @ingroup MiscellaneousMethods
2024  * @brief commonly used methods for strings
2025  *
2026  *@{
2027  */
2028 
2029 /** copies characters from 'src' to 'dest', copying is stopped when either the 'stop' character is reached or after
2030  * 'cnt' characters have been copied, whichever comes first.
2031  *
2032  * @note undefined behaviuor on overlapping arrays
2033  */
2034 extern
2035 int SCIPmemccpy(
2036  char* dest, /**< destination pointer to copy to */
2037  const char* src, /**< source pointer to copy to */
2038  char stop, /**< character when found stop copying */
2039  unsigned int cnt /**< maximal number of characters to copy too */
2040  );
2041 
2042 /** prints an error message containing of the given string followed by a string describing the current system error;
2043  * prefers to use the strerror_r method, which is threadsafe; on systems where this method does not exist,
2044  * NO_STRERROR_R should be defined (see INSTALL), in this case, srerror is used which is not guaranteed to be
2045  * threadsafe (on SUN-systems, it actually is)
2046  */
2047 extern
2048 void SCIPprintSysError(
2049  const char* message /**< first part of the error message, e.g. the filename */
2050  );
2051 
2052 /** extracts tokens from strings - wrapper method for strtok_r() */
2053 extern
2054 char* SCIPstrtok(
2055  char* s, /**< string to parse */
2056  const char* delim, /**< delimiters for parsing */
2057  char** ptrptr /**< pointer to working char pointer - must stay the same while parsing */
2058  );
2059 
2060 /** translates the given string into a string where symbols ", ', and spaces are escaped with a \ prefix */
2061 extern
2062 void SCIPescapeString(
2063  char* t, /**< target buffer to store escaped string */
2064  int bufsize, /**< size of buffer t */
2065  const char* s /**< string to transform into escaped string */
2066  );
2067 
2068 /** safe version of snprintf */
2069 extern
2070 int SCIPsnprintf(
2071  char* t, /**< target string */
2072  int len, /**< length of the string to copy */
2073  const char* s, /**< source string */
2074  ... /**< further parameters */
2075  );
2076 
2077 /** safe version of strncpy
2078  *
2079  * Copies string in s to t using at most @a size-1 nonzero characters (strncpy copies size characters). It always adds
2080  * a terminating zero char. Does not pad the remaining string with zero characters (unlike strncpy). Returns the number
2081  * of copied nonzero characters, if the length of s is at most size - 1, and returns size otherwise. Thus, the original
2082  * string was truncated if the return value is size.
2083  */
2084 extern
2085 int SCIPstrncpy(
2086  char* t, /**< target string */
2087  const char* s, /**< source string */
2088  int size /**< maximal size of t */
2089  );
2090 
2091 /** 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
2092  *
2093  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2094  */
2095 extern
2097  const char* str, /**< string to search */
2098  int* value, /**< pointer to store the parsed value */
2099  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2100  );
2101 
2102 /** 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
2103  *
2104  * @return Returns TRUE if a value could be extracted, otherwise FALSE
2105  */
2106 extern
2108  const char* str, /**< string to search */
2109  SCIP_Real* value, /**< pointer to store the parsed value */
2110  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2111  );
2112 
2113 /** copies the first size characters between a start and end character of str into token, if no error occured endptr
2114  * will point to the position after the read part, otherwise it will point to @p str
2115  */
2116 extern
2117 void SCIPstrCopySection(
2118  const char* str, /**< string to search */
2119  char startchar, /**< character which defines the beginning */
2120  char endchar, /**< character which defines the ending */
2121  char* token, /**< string to store the copy */
2122  int size, /**< size of the token char array */
2123  char** endptr /**< pointer to store the final string position if successfully parsed, otherwise @p str */
2124  );
2125 
2126 /**@} */
2127 
2128 /*
2129  * File methods
2130  */
2131 
2132 /**@defgroup FileMethods File Methods
2133  * @ingroup MiscellaneousMethods
2134  * @brief commonly used file methods
2135  *
2136  * @{
2137  */
2138 
2139 /** returns, whether the given file exists */
2140 extern
2142  const char* filename /**< file name */
2143  );
2144 
2145 /** splits filename into path, name, and extension */
2146 extern
2147 void SCIPsplitFilename(
2148  char* filename, /**< filename to split; is destroyed (but not freed) during process */
2149  char** path, /**< pointer to store path, or NULL if not needed */
2150  char** name, /**< pointer to store name, or NULL if not needed */
2151  char** extension, /**< pointer to store extension, or NULL if not needed */
2152  char** compression /**< pointer to store compression extension, or NULL if not needed */
2153  );
2154 
2155 /**@} */
2156 
2157 #ifdef __cplusplus
2158 }
2159 #endif
2160 
2161 #endif
void SCIPmultihashFree(SCIP_MULTIHASH **multihash)
Definition: misc.c:1712
void SCIPpermuteArray(void **array, int begin, int end, unsigned int *randseed)
Definition: misc.c:9695
SCIP_RETCODE SCIPbtnodeCreate(SCIP_BT *tree, SCIP_BTNODE **node, void *dataptr)
Definition: misc.c:8010
void ** SCIPdigraphGetSuccessorsData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7329
int SCIPpqueueNElems(SCIP_PQUEUE *pqueue)
Definition: misc.c:1263
void SCIPbtnodeFree(SCIP_BT *tree, SCIP_BTNODE **node)
Definition: misc.c:8074
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:9901
SCIP_Real SCIPerf(SCIP_Real x)
Definition: misc.c:144
void SCIPhashmapEntrySetImageReal(SCIP_HASHMAPENTRY *entry, SCIP_Real image)
Definition: misc.c:3203
internal miscellaneous methods for linear constraints
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:10437
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:8159
SCIP_RETCODE SCIPprofileDeleteCore(SCIP_PROFILE *profile, int left, int right, int height)
Definition: misc.c:6573
void * SCIPbtnodeGetData(SCIP_BTNODE *node)
Definition: misc.c:8119
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2265
static void message(unsigned int type, const CURF *curf, const char *msg,...)
Definition: grphload.c:317
SCIP_DECL_HASHKEYVAL(SCIPhashKeyValString)
Definition: misc.c:2569
void SCIPdigraphFreeComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7851
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:7423
int * SCIPdigraphGetSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7311
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:10236
#define INLINE
Definition: def.h:97
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:6370
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:9645
void SCIPbtnodeSetRightchild(SCIP_BTNODE *node, SCIP_BTNODE *right)
Definition: misc.c:8280
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:10325
int SCIPprofileGetEarliestFeasibleStart(SCIP_PROFILE *profile, int est, int lst, int duration, int height, SCIP_Bool *infeasible)
Definition: misc.c:6663
miscellaneous datastructures
int SCIPsnprintf(char *t, int len, const char *s,...)
Definition: misc.c:10017
void SCIPrandomPermuteArray(SCIP_RANDNUMGEN *randgen, void **array, int begin, int end)
Definition: misc.c:9443
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:7046
void SCIPdigraphPrintComponents(SCIP_DIGRAPH *digraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
Definition: misc.c:7957
SCIP_VAR * SCIPactivityGetVar(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6209
void * SCIPpqueueFirst(SCIP_PQUEUE *pqueue)
Definition: misc.c:1249
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:9788
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:9632
int SCIPdigraphGetNComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7618
SCIP_Bool SCIPstrToIntValue(const char *str, int *value, char **endptr)
Definition: misc.c:10087
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:6543
type definitions for return codes for SCIP methods
int SCIPrandomGetInt(SCIP_RANDNUMGEN *randgen, int minrandval, int maxrandval)
Definition: misc.c:9372
SCIP_Real SCIPselectSimpleValue(SCIP_Real lb, SCIP_Real ub, SCIP_Longint maxdnom)
Definition: misc.c:9132
void SCIPdigraphGetComponent(SCIP_DIGRAPH *digraph, int compidx, int **nodes, int *nnodes)
Definition: misc.c:7631
SCIP_Bool SCIPhashmapIsEmpty(SCIP_HASHMAP *hashmap)
Definition: misc.c:3125
int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
Definition: misc.c:10517
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:6382
SCIP_Real SCIPhashmapGetImageReal(SCIP_HASHMAP *hashmap, void *origin)
Definition: misc.c:2950
int SCIPstrncpy(char *t, const char *s, int size)
Definition: misc.c:10060
int SCIPhashsetGetNSlots(SCIP_HASHSET *hashset)
Definition: misc.c:3581
SCIP_VAR ** x
Definition: circlepacking.c:54
SCIP_RETCODE SCIPdigraphTopoSortComponents(SCIP_DIGRAPH *digraph)
Definition: misc.c:7552
SCIP_Bool SCIPbtnodeIsRoot(SCIP_BTNODE *node)
Definition: misc.c:8179
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:10220
void SCIPqueueClear(SCIP_QUEUE *queue)
Definition: misc.c:967
int SCIPdigraphGetNNodes(SCIP_DIGRAPH *digraph)
Definition: misc.c:7238
int SCIPprofileGetCapacity(SCIP_PROFILE *profile)
Definition: misc.c:6330
SCIP_Bool SCIPrealToRational(SCIP_Real val, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Longint *nominator, SCIP_Longint *denominator)
Definition: misc.c:8727
SCIP_RETCODE SCIPactivityCreate(SCIP_RESOURCEACTIVITY **activity, SCIP_VAR *var, int duration, int demand)
Definition: misc.c:6164
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:10393
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:8129
SCIP_RETCODE SCIPdigraphSetNSuccessors(SCIP_DIGRAPH *digraph, int node, int nsuccessors)
Definition: misc.c:7222
void SCIPhashmapPrintStatistics(SCIP_HASHMAP *hashmap, SCIP_MESSAGEHDLR *messagehdlr)
Definition: misc.c:3087
int SCIPactivityGetEnergy(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6239
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:8266
void * SCIPdigraphGetNodeData(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7248
void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
Definition: misc.c:3371
static INLINE uint32_t SCIPrealHashCode(double x)
Definition: pub_misc.h:490
void SCIPdigraphSetNodeData(SCIP_DIGRAPH *digraph, void *dataptr, int node)
Definition: misc.c:7264
void SCIPescapeString(char *t, int bufsize, const char *s)
Definition: misc.c:9989
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:10148
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:7883
void SCIPactivityFree(SCIP_RESOURCEACTIVITY **activity)
Definition: misc.c:6183
int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
Definition: misc.c:10410
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:6278
Definition: grphload.c:88
void SCIPqueueFree(SCIP_QUEUE **queue)
Definition: misc.c:956
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7160
SCIP_Bool SCIPbtnodeIsRightchild(SCIP_BTNODE *node)
Definition: misc.c:8217
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:10507
SCIP_RETCODE SCIPgetRandomSubset(void **set, int nelems, void **subset, int nsubelems, unsigned int randseed)
Definition: misc.c:9729
SCIP_BTNODE * SCIPbtGetRoot(SCIP_BT *tree)
Definition: misc.c:8402
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:9844
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:8149
SCIP_RETCODE SCIPdigraphAddArcSafe(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
Definition: misc.c:7188
int SCIPdigraphGetNSuccessors(SCIP_DIGRAPH *digraph, int node)
Definition: misc.c:7296
#define SCIP_Bool
Definition: def.h:62
SCIP_Longint * SCIPsparseSolGetUbs(SCIP_SPARSESOL *sparsesol)
Definition: misc.c:798
void SCIPprintSysError(const char *message)
Definition: misc.c:9926
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:6396
SCIP_RETCODE SCIPdigraphResize(SCIP_DIGRAPH *digraph, int nnodes)
Definition: misc.c:6932
void SCIPrandomPermuteIntArray(SCIP_RANDNUMGEN *randgen, int *array, int begin, int end)
Definition: misc.c:9413
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
Definition: misc.c:10118
int SCIPdigraphGetNArcs(SCIP_DIGRAPH *digraph)
Definition: misc.c:7278
void SCIPbtFree(SCIP_BT **tree)
Definition: misc.c:8310
SCIP_RETCODE SCIPhashtableSafeInsert(SCIP_HASHTABLE *hashtable, void *element)
Definition: misc.c:2297
SCIP_Bool SCIPbtnodeIsLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8199
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
Definition: misc.c:8697
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:7763
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:6308
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:9091
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
Definition: misc.c:2326
int * SCIPprofileGetTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6350
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:9394
int * SCIPprofileGetLoads(SCIP_PROFILE *profile)
Definition: misc.c:6360
int SCIPgetRandomInt(int minrandval, int maxrandval, unsigned int *seedp)
Definition: misc.c:9255
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
Definition: misc.c:2064
SCIP_Bool SCIPbtIsEmpty(SCIP_BT *tree)
Definition: misc.c:8392
SCIP_Real SCIPgetRandomReal(SCIP_Real minrandval, SCIP_Real maxrandval, unsigned int *seedp)
Definition: misc.c:9268
SCIP_BTNODE * SCIPbtnodeGetLeftchild(SCIP_BTNODE *node)
Definition: misc.c:8139
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:8415
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:8252
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:8431
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:6219
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:150
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:9661
SCIP_VAR ** y
Definition: circlepacking.c:55
SCIP_RETCODE SCIPrandomGetSubset(SCIP_RANDNUMGEN *randgen, void **set, int nelems, void **subset, int nsubelems)
Definition: misc.c:9475
SCIP_Longint SCIPcalcBinomCoef(int n, int m)
Definition: misc.c:9536
int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2495
#define SCIP_Longint
Definition: def.h:135
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:8887
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:6812
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:9619
struct BMS_BlkMem BMS_BLKMEM
Definition: memory.h:419
SCIP_RETCODE SCIPbtCreate(SCIP_BT **tree, BMS_BLKMEM *blkmem)
Definition: misc.c:8291
int SCIPactivityGetDemand(SCIP_RESOURCEACTIVITY *activity)
Definition: misc.c:6229
void SCIPbtnodeSetData(SCIP_BTNODE *node, void *dataptr)
Definition: misc.c:8238
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
Definition: misc.c:7070
int SCIPprofileGetNTimepoints(SCIP_PROFILE *profile)
Definition: misc.c:6340
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:9975
SCIP_Longint SCIPcalcGreComDiv(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8454
void SCIPdigraphPrintGml(SCIP_DIGRAPH *digraph, FILE *file)
Definition: misc.c:7918
void SCIPbtPrintGml(SCIP_BT *tree, FILE *file)
Definition: misc.c:8362
SCIP_Longint SCIPhashtableGetNElements(SCIP_HASHTABLE *hashtable)
Definition: misc.c:2485
SCIP_Longint SCIPcalcSmaComMul(SCIP_Longint val1, SCIP_Longint val2)
Definition: misc.c:8706
SCIP_Bool SCIPbtnodeIsLeaf(SCIP_BTNODE *node)
Definition: misc.c:8189
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:10343
void SCIPprofileFree(SCIP_PROFILE **profile)
Definition: misc.c:6292
methods for selecting (weighted) k-medians
memory allocation routines