Solving Constraint Integer Programs

objconshdlr.h File Reference

Detailed Description

C++ wrapper for constraint handlers.

Tobias Achterberg

Definition in file objconshdlr.h.

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

Go to the source code of this file.


SCIP_RETCODE SCIPincludeObjConshdlr (SCIP *scip, scip::ObjConshdlr *objconshdlr, SCIP_Bool deleteobject)
scip::ObjConshdlrSCIPfindObjConshdlr (SCIP *scip, const char *name)
scip::ObjConshdlrSCIPgetObjConshdlr (SCIP *scip, SCIP_CONSHDLR *conshdlr)

Function Documentation

SCIP_RETCODE SCIPincludeObjConshdlr ( SCIP scip,
scip::ObjConshdlr objconshdlr,
SCIP_Bool  deleteobject 

creates the constraint handler for the given constraint handler 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) ); ... MyConshdlr* myconshdlr = new MyConshdlr(...); SCIP_CALL( SCIPincludeObjConshdlr(scip, &myconshdlr, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete myconshdlr; // delete conshdlr AFTER SCIPfree() !
  1. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjConshdlr(scip, new MyConshdlr(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyConshdlr is called here
scipSCIP data structure
objconshdlrconstraint handler object
deleteobjectshould the constraint handler object be deleted when conshdlr is freed?
scip::ObjConshdlr* SCIPfindObjConshdlr ( SCIP scip,
const char *  name 

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

scipSCIP data structure
namename of constraint handler
scip::ObjConshdlr* SCIPgetObjConshdlr ( SCIP scip,

returns the conshdlr object for the given constraint handler

scipSCIP data structure
conshdlrconstraint handler