objvardata.h
Go to the documentation of this file.
30 /*---+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+----1----+----2*/
46 * This class defines the interface for user variable data implemented in C++. Each variable can be equipped with a
47 * variable data class. This data can be accessed via the function SCIPgetObjVardata() at any time after it is created
71 /** destructor of user variable data to free original user data (called when original variable is freed)
73 * If the "deleteobject" flag in the SCIPcreateObjVar() method was set to TRUE, this method is not needed,
74 * because all the work to delete the user variable data can be done in the destructor of the user variable
75 * data object. If the "deleteobject" flag was set to FALSE, and the user variable data object stays alive
76 * after the SCIP variable is freed, this method should delete all the variable specific data that is no
91 * 1. Return the pointer to the original variable data object (this) as pointer to the transformed variable data
92 * object. The user may modify some internal attributes, but he has to make sure, that these modifications are
93 * reversed in the scip_deltrans() method, such that the original variable data is restored. In this case,
94 * he should set *deleteobject to FALSE, because the variable data must not be destructed by SCIP after the
96 * 2. Call the copy constructor of the variable data object and return the created copy as transformed variable
97 * data object. In this case, he probably wants to set *deleteobject to TRUE, thus letting SCIP call the
104 SCIP_Bool* deleteobject /**< pointer to store whether SCIP should delete the object after solving */
111 * SCIP must not destruct the transformed variable data object, because the original variable data must stay alive
119 /** destructor of user variable data to free transformed user data (called when transformed variable is freed)
121 * If the "*deleteobject" flag in the scip_trans() method was set to TRUE, this method is not needed,
122 * because all the work to delete the user variable data can be done in the destructor of the user variable
123 * data object. If the "*deleteobject" flag was set to FALSE, and the user variable data object stays alive
124 * after the SCIP variable is freed, this method should delete all the variable specific data that is no
137 * This method should copy the variable data of the source SCIP and create a target variable data for target
138 * variable. This callback is optional. If the copying process was successful, the target variable gets this variable
139 * data assigned. In case the result pointer is set to SCIP_DIDNOTRUN, the target variable will have no variable data at
142 * The variable map and the constraint map can be used via the function SCIPgetVarCopy() and SCIPgetConsCopy(),
143 * respectively, to get for certain variables and constraints of the source SCIP the counter parts in the target
144 * SCIP. You should be very carefully in using these two methods since they could lead to infinite loop.
154 SCIP_HASHMAP* varmap, /**< a hashmap which stores the mapping of source variables to corresponding
156 SCIP_HASHMAP* consmap, /**< a hashmap which stores the mapping of source contraints to corresponding
158 SCIP_VAR* targetvar, /**< variable of the (targert) SCIP (targetvar is the copy of sourcevar) */
175 /** create and capture problem variable and associates the given variable data with the variable;
190 SCIP_Bool deleteobject /**< should the user variable data object be deleted when variable is freed? */
194 * Warning! This method should only be called after a variable was created with SCIPcreateObjVar().
virtual SCIP_RETCODE scip_deltrans(SCIP *scip, SCIP_VAR *var)
Definition: objvardata.h:127
Definition: type_result.h:42
Definition: struct_scip.h:68
Definition: struct_var.h:207
definition of base class for all clonable classes
Definition: struct_misc.h:137
scip::ObjVardata * SCIPgetObjVardata(SCIP *scip, SCIP_VAR *var)
Definition: objvardata.cpp:207
Definition: type_retcode.h:42
virtual SCIP_RETCODE scip_delorig(SCIP *scip, SCIP_VAR *var)
Definition: objvardata.h:79
virtual SCIP_RETCODE scip_trans(SCIP *scip, SCIP_VAR *var, ObjVardata **objvardata, SCIP_Bool *deleteobject)
Definition: objvardata.h:100
SCIP_RETCODE SCIPcreateObjVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, scip::ObjVardata *objvardata, SCIP_Bool deleteobject)
Definition: objvardata.cpp:175
Definition: objbenders.h:43
virtual SCIP_RETCODE scip_copy(SCIP *scip, SCIP *sourcescip, SCIP_VAR *sourcevar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_VAR *targetvar, ObjVardata **objvardata, SCIP_RESULT *result)
Definition: objvardata.h:150
SCIP callable library.
ObjVardata & operator=(const ObjVardata &o)=delete