1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 2 /* */ 3 /* This file is part of the program and library */ 4 /* SCIP --- Solving Constraint Integer Programs */ 5 /* */ 6 /* Copyright (C) 2002-2021 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 scipopt.org. */ 13 /* */ 14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ 15 16 /**@file type_misc.h 17 * @ingroup TYPEDEFINITIONS 18 * @brief type definitions for miscellaneous datastructures 19 * @author Tobias Achterberg 20 */ 21 22 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/ 23 24 #ifndef __SCIP_TYPE_MISC_H__ 25 #define __SCIP_TYPE_MISC_H__ 26 27 #include "scip/def.h" 28 29 #ifdef __cplusplus 30 extern "C" { 31 #endif 32 33 /** represents different confidence levels for (one-sided) hypothesis testing; in order to obtain two-sided confidence 34 * levels, calculate 2 * c - 1, i.e., if the one-sided confidence level is 90 %, the two-sided level is 80 % 35 */ 36 enum SCIP_Confidencelevel 37 { 38 SCIP_CONFIDENCELEVEL_MIN = 0, /**< one-sided confidence level 75 %, two-sided 50 % */ 39 SCIP_CONFIDENCELEVEL_LOW = 1, /**< (one-sided) confidence level 87.5 %, two-sided 75 % */ 40 SCIP_CONFIDENCELEVEL_MEDIUM = 2, /**< (one-sided) confidence level 90 %, two-sided 80 % */ 41 SCIP_CONFIDENCELEVEL_HIGH = 3, /**< (one-sided) confidence level 95 %, two-sided 90 % */ 42 SCIP_CONFIDENCELEVEL_MAX = 4 /**< (one-sided) confidence level 97.5 %, two-sided 95 % */ 43 }; 44 typedef enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL; 45 46 /** type of hashmap: are pointers, reals or ints stored, or unknown */ 47 enum SCIP_Hashmaptype 48 { 49 SCIP_HASHMAPTYPE_UNKNOWN = 0, /**< the hashmap did not store a single element yet, type unknown */ 50 SCIP_HASHMAPTYPE_POINTER = 1, /**< the hashmap stores pointers % */ 51 SCIP_HASHMAPTYPE_REAL = 2, /**< the hashmap stores reals */ 52 SCIP_HASHMAPTYPE_INT = 3 /**< the hashmap stores ints */ 53 }; 54 typedef enum SCIP_Hashmaptype SCIP_HASHMAPTYPE; 55 56 /** Sparse solution data structure 57 * 58 * - \ref SparseSol "List of all available methods" 59 */ 60 typedef struct SCIP_SparseSol SCIP_SPARSESOL; 61 62 /** (circular) Queue data structure 63 * 64 * - \ref Queue "List of all available methods" 65 */ 66 typedef struct SCIP_Queue SCIP_QUEUE; 67 68 /** Priority queue data structure 69 * 70 * - \ref PriorityQueue "List of all available methods" 71 */ 72 typedef struct SCIP_PQueue SCIP_PQUEUE; 73 74 /** Hash table data structure 75 * 76 * - \ref HashTable "List of all available methods" 77 */ 78 typedef struct SCIP_HashTable SCIP_HASHTABLE; 79 80 /** Hash table data structure which allows multiple occurences of an element 81 * 82 * - \ref MultiHash "List of all available methods" 83 */ 84 typedef struct SCIP_MultiHash SCIP_MULTIHASH; 85 86 /** Hash table element list to store single elements of a multi hash table */ 87 typedef struct SCIP_MultiHashList SCIP_MULTIHASHLIST; 88 89 /** Hash map entry */ 90 typedef struct SCIP_HashMapEntry SCIP_HASHMAPENTRY; 91 92 /** Hash map data structure 93 * 94 * - \ref HashMap "List of all available methods" 95 */ 96 typedef struct SCIP_HashMap SCIP_HASHMAP; 97 98 /** Hash set data structure 99 * 100 * - \ref HashMap "List of all available methods" 101 */ 102 typedef struct SCIP_HashSet SCIP_HASHSET; 103 104 /** dynamic array for storing SCIP_Real values */ 105 typedef struct SCIP_RealArray SCIP_REALARRAY; 106 107 /** dynamic array for storing int values */ 108 typedef struct SCIP_IntArray SCIP_INTARRAY; 109 110 /** dynamic array for storing SCIP_Bool values */ 111 typedef struct SCIP_BoolArray SCIP_BOOLARRAY; 112 113 /** dynamic array for storing pointers */ 114 typedef struct SCIP_PtrArray SCIP_PTRARRAY; 115 116 /** random number generator */ 117 typedef struct SCIP_RandNumGen SCIP_RANDNUMGEN; 118 119 /** Resource activity data structure 120 * 121 * - \ref ResourceActivity "List of all available methods" 122 */ 123 typedef struct SCIP_ResourceActivity SCIP_RESOURCEACTIVITY; 124 125 /** Resource profile data structure 126 * 127 * - \ref ResourceProfile "List of all available methods" 128 */ 129 typedef struct SCIP_Profile SCIP_PROFILE; 130 131 /** Directed graph data structure (stored as adjacency list) 132 * 133 * - \ref DirectedGraph "List of all available methods" 134 */ 135 typedef struct SCIP_Digraph SCIP_DIGRAPH; 136 137 /** Binary tree data structure 138 * 139 * - \ref BinaryTree "List of all available methods" 140 */ 141 typedef struct SCIP_Bt SCIP_BT; 142 143 /** search node of \ref SCIP_BT "binary tree" */ 144 typedef struct SCIP_BtNode SCIP_BTNODE; 145 146 /** regression data structure to compute an incremental linear regression of paired observations 147 * 148 * - \ref Regression "List of all available methods" 149 */ 150 typedef struct SCIP_Regression SCIP_REGRESSION; 151 152 /** disjoint set (disjoint set (union find)) data structure for querying and updating connectedness of a graph with integer vertices 0,...,n - 1 153 * 154 * - \ref DisjointSet "List of available methods" 155 */ 156 typedef struct SCIP_DisjointSet SCIP_DISJOINTSET; 157 158 /** compares two element indices 159 * result: 160 * < 0: ind1 comes before (is better than) ind2 161 * = 0: both indices have the same value 162 * > 0: ind2 comes after (is worse than) ind2 163 */ 164 #define SCIP_DECL_SORTINDCOMP(x) int x (void* dataptr, int ind1, int ind2) 165 166 /** compares two data element pointers 167 * result: 168 * < 0: elem1 comes before (is better than) elem2 169 * = 0: both elements have the same value 170 * > 0: elem2 comes after (is worse than) elem2 171 */ 172 #define SCIP_DECL_SORTPTRCOMP(x) int x (void* elem1, void* elem2) 173 174 /** gets the key of the given element */ 175 #define SCIP_DECL_HASHGETKEY(x) void* x (void* userptr, void* elem) 176 177 /** returns TRUE iff both keys are equal */ 178 #define SCIP_DECL_HASHKEYEQ(x) SCIP_Bool x (void* userptr, void* key1, void* key2) 179 180 /** returns the hash value of the key */ 181 #define SCIP_DECL_HASHKEYVAL(x) uint64_t x (void* userptr, void* key) 182 183 /** callback to act on position change of @p elem in priority queue */ 184 #define SCIP_DECL_PQUEUEELEMCHGPOS(x) void x (void* elem, int oldpos, int newpos) 185 186 #ifdef __cplusplus 187 } 188 #endif 189 190 #endif 191