Scippy

SCIP

Solving Constraint Integer Programs

objheur.h File Reference

Detailed Description

C++ wrapper for primal heuristics.

Author
Tobias Achterberg

Definition in file objheur.h.

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

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeObjHeur (SCIP *scip, scip::ObjHeur *objheur, SCIP_Bool deleteobject)
 
scip::ObjHeurSCIPfindObjHeur (SCIP *scip, const char *name)
 
scip::ObjHeurSCIPgetObjHeur (SCIP *scip, SCIP_HEUR *heur)
 

Function Documentation

SCIP_RETCODE SCIPincludeObjHeur ( SCIP scip,
scip::ObjHeur objheur,
SCIP_Bool  deleteobject 
)

creates the primal heuristic for the given primal heuristic 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) ); ... MyHeur* myheur = new MyHeur(...); SCIP_CALL( SCIPincludeObjHeur(scip, &myheur, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete myheur; // delete heur AFTER SCIPfree() !
  2. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjHeur(scip, new MyHeur(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyHeur is called here

creates the primal heuristic for the given primal heuristic object and includes it in SCIP

Parameters
scipSCIP data structure
objheurprimal heuristic object
deleteobjectshould the primal heuristic object be deleted when heuristic is freed?

Definition at line 195 of file objheur.cpp.

References NULL, SCIP_CALL, scip::ObjHeur::scip_desc_, scip::ObjHeur::scip_dispchar_, scip::ObjHeur::scip_freq_, scip::ObjHeur::scip_freqofs_, scip::ObjHeur::scip_maxdepth_, scip::ObjHeur::scip_name_, SCIP_OKAY, scip::ObjHeur::scip_priority_, scip::ObjHeur::scip_timingmask_, scip::ObjHeur::scip_usessubscip_, and SCIPincludeHeur().

Referenced by SCIP_DECL_HEURCOPY(), and scip::ObjHeur::SCIP_DECL_HEUREXITSOL().

scip::ObjHeur* SCIPfindObjHeur ( SCIP scip,
const char *  name 
)

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

Parameters
scipSCIP data structure
namename of primal heuristic

Definition at line 224 of file objheur.cpp.

References NULL, SCIPfindHeur(), and SCIPheurGetData().

Referenced by scip::ObjHeur::SCIP_DECL_HEUREXITSOL().

scip::ObjHeur* SCIPgetObjHeur ( SCIP scip,
SCIP_HEUR heur 
)

returns the heur object for the given primal heuristic

Parameters
scipSCIP data structure
heurprimal heuristic

Definition at line 243 of file objheur.cpp.

References NULL, and SCIPheurGetData().

Referenced by scip::ObjHeur::SCIP_DECL_HEUREXITSOL().