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   struct_paramset.h
26   	 * @ingroup INTERNALAPI
27   	 * @brief  datastructures for handling parameter settings
28   	 * @author Tobias Achterberg
29   	 * @author Timo Berthold
30   	 */
31   	
32   	/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
33   	
34   	#ifndef __SCIP_STRUCT_PARAMSET_H__
35   	#define __SCIP_STRUCT_PARAMSET_H__
36   	
37   	
38   	#include "scip/def.h"
39   	#include "scip/type_misc.h"
40   	#include "scip/type_paramset.h"
41   	
42   	#ifdef __cplusplus
43   	extern "C" {
44   	#endif
45   	
46   	/** data for SCIP_Bool parameters */
47   	struct SCIP_BoolParam
48   	{
49   	   SCIP_Bool*            valueptr;           /**< pointer to store the current parameter value, or NULL */
50   	   SCIP_Bool             curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
51   	   SCIP_Bool             defaultvalue;       /**< default value of the parameter */
52   	};
53   	typedef struct SCIP_BoolParam SCIP_BOOLPARAM;
54   	
55   	/** data for int parameters */
56   	struct SCIP_IntParam
57   	{
58   	   int*                  valueptr;           /**< pointer to store the current parameter value, or NULL */
59   	   int                   curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
60   	   int                   defaultvalue;       /**< default value of the parameter */
61   	   int                   minvalue;           /**< minimum value for parameter */
62   	   int                   maxvalue;           /**< maximum value for parameter */
63   	};
64   	typedef struct SCIP_IntParam SCIP_INTPARAM;
65   	
66   	/** data for SCIP_Longint parameters */
67   	struct SCIP_LongintParam
68   	{
69   	   SCIP_Longint          curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
70   	   SCIP_Longint          defaultvalue;       /**< default value of the parameter */
71   	   SCIP_Longint          minvalue;           /**< minimum value for parameter */
72   	   SCIP_Longint          maxvalue;           /**< maximum value for parameter */
73   	   SCIP_Longint*         valueptr;           /**< pointer to store the current parameter value, or NULL */
74   	};
75   	typedef struct SCIP_LongintParam SCIP_LONGINTPARAM;
76   	
77   	/** data for SCIP_Real parameters */
78   	struct SCIP_RealParam
79   	{
80   	   SCIP_Real             curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
81   	   SCIP_Real             defaultvalue;       /**< default value of the parameter */
82   	   SCIP_Real             minvalue;           /**< minimum value for parameter */
83   	   SCIP_Real             maxvalue;           /**< maximum value for parameter */
84   	   SCIP_Real*            valueptr;           /**< pointer to store the current parameter value, or NULL */
85   	};
86   	typedef struct SCIP_RealParam SCIP_REALPARAM;
87   	
88   	/** data for char parameters */
89   	struct SCIP_CharParam
90   	{
91   	   char*                 valueptr;           /**< pointer to store the current parameter value, or NULL */
92   	   char*                 allowedvalues;      /**< array with possible parameter values, or NULL if not restricted */
93   	   char                  curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
94   	   char                  defaultvalue;       /**< default value of the parameter */
95   	};
96   	typedef struct SCIP_CharParam SCIP_CHARPARAM;
97   	
98   	/** data for char* parameters */
99   	struct SCIP_StringParam
100  	{
101  	   char**                valueptr;           /**< pointer to store the current parameter value, or NULL */
102  	   char*                 curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
103  	   char*                 defaultvalue;       /**< default value of the parameter */
104  	};
105  	typedef struct SCIP_StringParam SCIP_STRINGPARAM;
106  	
107  	/** single parameter */
108  	struct SCIP_Param
109  	{
110  	   union
111  	   {
112  	      SCIP_BOOLPARAM     boolparam;          /**< data for SCIP_Bool parameters */
113  	      SCIP_INTPARAM      intparam;           /**< data for int parameters */
114  	      SCIP_LONGINTPARAM  longintparam;       /**< data for SCIP_Longint parameters */
115  	      SCIP_REALPARAM     realparam;          /**< data for SCIP_Real parameters */
116  	      SCIP_CHARPARAM     charparam;          /**< data for char parameters */
117  	      SCIP_STRINGPARAM   stringparam;        /**< data for char* parameters */
118  	   } data;
119  	   char*                 name;               /**< name of the parameter */
120  	   char*                 desc;               /**< description of the parameter */
121  	   SCIP_DECL_PARAMCHGD   ((*paramchgd));     /**< change information method of parameter */
122  	   SCIP_PARAMDATA*       paramdata;          /**< locally defined parameter specific data */
123  	   unsigned int          isadvanced:1;       /**< is this parameter an advanced parameter? */
124  	   unsigned int          isfixed:1;          /**< is this parameter fixed? */
125  	   SCIP_PARAMTYPE        paramtype;          /**< type of this parameter */
126  	};
127  	
128  	/** set of parameters */
129  	struct SCIP_ParamSet
130  	{
131  	   SCIP_HASHTABLE*       hashtable;          /**< hash table to store the parameters */
132  	   SCIP_PARAM**          params;             /**< array with parameters */
133  	   int                   nparams;            /**< number of parameters */
134  	   int                   paramssize;         /**< size of params array */
135  	};
136  	
137  	#ifdef __cplusplus
138  	}
139  	#endif
140  	
141  	#endif
142