C++ wrapper for user variable data.
This class defines the interface for user variable data implemented in C++. Each variable can be equipped with a variable data class. This data can be accessed via the function SCIPgetObjVardata() at any time after it is created and before it is deleted.
Definition at line 43 of file objvardata.h.
#include <objvardata.h>
Public Member Functions | |
ObjVardata () | |
virtual | ~ObjVardata () |
virtual SCIP_RETCODE | scip_delorig (SCIP *scip, SCIP_VAR *var) |
virtual SCIP_RETCODE | scip_trans (SCIP *scip, SCIP_VAR *var, ObjVardata **objvardata, SCIP_Bool *deleteobject) |
virtual SCIP_RETCODE | scip_deltrans (SCIP *scip, SCIP_VAR *var) |
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) |
|
inline |
default constructor
Definition at line 47 of file objvardata.h.
|
inlinevirtual |
destructor
Definition at line 52 of file objvardata.h.
|
inlinevirtual |
destructor of user variable data to free original user data (called when original variable is freed)
If the "deleteobject" flag in the SCIPcreateObjVar() method was set to TRUE, this method is not needed, because all the work to delete the user variable data can be done in the destructor of the user variable data object. If the "deleteobject" flag was set to FALSE, and the user variable data object stays alive after the SCIP variable is freed, this method should delete all the variable specific data that is no longer needed.
scip | SCIP data structure |
var | original variable, the data to free is belonging to |
Definition at line 64 of file objvardata.h.
References SCIP_OKAY.
|
inlinevirtual |
creates user data of transformed variable by transforming the original user variable data (called after variable was transformed)
The user has two possibilities to implement this method:
scip | SCIP data structure |
var | transformed variable, the data to create is belonging to |
objvardata | pointer to store the transformed variable data object |
deleteobject | pointer to store whether SCIP should delete the object after solving |
Definition at line 85 of file objvardata.h.
|
inlinevirtual |
destructor of user variable data to free transformed user data (called when transformed variable is freed)
If the "*deleteobject" flag in the scip_trans() method was set to TRUE, this method is not needed, because all the work to delete the user variable data can be done in the destructor of the user variable data object. If the "*deleteobject" flag was set to FALSE, and the user variable data object stays alive after the SCIP variable is freed, this method should delete all the variable specific data that is no longer needed.
scip | SCIP data structure |
var | transformed variable, the data to free is belonging to |
Definition at line 112 of file objvardata.h.
References SCIP_OKAY.
|
inlinevirtual |
copies variable data of source SCIP variable for the target SCIP variable
This method should copy the variable data of the source SCIP and create a target variable data for target variable. This callback is optional. If the copying process was successful, the target variable gets this variable data assigned. In case the result pointer is set to SCIP_DIDNOTRUN, the target variable will have no variable data at all.
The variable map and the constraint map can be used via the function SCIPgetVarCopy() and SCIPgetConsCopy(), respectively, to get for certain variables and constraints of the source SCIP the counter parts in the target SCIP. You should be very carefully in using these two methods since they could lead to infinite loop.
possible return values for *result:
scip | SCIP data structure |
sourcescip | source SCIP main data structure |
sourcevar | variable of the source SCIP |
varmap | a hashmap which stores the mapping of source variables to corresponding target variables |
consmap | a hashmap which stores the mapping of source contraints to corresponding target constraints |
targetvar | variable of the (targert) SCIP (targetvar is the copy of sourcevar) |
objvardata | pointer to store the copied variable data object |
result | pointer to store the result of the call |
Definition at line 135 of file objvardata.h.
References SCIP_Bool, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_Real, SCIPcreateObjVar(), and SCIPgetObjVardata().