Scippy

SCIP

Solving Constraint Integer Programs

objbranchrule.h File Reference

Detailed Description

C++ wrapper for branching rules.

Author
Tobias Achterberg

Definition in file objbranchrule.h.

#include <cassert>
#include <cstring>
#include "scip/scip.h"
#include "objscip/objcloneable.h"

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeObjBranchrule (SCIP *scip, scip::ObjBranchrule *objbranchrule, SCIP_Bool deleteobject)
 
scip::ObjBranchruleSCIPfindObjBranchrule (SCIP *scip, const char *name)
 
scip::ObjBranchruleSCIPgetObjBranchrule (SCIP *scip, SCIP_BRANCHRULE *branchrule)
 

Function Documentation

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:

  1. 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() !
  2. 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
scipSCIP data structure
objbranchrulebranching rule object
deleteobjectshould the branching rule object be deleted when branching rule is freed?

Definition at line 229 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(), and scip::ObjBranchrule::SCIP_DECL_BRANCHEXECPS().

scip::ObjBranchrule* SCIPfindObjBranchrule ( SCIP scip,
const char *  name 
)

returns the branchrule object of the given name, or 0 if not existing

Parameters
scipSCIP data structure
namename of branching rule

Definition at line 258 of file objbranchrule.cpp.

References NULL, SCIPbranchruleGetData(), and SCIPfindBranchrule().

Referenced by scip::ObjBranchrule::SCIP_DECL_BRANCHEXECPS().

scip::ObjBranchrule* SCIPgetObjBranchrule ( SCIP scip,
SCIP_BRANCHRULE branchrule 
)

returns the branchrule object for the given branching rule

Parameters
scipSCIP data structure
branchrulebranching rule

Definition at line 277 of file objbranchrule.cpp.

References NULL, and SCIPbranchruleGetData().

Referenced by scip::ObjBranchrule::SCIP_DECL_BRANCHEXECPS().