C++ wrapper for user problem data.
- Author
- Tobias Achterberg
Definition in file objprobdata.cpp.
creates empty problem, initializes all solving data structures, and sets the user problem data to point to the given user data object
creates empty problem, initializes all solving data structures, and sets the user problem data to point to the given user data object
The method should be called in one of the following ways:
- The user is responsible of deleting the object: SCIP_CALL( SCIPcreate(&scip) ); ... MyProbData* myprobdata = new MyProbData(...); SCIP_CALL( SCIPcreateObjProb(scip, "probname", &myprobdata, FALSE) ); ... // solve the problem SCIP_CALL( SCIPfreeProb(scip) ); delete myprobdata; // delete probdata AFTER SCIPfreeProb() ! ... SCIP_CALL( SCIPfree(&scip) );
- The object pointer is passed to SCIP and deleted by SCIP in the SCIPfreeProb() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPcreateObjProb(scip, "probname", new MyProbData(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // problem is freed and destructor of MyProbData is called here
- Parameters
-
| scip | SCIP data structure |
| name | problem name |
| objprobdata | user problem data object |
| deleteobject | should the user problem data object be deleted when problem is freed? |
Definition at line 202 of file objprobdata.cpp.
References SCIP_Bool, SCIP_CALL, SCIP_OKAY, and SCIPcreateProb().
Referenced by SCIP_DECL_READERREAD().