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.

Functions

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

Function Documentation

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() !
  1. 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
Parameters
scipSCIP data structure
objpresolpresolver object
deleteobjectshould the presolver object be deleted when presolver is freed?
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
scip::ObjPresol* SCIPgetObjPresol ( SCIP scip,
SCIP_PRESOL presol 
)

returns the presol object for the given presolver

Parameters
scipSCIP data structure
presolpresolver