Detailed Description
SCIP user problem data for TSP
Definition at line 33 of file ProbDataTSP.h.
#include <ProbDataTSP.h>
Public Member Functions | |
ProbDataTSP (GRAPH *g) | |
virtual | ~ProbDataTSP () |
virtual SCIP_RETCODE | scip_copy (SCIP *scip, SCIP *sourcescip, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, ObjProbData **objprobdata, SCIP_Bool global, SCIP_RESULT *result) |
virtual SCIP_RETCODE | scip_delorig (SCIP *scip) |
virtual SCIP_RETCODE | scip_deltrans (SCIP *scip) |
virtual SCIP_RETCODE | scip_trans (SCIP *scip, ObjProbData **objprobdata, SCIP_Bool *deleteobject) |
GRAPH * | getGraph () |
Public Member Functions inherited from scip::ObjProbData | |
ObjProbData () | |
virtual | ~ObjProbData () |
virtual SCIP_RETCODE | scip_trans (SCIP *scip, ObjProbData **objprobdata, SCIP_Bool *deleteobject) |
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
◆ ProbDataTSP()
|
inline |
default constructor
- Parameters
-
g graph data
Definition at line 40 of file ProbDataTSP.h.
References capture_graph().
◆ ~ProbDataTSP()
|
inlinevirtual |
destructor
Definition at line 49 of file ProbDataTSP.h.
References NULL, scip::ObjProbData::ObjProbData(), release_graph(), SCIP_Bool, scip_copy(), scip_delorig(), scip_deltrans(), and scip_trans().
Member Function Documentation
◆ scip_copy()
|
virtual |
Copies user data if you want to copy it to a subscip
copies user data if you want to copy it to a subscip
- 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 116 of file ProbDataTSP.cpp.
References copy_graph(), GRAPH::edges, NULL, release_graph(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_SUCCESS, SCIPcaptureVar(), SCIPgetObjProbData(), SCIPgetVarCopy(), and GraphEdge::var.
Referenced by ~ProbDataTSP().
◆ scip_delorig()
|
virtual |
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 from scip::ObjProbData.
Definition at line 181 of file ProbDataTSP.cpp.
References release_graph(), SCIP_CALL, SCIP_OKAY, and SCIPreleaseVar().
Referenced by ~ProbDataTSP().
◆ scip_deltrans()
|
virtual |
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.
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 from scip::ObjProbData.
Definition at line 203 of file ProbDataTSP.cpp.
References release_graph(), SCIP_CALL, SCIP_OKAY, and SCIPreleaseVar().
Referenced by ~ProbDataTSP().
◆ scip_trans()
|
virtual |
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 230 of file ProbDataTSP.cpp.
References copy_graph(), GRAPH::edges, NULL, release_graph(), SCIP_CALL, SCIP_OKAY, SCIPcaptureVar(), SCIPgetTransformedVar(), TRUE, and GraphEdge::var.
Referenced by ~ProbDataTSP().
◆ getGraph()
|
inline |
Definition at line 111 of file ProbDataTSP.h.
Referenced by SCIP_DECL_CONSCOPY(), SCIP_DECL_EVENTEXEC(), SCIP_DECL_HEURINIT(), and SCIP_DECL_HEURINITSOL().