Detailed Description
C++ wrapper for user problem data.
This class defines the interface for user problem data implemented in C++. This class can be accessed at any time using the methods SCIPgetObjProbData(). Therefore, it can be used to store data which has to be accessible within several plugins.
Definition at line 43 of file objprobdata.h.
C++ wrapper for user problem data. More...
#include <objprobdata.h>
Public Member Functions | |
ObjProbData () | |
virtual | ~ObjProbData () |
virtual SCIP_RETCODE | scip_delorig (SCIP *scip) |
virtual SCIP_RETCODE | scip_trans (SCIP *scip, ObjProbData **objprobdata, SCIP_Bool *deleteobject) |
virtual SCIP_RETCODE | scip_deltrans (SCIP *scip) |
virtual SCIP_RETCODE | scip_initsol (SCIP *scip) |
virtual SCIP_RETCODE | scip_exitsol (SCIP *scip, SCIP_Bool restart) |
virtual SCIP_RETCODE | scip_copy (SCIP *scip, SCIP *sourcescip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, ObjProbData **objprobdata, SCIP_Bool global, SCIP_RESULT *result) |
Constructor & Destructor Documentation
◆ ObjProbData()
|
inline |
default constructor
Definition at line 47 of file objprobdata.h.
Referenced by tsp::ProbDataTSP::~ProbDataTSP().
◆ ~ObjProbData()
|
inlinevirtual |
destructor
Definition at line 52 of file objprobdata.h.
Member Function Documentation
◆ scip_delorig()
|
inlinevirtual |
destructor of user problem data to free original user data (called when original problem is freed)
If the "deleteobject" flag in the SCIPcreateObjProb() method was set to TRUE, this method is not needed, because all the work to delete the user problem data can be done in the destructor of the user problem data object. If the "deleteobject" flag was set to FALSE, and the user problem data object stays alive after the SCIP problem is freed, this method should delete all the problem specific data that is no longer needed.
- Parameters
-
scip SCIP data structure
Reimplemented in ProbDataObjectives, and tsp::ProbDataTSP.
Definition at line 64 of file objprobdata.h.
References SCIP_OKAY.
◆ scip_trans()
|
inlinevirtual |
creates user data of transformed problem by transforming the original user problem data (called after problem was transformed)
The user has two possibilities to implement this method:
- Return the pointer to the original problem data object (this) as pointer to the transformed problem data object. The user may modify some internal attributes, but he has to make sure, that these modifications are reversed in the scip_deltrans() method, such that the original problem data is restored. In this case, he should set *deleteobject to FALSE, because the problem data must not be destructed by SCIP after the solving process is terminated.
- Call the copy constructor of the problem data object and return the created copy as transformed problem data object. In this case, he probably wants to set *deleteobject to TRUE, thus letting SCIP call the destructor of the object if the transformed problem data is no longer needed.
- Parameters
-
scip SCIP data structure objprobdata pointer to store the transformed problem data object deleteobject pointer to store whether SCIP should delete the object after solving
Definition at line 84 of file objprobdata.h.
◆ scip_deltrans()
|
inlinevirtual |
destructor of user problem data to free transformed user data (called when transformed problem 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 problem data can be done in the destructor of the user problem data object. If the "*deleteobject" flag was set to FALSE, and the user problem data object stays alive after the SCIP problem is freed, this method should delete all the problem specific data that is no longer needed.
- Parameters
-
scip SCIP data structure
Reimplemented in tsp::ProbDataTSP.
Definition at line 110 of file objprobdata.h.
References SCIP_OKAY.
◆ scip_initsol()
|
inlinevirtual |
solving process initialization method of transformed data (called before the branch and bound process begins)
This method is called before the branch and bound process begins and can be used to initialize user problem data that depends for example on the number of active problem variables, because these are now fixed.
- Parameters
-
scip SCIP data structure
Definition at line 122 of file objprobdata.h.
References SCIP_OKAY.
◆ scip_exitsol()
|
inlinevirtual |
solving process deinitialization method of transformed data (called before the branch and bound data is freed)
This method is called before the branch and bound data is freed and should be used to free all data that was allocated in the solving process initialization method. The user has to make sure, that all LP rows associated to the transformed user problem data are released.
- Parameters
-
scip SCIP data structure restart was this exit solve call triggered by a restart?
Definition at line 135 of file objprobdata.h.
References SCIP_OKAY.
◆ scip_copy()
|
inlinevirtual |
copies user data of source SCIP for the target SCIP
This method should copy the problem data of the source SCIP and create a target problem data for (target) SCIP. Implementing this callback is optional. If the copying process was successful the target SCIP gets this problem data assigned. In case the result pointer is set to SCIP_DIDNOTRUN the target SCIP will have no problem 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 an infinite loop due to recursion.
possible return values for *result:
- SCIP_DIDNOTRUN : the copying process was not performed
- SCIP_SUCCESS : the copying process was successfully performed
- Parameters
-
scip SCIP data structure sourcescip source SCIP main data structure 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 objprobdata pointer to store the copied problem data object global create a global or a local copy? result pointer to store the result of the call
Definition at line 159 of file objprobdata.h.
References SCIP_Bool, SCIP_DIDNOTRUN, SCIP_OKAY, SCIPcreateObjProb(), and SCIPgetObjProbData().