Detailed Description
C++ wrapper for branching rules.
Definition in file objbranchrule.h.
#include <cassert>
#include <cstring>
#include <utility>
#include "scip/scip.h"
#include "objscip/objcloneable.h"
Go to the source code of this file.
Data Structures | |
class | scip::ObjBranchrule |
C++ wrapper for branching rules. More... | |
Namespaces | |
namespace | scip |
Functions | |
SCIP_RETCODE | SCIPincludeObjBranchrule (SCIP *scip, scip::ObjBranchrule *objbranchrule, SCIP_Bool deleteobject) |
scip::ObjBranchrule * | SCIPfindObjBranchrule (SCIP *scip, const char *name) |
scip::ObjBranchrule * | SCIPgetObjBranchrule (SCIP *scip, SCIP_BRANCHRULE *branchrule) |
Function Documentation
◆ SCIPincludeObjBranchrule()
SCIP_RETCODE SCIPincludeObjBranchrule | ( | SCIP * | scip, |
scip::ObjBranchrule * | objbranchrule, | ||
SCIP_Bool | deleteobject | ||
) |
creates the branching rule for the given branching rule object and includes it in SCIP
The method should be called in one of the following ways:
- The user is resposible of deleting the object: SCIP_CALL( SCIPcreate(&scip) ); ... MyBranchrule* mybranchrule = new MyBranchrule(...); SCIP_CALL( SCIPincludeObjBranchrule(scip, &mybranchrule, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete mybranchrule; // delete branchrule AFTER SCIPfree() !
- The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjBranchrule(scip, new MyBranchrule(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyBranchrule is called here
creates the branching rule for the given branching rule object and includes it in SCIP
- Parameters
-
scip SCIP data structure objbranchrule branching rule object deleteobject should the branching rule object be deleted when branching rule is freed?
Definition at line 238 of file objbranchrule.cpp.
References NULL, SCIP_CALL, scip::ObjBranchrule::scip_desc_, scip::ObjBranchrule::scip_maxbounddist_, scip::ObjBranchrule::scip_maxdepth_, scip::ObjBranchrule::scip_name_, SCIP_OKAY, scip::ObjBranchrule::scip_priority_, and SCIPincludeBranchrule().
Referenced by SCIP_DECL_BRANCHCOPY().
◆ SCIPfindObjBranchrule()
scip::ObjBranchrule * SCIPfindObjBranchrule | ( | SCIP * | scip, |
const char * | name | ||
) |
returns the branchrule object of the given name, or 0 if not existing
- Parameters
-
scip SCIP data structure name name of branching rule
Definition at line 267 of file objbranchrule.cpp.
References NULL, SCIPbranchruleGetData(), and SCIPfindBranchrule().
◆ SCIPgetObjBranchrule()
scip::ObjBranchrule * SCIPgetObjBranchrule | ( | SCIP * | scip, |
SCIP_BRANCHRULE * | branchrule | ||
) |
returns the branchrule object for the given branching rule
- Parameters
-
scip SCIP data structure branchrule branching rule
Definition at line 286 of file objbranchrule.cpp.
References NULL, and SCIPbranchruleGetData().