Scippy

SCIP

Solving Constraint Integer Programs

objbenders.h File Reference

Detailed Description

C++ wrapper for the Benders' decomposition plugins.

Author
Stephen J. Maher

Definition in file objbenders.h.

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

Go to the source code of this file.

Data Structures

class  scip::ObjBenders
 C++ wrapper for Benders' decomposition plugins. More...
 

Namespaces

 scip
 

Functions

SCIP_RETCODE SCIPincludeObjBenders (SCIP *scip, scip::ObjBenders *objbenders, SCIP_Bool deleteobject)
 
scip::ObjBendersSCIPfindObjBenders (SCIP *scip, const char *name)
 
scip::ObjBendersSCIPgetObjBenders (SCIP *scip, SCIP_BENDERS *benders)
 

Function Documentation

◆ SCIPincludeObjBenders()

SCIP_RETCODE SCIPincludeObjBenders ( SCIP scip,
scip::ObjBenders objbenders,
SCIP_Bool  deleteobject 
)

creates the Benders' decomposition for the given Benders' decomposition 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) ); ... MyBenders* mybenders = new MyBenders(...); SCIP_CALL( SCIPincludeObjBenders(scip, &mybenders, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete mybenders; // delete benders AFTER SCIPfree() !
  2. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjBenders(scip, new MyBenders(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyBenders is called here

creates the Benders' decomposition for the given Benders' decomposition object and includes it in SCIP

Parameters
scipSCIP data structure
objbendersBenders' decomposition object
deleteobjectshould the Benders' decomposition object be deleted when benders is freed?

Definition at line 344 of file objbenders.cpp.

References NULL, scip::ObjBenders::scip_, SCIP_CALL, scip::ObjBenders::scip_cutlp_, scip::ObjBenders::scip_cutpseudo_, scip::ObjBenders::scip_cutrelax_, scip::ObjBenders::scip_desc_, scip::ObjBenders::scip_name_, SCIP_OKAY, scip::ObjBenders::scip_priority_, scip::ObjBenders::scip_shareauxvars_, and SCIPincludeBenders().

Referenced by SCIP_DECL_BENDERSCOPY(), and scip::ObjBenders::SCIP_DECL_BENDERSFREESUB().

◆ SCIPfindObjBenders()

scip::ObjBenders* SCIPfindObjBenders ( SCIP scip,
const char *  name 
)

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

Parameters
scipSCIP data structure
namename of Benders' decomposition

Definition at line 373 of file objbenders.cpp.

References NULL, SCIPbendersGetData(), and SCIPfindBenders().

Referenced by scip::ObjBenders::SCIP_DECL_BENDERSFREESUB().

◆ SCIPgetObjBenders()

scip::ObjBenders* SCIPgetObjBenders ( SCIP scip,
SCIP_BENDERS benders 
)

returns the benders object for the given constraint handler

returns the benders object for the given Benders' decomposition

Parameters
scipSCIP data structure
bendersBenders' decomposition

Definition at line 392 of file objbenders.cpp.

References NULL, and SCIPbendersGetData().

Referenced by SCIP_DECL_BENDERSCUTCOPY(), and scip::ObjBenders::SCIP_DECL_BENDERSFREESUB().