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
Parameters
scipSCIP data structure
objbranchrulebranching rule object
deleteobjectshould the branching rule object be deleted when branching rule is freed?
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
scip::ObjBranchrule* SCIPgetObjBranchrule ( SCIP scip,
SCIP_BRANCHRULE branchrule 
)

returns the branchrule object for the given branching rule

Parameters
scipSCIP data structure
branchrulebranching rule