1    	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2    	/*                                                                           */
3    	/*                  This file is part of the program and library             */
4    	/*         SCIP --- Solving Constraint Integer Programs                      */
5    	/*                                                                           */
6    	/*  Copyright (c) 2002-2023 Zuse Institute Berlin (ZIB)                      */
7    	/*                                                                           */
8    	/*  Licensed under the Apache License, Version 2.0 (the "License");          */
9    	/*  you may not use this file except in compliance with the License.         */
10   	/*  You may obtain a copy of the License at                                  */
11   	/*                                                                           */
12   	/*      http://www.apache.org/licenses/LICENSE-2.0                           */
13   	/*                                                                           */
14   	/*  Unless required by applicable law or agreed to in writing, software      */
15   	/*  distributed under the License is distributed on an "AS IS" BASIS,        */
16   	/*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
17   	/*  See the License for the specific language governing permissions and      */
18   	/*  limitations under the License.                                           */
19   	/*                                                                           */
20   	/*  You should have received a copy of the Apache-2.0 license                */
21   	/*  along with SCIP; see the file LICENSE. If not visit scipopt.org.         */
22   	/*                                                                           */
23   	/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
24   	
25   	/**@file   type_misc.h
26   	 * @ingroup TYPEDEFINITIONS
27   	 * @brief  type definitions for miscellaneous datastructures
28   	 * @author Tobias Achterberg
29   	 */
30   	
31   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
32   	
33   	#ifndef __SCIP_TYPE_MISC_H__
34   	#define __SCIP_TYPE_MISC_H__
35   	
36   	#include "scip/def.h"
37   	
38   	#ifdef __cplusplus
39   	extern "C" {
40   	#endif
41   	
42   	/** represents different confidence levels for (one-sided) hypothesis testing; in order to obtain two-sided confidence
43   	 *  levels, calculate 2 * c - 1, i.e., if the one-sided confidence level is 90 %, the two-sided level is 80 %
44   	 */
45   	enum SCIP_Confidencelevel
46   	{
47   	   SCIP_CONFIDENCELEVEL_MIN = 0,    /**< one-sided confidence level 75 %, two-sided 50 % */
48   	   SCIP_CONFIDENCELEVEL_LOW = 1,    /**< (one-sided) confidence level 87.5 %, two-sided 75 % */
49   	   SCIP_CONFIDENCELEVEL_MEDIUM = 2, /**< (one-sided) confidence level 90 %, two-sided 80 % */
50   	   SCIP_CONFIDENCELEVEL_HIGH = 3,   /**< (one-sided) confidence level 95 %, two-sided 90 % */
51   	   SCIP_CONFIDENCELEVEL_MAX = 4     /**< (one-sided) confidence level 97.5 %, two-sided 95 % */
52   	};
53   	typedef enum SCIP_Confidencelevel SCIP_CONFIDENCELEVEL;
54   	
55   	/** type of hashmap: are pointers, reals or ints stored, or unknown */
56   	enum SCIP_Hashmaptype
57   	{
58   	   SCIP_HASHMAPTYPE_UNKNOWN = 0,    /**< the hashmap did not store a single element yet, type unknown */
59   	   SCIP_HASHMAPTYPE_POINTER = 1,    /**< the hashmap stores pointers % */
60   	   SCIP_HASHMAPTYPE_REAL    = 2,    /**< the hashmap stores reals */
61   	   SCIP_HASHMAPTYPE_INT     = 3     /**< the hashmap stores ints */
62   	};
63   	typedef enum SCIP_Hashmaptype SCIP_HASHMAPTYPE;
64   	
65   	/** Sparse solution data structure
66   	 *
67   	 *  - \ref SparseSol "List of all available methods"
68   	 */
69   	typedef struct SCIP_SparseSol SCIP_SPARSESOL;
70   	
71   	/** (circular) Queue data structure
72   	 *
73   	 *  - \ref Queue "List of all available methods"
74   	 */
75   	typedef struct SCIP_Queue SCIP_QUEUE;
76   	
77   	/** Priority queue data structure
78   	 *
79   	 *  - \ref PriorityQueue "List of all available methods"
80   	 */
81   	typedef struct SCIP_PQueue SCIP_PQUEUE;
82   	
83   	/** Hash table data structure
84   	 *
85   	 *  - \ref HashTable "List of all available methods"
86   	 */
87   	typedef struct SCIP_HashTable SCIP_HASHTABLE;
88   	
89   	/** Hash table data structure which allows multiple occurences of an element
90   	 *
91   	 *  - \ref MultiHash "List of all available methods"
92   	 */
93   	typedef struct SCIP_MultiHash SCIP_MULTIHASH;
94   	
95   	/** Hash table element list to store single elements of a multi hash table */
96   	typedef struct SCIP_MultiHashList SCIP_MULTIHASHLIST;
97   	
98   	/** Hash map entry */
99   	typedef struct SCIP_HashMapEntry SCIP_HASHMAPENTRY;
100  	
101  	/** Hash map data structure
102  	 *
103  	 *  - \ref HashMap "List of all available methods"
104  	 */
105  	typedef struct SCIP_HashMap SCIP_HASHMAP;
106  	
107  	/** Hash set data structure
108  	 *
109  	 *  - \ref HashMap "List of all available methods"
110  	 */
111  	typedef struct SCIP_HashSet SCIP_HASHSET;
112  	
113  	/** dynamic array for storing SCIP_Real values */
114  	typedef struct SCIP_RealArray SCIP_REALARRAY;
115  	
116  	/** dynamic array for storing int values */
117  	typedef struct SCIP_IntArray SCIP_INTARRAY;
118  	
119  	/** dynamic array for storing SCIP_Bool values */
120  	typedef struct SCIP_BoolArray SCIP_BOOLARRAY;
121  	
122  	/** dynamic array for storing pointers */
123  	typedef struct SCIP_PtrArray SCIP_PTRARRAY;
124  	
125  	/** random number generator */
126  	typedef struct SCIP_RandNumGen SCIP_RANDNUMGEN;
127  	
128  	/** Resource activity data structure
129  	 *
130  	 *  - \ref ResourceActivity "List of all available methods"
131  	 */
132  	typedef struct SCIP_ResourceActivity SCIP_RESOURCEACTIVITY;
133  	
134  	/** Resource profile data structure
135  	 *
136  	 *  - \ref ResourceProfile "List of all available methods"
137  	 */
138  	typedef struct SCIP_Profile SCIP_PROFILE;
139  	
140  	/** Directed graph data structure (stored as adjacency list)
141  	 *
142  	 *  - \ref DirectedGraph "List of all available methods"
143  	 */
144  	typedef struct SCIP_Digraph SCIP_DIGRAPH;
145  	
146  	/** Binary tree data structure
147  	 *
148  	 *  - \ref BinaryTree "List of all available methods"
149  	 */
150  	typedef struct SCIP_Bt SCIP_BT;
151  	
152  	/** search node of \ref SCIP_BT "binary tree" */
153  	typedef struct SCIP_BtNode SCIP_BTNODE;
154  	
155  	/** regression data structure to compute an incremental linear regression of paired observations
156  	 *
157  	 *  - \ref Regression "List of all available methods"
158  	 */
159  	typedef struct SCIP_Regression SCIP_REGRESSION;
160  	
161  	/** disjoint set (disjoint set (union find)) data structure for querying and updating connectedness of a graph with integer vertices 0,...,n - 1
162  	 *
163  	 *  - \ref DisjointSet "List of available methods"
164  	 */
165  	typedef struct SCIP_DisjointSet SCIP_DISJOINTSET;
166  	
167  	/** a linear inequality row in preparation to become a SCIP_ROW
168  	 *
169  	 * Used to assemble data that could eventually make a SCIP_ROW.
170  	 * @note Only one-sided rows are allowed here.
171  	 */
172  	typedef struct SCIP_RowPrep SCIP_ROWPREP;
173  	
174  	/** compares two element indices
175  	 *  result:
176  	 *    < 0: ind1 comes before (is better than) ind2
177  	 *    = 0: both indices have the same value
178  	 *    > 0: ind2 comes after (is worse than) ind2
179  	 */
180  	#define SCIP_DECL_SORTINDCOMP(x) int x (void* dataptr, int ind1, int ind2)
181  	
182  	/** compares two data element pointers
183  	 *  result:
184  	 *    < 0: elem1 comes before (is better than) elem2
185  	 *    = 0: both elements have the same value
186  	 *    > 0: elem2 comes after (is worse than) elem2
187  	 */
188  	#define SCIP_DECL_SORTPTRCOMP(x) int x (void* elem1, void* elem2)
189  	
190  	/** gets the key of the given element */
191  	#define SCIP_DECL_HASHGETKEY(x) void* x (void* userptr, void* elem)
192  	
193  	/** returns TRUE iff both keys are equal */
194  	#define SCIP_DECL_HASHKEYEQ(x) SCIP_Bool x (void* userptr, void* key1, void* key2)
195  	
196  	/** returns the hash value of the key */
197  	#define SCIP_DECL_HASHKEYVAL(x) uint64_t x (void* userptr, void* key)
198  	
199  	/** evaluates the real function at the given point, used for Newton Procedure
200  	 *  input:
201  	 *      point: the point where the function is evaluated
202  	 *      params: an array of parameters that the function depends on (e.g. f(x) = a*x + b)
203  	 *      nparams: the number of parameters stored in params
204  	 */
205  	#define SCIP_DECL_NEWTONEVAL(x) SCIP_Real x (SCIP_Real point, SCIP_Real* params, int nparams)
206  	
207  	/** callback to act on position change of @p elem in priority queue */
208  	#define SCIP_DECL_PQUEUEELEMCHGPOS(x) void x (void* elem, int oldpos, int newpos)
209  	
210  	#ifdef __cplusplus
211  	}
212  	#endif
213  	
214  	#endif
215