SCIP Doxygen Documentation
Loading...
Searching...
No Matches
objconshdlr.cpp File Reference

Detailed Description

C++ wrapper for constraint handlers.

Author
Tobias Achterberg

Definition in file objconshdlr.cpp.

#include <cassert>
#include "objconshdlr.h"

Go to the source code of this file.

Functions

static SCIP_DECL_CONSHDLRCOPY (conshdlrCopyObj)
static SCIP_DECL_CONSFREE (consFreeObj)
static SCIP_DECL_CONSINIT (consInitObj)
static SCIP_DECL_CONSEXIT (consExitObj)
static SCIP_DECL_CONSINITPRE (consInitpreObj)
static SCIP_DECL_CONSEXITPRE (consExitpreObj)
static SCIP_DECL_CONSINITSOL (consInitsolObj)
static SCIP_DECL_CONSEXITSOL (consExitsolObj)
static SCIP_DECL_CONSDELETE (consDeleteObj)
static SCIP_DECL_CONSTRANS (consTransObj)
static SCIP_DECL_CONSINITLP (consInitlpObj)
static SCIP_DECL_CONSSEPALP (consSepalpObj)
static SCIP_DECL_CONSSEPASOL (consSepasolObj)
static SCIP_DECL_CONSENFOLP (consEnfolpObj)
static SCIP_DECL_CONSENFORELAX (consEnforelaxObj)
static SCIP_DECL_CONSENFOPS (consEnfopsObj)
static SCIP_DECL_CONSCHECK (consCheckObj)
static SCIP_DECL_CONSPROP (consPropObj)
static SCIP_DECL_CONSPRESOL (consPresolObj)
static SCIP_DECL_CONSRESPROP (consRespropObj)
static SCIP_DECL_CONSLOCK (consLockObj)
static SCIP_DECL_CONSACTIVE (consActiveObj)
static SCIP_DECL_CONSDEACTIVE (consDeactiveObj)
static SCIP_DECL_CONSENABLE (consEnableObj)
static SCIP_DECL_CONSDISABLE (consDisableObj)
static SCIP_DECL_CONSDELVARS (consDelVarsObj)
static SCIP_DECL_CONSPRINT (consPrintObj)
static SCIP_DECL_CONSCOPY (consCopyObj)
static SCIP_DECL_CONSPARSE (consParseObj)
static SCIP_DECL_CONSGETVARS (consGetVarsObj)
static SCIP_DECL_CONSGETNVARS (consGetNVarsObj)
static SCIP_DECL_CONSGETDIVEBDCHGS (consGetDiveBdChgsObj)
static SCIP_DECL_CONSGETPERMSYMGRAPH (consGetPermsymGraph)
static SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH (consGetSignedPermsymGraph)
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_DECL_CONSHDLRCOPY()

SCIP_DECL_CONSHDLRCOPY ( conshdlrCopyObj )
static

copy method for constraint handler plugins (called when SCIP copies plugins)

Definition at line 62 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPincludeObjConshdlr(), TRUE, and valid.

◆ SCIP_DECL_CONSFREE()

SCIP_DECL_CONSFREE ( consFreeObj )
static

destructor of constraint handler to free user data (called when SCIP is exiting)

Definition at line 87 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and SCIPconshdlrSetData().

◆ SCIP_DECL_CONSINIT()

SCIP_DECL_CONSINIT ( consInitObj )
static

initialization method of constraint handler (called after problem was transformed)

Definition at line 113 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSEXIT()

SCIP_DECL_CONSEXIT ( consExitObj )
static

deinitialization method of constraint handler (called before transformed problem is freed)

Definition at line 131 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSINITPRE()

SCIP_DECL_CONSINITPRE ( consInitpreObj )
static

presolving initialization method of constraint handler (called when presolving is about to begin)

Definition at line 148 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSEXITPRE()

SCIP_DECL_CONSEXITPRE ( consExitpreObj )
static

presolving deinitialization method of constraint handler (called after presolving has been finished)

Definition at line 165 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSINITSOL()

SCIP_DECL_CONSINITSOL ( consInitsolObj )
static

solving process initialization method of constraint handler (called when branch and bound process is about to begin)

Definition at line 182 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSEXITSOL()

SCIP_DECL_CONSEXITSOL ( consExitsolObj )
static

solving process deinitialization method of constraint handler (called before branch and bound process data is freed)

Definition at line 199 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSDELETE()

SCIP_DECL_CONSDELETE ( consDeleteObj )
static

frees specific constraint data

Definition at line 216 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSTRANS()

SCIP_DECL_CONSTRANS ( consTransObj )
static

transforms constraint data into data belonging to the transformed problem

Definition at line 233 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSINITLP()

SCIP_DECL_CONSINITLP ( consInitlpObj )
static

LP initialization method of constraint handler

Definition at line 250 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSSEPALP()

SCIP_DECL_CONSSEPALP ( consSepalpObj )
static

separation method of constraint handler for LP solutions

Definition at line 267 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSSEPASOL()

SCIP_DECL_CONSSEPASOL ( consSepasolObj )
static

separation method of constraint handler for arbitrary primal solutions

Definition at line 284 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and sol.

◆ SCIP_DECL_CONSENFOLP()

SCIP_DECL_CONSENFOLP ( consEnfolpObj )
static

constraint enforcing method of constraint handler for LP solutions

Definition at line 301 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSENFORELAX()

SCIP_DECL_CONSENFORELAX ( consEnforelaxObj )
static

constraint enforcing method of constraint handler for relaxation solutions

Definition at line 318 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and sol.

◆ SCIP_DECL_CONSENFOPS()

SCIP_DECL_CONSENFOPS ( consEnfopsObj )
static

constraint enforcing method of constraint handler for pseudo solutions

Definition at line 335 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSCHECK()

SCIP_DECL_CONSCHECK ( consCheckObj )
static

feasibility check method of constraint handler for primal solutions

Definition at line 353 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and sol.

◆ SCIP_DECL_CONSPROP()

SCIP_DECL_CONSPROP ( consPropObj )
static

domain propagation method of constraint handler

Definition at line 371 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSPRESOL()

SCIP_DECL_CONSPRESOL ( consPresolObj )
static

presolving method of constraint handler

Definition at line 388 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSRESPROP()

SCIP_DECL_CONSRESPROP ( consRespropObj )
static

propagation conflict resolving method of constraint handler

Definition at line 409 of file objconshdlr.cpp.

References assert(), NULL, result, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSLOCK()

SCIP_DECL_CONSLOCK ( consLockObj )
static

variable rounding lock method of constraint handler

Definition at line 427 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSACTIVE()

SCIP_DECL_CONSACTIVE ( consActiveObj )
static

constraint activation notification method of constraint handler

Definition at line 444 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSDEACTIVE()

SCIP_DECL_CONSDEACTIVE ( consDeactiveObj )
static

constraint deactivation notification method of constraint handler

Definition at line 461 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSENABLE()

SCIP_DECL_CONSENABLE ( consEnableObj )
static

constraint enabling notification method of constraint handler

Definition at line 478 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSDISABLE()

SCIP_DECL_CONSDISABLE ( consDisableObj )
static

constraint disabling notification method of constraint handler

Definition at line 495 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSDELVARS()

SCIP_DECL_CONSDELVARS ( consDelVarsObj )
static

variable deletion method of constraint handler

Definition at line 511 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSPRINT()

SCIP_DECL_CONSPRINT ( consPrintObj )
static

constraint display method of constraint handler

Definition at line 527 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSCOPY()

SCIP_DECL_CONSCOPY ( consCopyObj )
static

constraint copying method of constraint handler

Definition at line 543 of file objconshdlr.cpp.

References assert(), NULL, propagate, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), separate(), and valid.

◆ SCIP_DECL_CONSPARSE()

SCIP_DECL_CONSPARSE ( consParseObj )
static

constraint parsing method of constraint handler

Definition at line 560 of file objconshdlr.cpp.

References assert(), NULL, propagate, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and separate().

◆ SCIP_DECL_CONSGETVARS()

SCIP_DECL_CONSGETVARS ( consGetVarsObj )
static

constraint method of constraint handler which returns the variables (if possible)

Definition at line 577 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and vars.

◆ SCIP_DECL_CONSGETNVARS()

SCIP_DECL_CONSGETNVARS ( consGetNVarsObj )
static

constraint method of constraint handler which returns the number of variables (if possible)

Definition at line 593 of file objconshdlr.cpp.

References assert(), NULL, nvars, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSGETDIVEBDCHGS()

SCIP_DECL_CONSGETDIVEBDCHGS ( consGetDiveBdChgsObj )
static

constraint handler method to suggest dive bound changes during the generic diving algorithm

Definition at line 609 of file objconshdlr.cpp.

References assert(), diveset, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), and sol.

◆ SCIP_DECL_CONSGETPERMSYMGRAPH()

SCIP_DECL_CONSGETPERMSYMGRAPH ( consGetPermsymGraph )
static

constraint handler method which returns the permutation symmetry detection graph of a constraint (if possible)

Definition at line 625 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH()

SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH ( consGetSignedPermsymGraph )
static

constraint handler method which returns the signed permutation symmetry detection graph of a constraint (if possible)

Definition at line 641 of file objconshdlr.cpp.

References assert(), NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetData().

◆ SCIPincludeObjConshdlr()

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

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 responsible 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() !
  2. 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
Parameters
scipSCIP data structure
objconshdlrconstraint handler object
deleteobjectshould the constraint handler object be deleted when conshdlr is freed?

Definition at line 662 of file objconshdlr.cpp.

References assert(), NULL, scip::ObjConshdlr::scip_, SCIP_Bool, SCIP_CALL, scip::ObjConshdlr::scip_checkpriority_, scip::ObjConshdlr::scip_delayprop_, scip::ObjConshdlr::scip_delaysepa_, scip::ObjConshdlr::scip_desc_, scip::ObjConshdlr::scip_eagerfreq_, scip::ObjConshdlr::scip_enfopriority_, scip::ObjConshdlr::scip_maxprerounds_, scip::ObjConshdlr::scip_name_, scip::ObjConshdlr::scip_needscons_, SCIP_OKAY, scip::ObjConshdlr::scip_presoltiming_, scip::ObjConshdlr::scip_propfreq_, scip::ObjConshdlr::scip_proptiming_, scip::ObjConshdlr::scip_sepafreq_, scip::ObjConshdlr::scip_sepapriority_, and SCIPincludeConshdlr().

Referenced by runSCIP(), and SCIP_DECL_CONSHDLRCOPY().

◆ SCIPfindObjConshdlr()

scip::ObjConshdlr * SCIPfindObjConshdlr ( SCIP * scip,
const char * name )

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

Parameters
scipSCIP data structure
namename of constraint handler

Definition at line 702 of file objconshdlr.cpp.

References assert(), NULL, SCIPconshdlrGetData(), and SCIPfindConshdlr().

◆ SCIPgetObjConshdlr()

scip::ObjConshdlr * SCIPgetObjConshdlr ( SCIP * scip,
SCIP_CONSHDLR * conshdlr )

returns the conshdlr object for the given constraint handler

Parameters
scipSCIP data structure
conshdlrconstraint handler

Definition at line 721 of file objconshdlr.cpp.

References assert(), NULL, and SCIPconshdlrGetData().