struct_paramset.h 6.15 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*                                                                           */
/*                  This file is part of the program and library             */
/*         SCIP --- Solving Constraint Integer Programs                      */
/*                                                                           */
/*    Copyright (C) 2002-2020 Konrad-Zuse-Zentrum                            */
/*                            fuer Informationstechnik Berlin                */
/*                                                                           */
/*  SCIP is distributed under the terms of the ZIB Academic License.         */
/*                                                                           */
/*  You should have received a copy of the ZIB Academic License              */
/*  along with SCIP; see the file COPYING. If not visit scipopt.org.         */
/*                                                                           */
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/**@file   struct_paramset.h
 * @ingroup INTERNALAPI
 * @brief  datastructures for handling parameter settings
 * @author Tobias Achterberg
 * @author Timo Berthold
 */

/*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/

#ifndef __SCIP_STRUCT_PARAMSET_H__
#define __SCIP_STRUCT_PARAMSET_H__


#include "scip/def.h"
#include "scip/type_misc.h"
#include "scip/type_paramset.h"

#ifdef __cplusplus
extern "C" {
#endif

/** data for SCIP_Bool parameters */
struct SCIP_BoolParam
{
   SCIP_Bool*            valueptr;           /**< pointer to store the current parameter value, or NULL */
   SCIP_Bool             curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   SCIP_Bool             defaultvalue;       /**< default value of the parameter */
};
typedef struct SCIP_BoolParam SCIP_BOOLPARAM;

/** data for int parameters */
struct SCIP_IntParam
{
   int*                  valueptr;           /**< pointer to store the current parameter value, or NULL */
   int                   curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   int                   defaultvalue;       /**< default value of the parameter */
   int                   minvalue;           /**< minimum value for parameter */
   int                   maxvalue;           /**< maximum value for parameter */
};
typedef struct SCIP_IntParam SCIP_INTPARAM;

/** data for SCIP_Longint parameters */
struct SCIP_LongintParam
{
   SCIP_Longint          curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   SCIP_Longint          defaultvalue;       /**< default value of the parameter */
   SCIP_Longint          minvalue;           /**< minimum value for parameter */
   SCIP_Longint          maxvalue;           /**< maximum value for parameter */
   SCIP_Longint*         valueptr;           /**< pointer to store the current parameter value, or NULL */
};
typedef struct SCIP_LongintParam SCIP_LONGINTPARAM;

/** data for SCIP_Real parameters */
struct SCIP_RealParam
{
   SCIP_Real             curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   SCIP_Real             defaultvalue;       /**< default value of the parameter */
   SCIP_Real             minvalue;           /**< minimum value for parameter */
   SCIP_Real             maxvalue;           /**< maximum value for parameter */
   SCIP_Real*            valueptr;           /**< pointer to store the current parameter value, or NULL */
};
typedef struct SCIP_RealParam SCIP_REALPARAM;

/** data for char parameters */
struct SCIP_CharParam
{
   char*                 valueptr;           /**< pointer to store the current parameter value, or NULL */
   char*                 allowedvalues;      /**< array with possible parameter values, or NULL if not restricted */
   char                  curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   char                  defaultvalue;       /**< default value of the parameter */
};
typedef struct SCIP_CharParam SCIP_CHARPARAM;

/** data for char* parameters */
struct SCIP_StringParam
{
   char**                valueptr;           /**< pointer to store the current parameter value, or NULL */
   char*                 curvalue;           /**< stores the current parameter value if it is not stored in *valueptr */
   char*                 defaultvalue;       /**< default value of the parameter */
};
typedef struct SCIP_StringParam SCIP_STRINGPARAM;

/** single parameter */
struct SCIP_Param
{
   union
   {
      SCIP_BOOLPARAM     boolparam;          /**< data for SCIP_Bool parameters */
      SCIP_INTPARAM      intparam;           /**< data for int parameters */
      SCIP_LONGINTPARAM  longintparam;       /**< data for SCIP_Longint parameters */
      SCIP_REALPARAM     realparam;          /**< data for SCIP_Real parameters */
      SCIP_CHARPARAM     charparam;          /**< data for char parameters */
      SCIP_STRINGPARAM   stringparam;        /**< data for char* parameters */
   } data;
   char*                 name;               /**< name of the parameter */
   char*                 desc;               /**< description of the parameter */
   SCIP_DECL_PARAMCHGD   ((*paramchgd));     /**< change information method of parameter */
   SCIP_PARAMDATA*       paramdata;          /**< locally defined parameter specific data */
   unsigned int          isadvanced:1;       /**< is this parameter an advanced parameter? */
   unsigned int          isfixed:1;          /**< is this parameter fixed? */
   SCIP_PARAMTYPE        paramtype;          /**< type of this parameter */
};

/** set of parameters */
struct SCIP_ParamSet
{
   SCIP_HASHTABLE*       hashtable;          /**< hash table to store the parameters */
   SCIP_PARAM**          params;             /**< array with parameters */
   int                   nparams;            /**< number of parameters */
   int                   paramssize;         /**< size of params array */
};

#ifdef __cplusplus
}
#endif

#endif