Scippy

SCIP

Solving Constraint Integer Programs

objreader.h File Reference

Detailed Description

C++ wrapper for file readers and writers.

Author
Tobias Achterberg

Definition in file objreader.h.

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

Go to the source code of this file.

Functions

SCIP_RETCODE SCIPincludeObjReader (SCIP *scip, scip::ObjReader *objreader, SCIP_Bool deleteobject)
 
scip::ObjReaderSCIPfindObjReader (SCIP *scip, const char *name)
 
scip::ObjReaderSCIPgetObjReader (SCIP *scip, SCIP_READER *reader)
 

Function Documentation

SCIP_RETCODE SCIPincludeObjReader ( SCIP scip,
scip::ObjReader objreader,
SCIP_Bool  deleteobject 
)

creates the file reader for the given file reader 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) ); ... MyReader* myreader = new MyReader(...); SCIP_CALL( SCIPincludeObjReader(scip, &myreader, FALSE) ); ... SCIP_CALL( SCIPfree(&scip) ); delete myreader; // delete reader AFTER SCIPfree() !
  1. The object pointer is passed to SCIP and deleted by SCIP in the SCIPfree() call: SCIP_CALL( SCIPcreate(&scip) ); ... SCIP_CALL( SCIPincludeObjReader(scip, new MyReader(...), TRUE) ); ... SCIP_CALL( SCIPfree(&scip) ); // destructor of MyReader is called here
Parameters
scipSCIP data structure
objreaderfile reader object
deleteobjectshould the reader object be deleted when reader is freed?
scip::ObjReader* SCIPfindObjReader ( SCIP scip,
const char *  name 
)

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

Parameters
scipSCIP data structure
namename of file reader
scip::ObjReader* SCIPgetObjReader ( SCIP scip,
SCIP_READER reader 
)

returns the reader object for the given file reader

Parameters
scipSCIP data structure
readerfile reader