Scippy

SCIP

Solving Constraint Integer Programs

objpresol.h File Reference

Detailed Description

C++ wrapper for presolvers.

Author
Tobias Achterberg

Definition in file objpresol.h.

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

Go to the source code of this file.

Data Structures

class  scip::ObjPresol
 C++ wrapper for presolvers. More...
 

Namespaces

 scip
 

Functions

SCIP_EXPORT SCIP_RETCODE SCIPincludeObjPresol (SCIP *scip, scip::ObjPresol *objpresol, SCIP_Bool deleteobject)
 
SCIP_EXPORT scip::ObjPresolSCIPfindObjPresol (SCIP *scip, const char *name)
 
SCIP_EXPORT scip::ObjPresolSCIPgetObjPresol (SCIP *scip, SCIP_PRESOL *presol)
 

Function Documentation

◆ SCIPincludeObjPresol()

SCIP_EXPORT SCIP_RETCODE SCIPincludeObjPresol ( SCIP scip,
scip::ObjPresol objpresol,
SCIP_Bool  deleteobject 
)

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

creates the presolver for the given presolver object and includes it in SCIP

Parameters
scipSCIP data structure
objpresolpresolver object
deleteobjectshould the presolver object be deleted when presolver is freed?

Definition at line 199 of file objpresol.cpp.

References NULL, SCIP_CALL, scip::ObjPresol::scip_desc_, scip::ObjPresol::scip_maxrounds_, scip::ObjPresol::scip_name_, SCIP_OKAY, scip::ObjPresol::scip_priority_, scip::ObjPresol::scip_timing_, and SCIPincludePresol().

Referenced by SCIP_DECL_PRESOLCOPY(), and scip::ObjPresol::SCIP_DECL_PRESOLEXITPRE().

◆ SCIPfindObjPresol()

SCIP_EXPORT scip::ObjPresol* SCIPfindObjPresol ( SCIP scip,
const char *  name 
)

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

Parameters
scipSCIP data structure
namename of presolver

Definition at line 226 of file objpresol.cpp.

References NULL, SCIPfindPresol(), and SCIPpresolGetData().

Referenced by scip::ObjPresol::SCIP_DECL_PRESOLEXITPRE().

◆ SCIPgetObjPresol()

SCIP_EXPORT scip::ObjPresol* SCIPgetObjPresol ( SCIP scip,
SCIP_PRESOL presol 
)

returns the presol object for the given presolver

Parameters
scipSCIP data structure
presolpresolver

Definition at line 245 of file objpresol.cpp.

References NULL, and SCIPpresolGetData().

Referenced by scip::ObjPresol::SCIP_DECL_PRESOLEXITPRE().