Open
Graph Drawing
Framework

 v. 2023.09 (Elderberry)
 

abacus::OsiIF Class Reference

#include <ogdf/lib/abacus/osiif.h>

+ Inheritance diagram for abacus::OsiIF:

Public Types

enum  SOLVERTYPE { Exact, Approx }
 The enumeration of possible solver types. More...
 
- Public Types inherited from abacus::LP
enum  METHOD { Primal, Dual, BarrierAndCrossover, BarrierNoCrossover, Approximate }
 The solution method for the linear program. More...
 
enum  OPTSTAT { Optimal, Unoptimized, Error, Feasible, Infeasible, Unbounded, LimitReached }
 The optimization status of the linear program. More...
 
enum  SOLSTAT { Available, Missing }
 Describes if parts of the solution like x-values, reduced costs, etc. are available. More...
 

Public Member Functions

 OsiIF (Master *master)
 Constructor without initialization. More...
 
 OsiIF (Master *master, OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lb, Array< double > &ub, Array< Row * > &rows)
 A constructor with initialization. More...
 
virtual ~OsiIF ()
 The destructor. More...
 
SOLVERTYPE currentSolverType () const
 
OsiSolverInterface * osiLP ()
 
- Public Member Functions inherited from abacus::LP
 LP (Master *master)
 Creates a linear program. More...
 
virtual ~LP ()
 The destructor. More...
 
void addCols (ArrayBuffer< Column * > &newCols)
 Adds columns to the linear program. More...
 
void addRows (ArrayBuffer< Row * > &newRows)
 Adds rows to the linear program. More...
 
virtual double barXVal (int i) const
 
SOLSTAT barXValStatus () const
 
SOLSTAT basisStatus () const
 
virtual void changeLBound (int i, double newLb)
 Changes the lower bound of a single column. More...
 
void changeRhs (Array< double > &newRhs)
 Changes the complete right hand side of the linear program. More...
 
virtual void changeUBound (int i, double newUb)
 Changes the upper bound of a single column. More...
 
void colRealloc (int newSize)
 Performs a reallocation of the column space of the linear program. More...
 
virtual int getInfeas (int &infeasRow, int &infeasCol, double *bInvRow) const
 Can be called if the last linear program has been solved with the dual simplex method and is infeasible and all inactive variables price out correctly. More...
 
int getSimplexIterationLimit (int &limit) const
 
virtual bool infeasible () const
 
void initialize (OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row * > &rows)
 Loads the linear program defined by its arguments. More...
 
void initialize (OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row * > &rows, Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)
 This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments: More...
 
double lBound (int i) const
 
virtual void loadBasis (Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat)
 Loads a new basis for the linear program. More...
 
ogdf::StopwatchCPUlpSolverTime ()
 
virtual LPVARSTAT::STATUS lpVarStat (int i) const
 
int maxCol () const
 
int maxRow () const
 
int nCol () const
 
int nnz () const
 
int nOpt () const
 
int nRow () const
 
double obj (int i) const
 
virtual OPTSTAT optimize (METHOD method)
 Performs the optimization of the linear program. More...
 
virtual int pivotSlackVariableIn (ArrayBuffer< int > &rows)
 Pivots the slack variables stored in the buffer rows into the basis. More...
 
virtual double reco (int i) const
 
SOLSTAT recoStatus () const
 
void remCols (ArrayBuffer< int > &cols)
 Removes columns from the linear program. More...
 
void remRows (ArrayBuffer< int > &ind)
 Removes rows of the linear program. More...
 
double rhs (int i) const
 
void row (int i, Row &r) const
 
void rowRealloc (int newSize)
 Performs a reallocation of the row space of the linear program. More...
 
OptSense sense () const
 
void sense (const OptSense &newSense)
 
int setSimplexIterationLimit (int limit)
 Changes the iteration limit of the Simplex algorithm. More...
 
virtual double slack (int c) const
 
virtual SlackStat::STATUS slackStat (int i) const
 
SOLSTAT slackStatus () const
 
double uBound (int i) const
 
virtual double value () const
 
int writeBasisMatrix (const char *fileName)
 Writes the complete basis of an optimal linear program to a file. More...
 
virtual double xVal (int i) const
 
SOLSTAT xValStatus () const
 
virtual double yVal (int c) const
 
SOLSTAT yValStatus () const
 
- Public Member Functions inherited from abacus::AbacusRoot
virtual ~AbacusRoot ()
 The destructor. More...
 

Private Member Functions

 OsiIF (const OsiIF &rhs)
 
virtual void _addCols (ArrayBuffer< Column * > &newVars) override
 Adds the columns newCols to the linear program. More...
 
virtual void _addRows (ArrayBuffer< Row * > &newRows) override
 Adds the rows to the linear program. More...
 
virtual OPTSTAT _approx () override
 Calls an approximate method. More...
 
virtual OPTSTAT _barrier (bool doCrossover) override
 Calls the barrier method. More...
 
virtual double _barXVal (int i) const override
 Returns the value of the column i. More...
 
virtual void _changeLBound (int i, double newLb) override
 Sets the lower bound of column i to newLb. More...
 
virtual void _changeRhs (Array< double > &newRhs) override
 Sets the right hand side of the linear program to newRhs. More...
 
virtual void _changeUBound (int i, double newUb) override
 Sets the upper bound of column i to newLb. More...
 
void _colRealloc (int newSize) override
 Reallocates the internal memory such that newSize columns can be stored. More...
 
virtual OPTSTAT _dualSimplex () override
 Calls the dual simplex method. More...
 
virtual int _getInfeas (int &infeasRow, int &infeasCol, double *bInvRow) const override
 Can be called if the last linear program has been solved with the dual simplex method and is infeasible. More...
 
virtual int _getSimplexIterationLimit (int &limit) const override
 Defines a pure virtual function of the base class LP. More...
 
virtual void _initialize (OptSense sense, int nRow, int maxRow, int nCol, int maxCol, Array< double > &obj, Array< double > &lBound, Array< double > &uBound, Array< Row * > &rows) override
 Loads the linear program defined by the following arguments to the solver. More...
 
virtual double _lBound (int i) const override
 Returns the lower bound of column i. More...
 
virtual void _loadBasis (Array< LPVARSTAT::STATUS > &lpVarStat, Array< SlackStat::STATUS > &slackStat) override
 Loads a basis to the solver. More...
 
virtual LPVARSTAT::STATUS _lpVarStat (int i) const override
 Returns the status of the column i. More...
 
virtual int _maxCol () const override
 Returns the maximal number of columns of the linear program. More...
 
virtual int _maxRow () const override
 Returns the maximal number of rows of the linear program. More...
 
virtual int _nCol () const override
 Returns the number of columns of the linear program. More...
 
virtual int _nnz () const override
 Returns the number of nonzero elements in the constraint matrix (not including the right hand side). More...
 
virtual int _nRow () const override
 Returns the number of rows of the linear program. More...
 
virtual double _obj (int i) const override
 Returns the objective function coefficient of column i. More...
 
virtual int _pivotSlackVariableIn (ArrayBuffer< int > &rows) override
 Pivots the slack variables stored in the buffer rows into the basis. More...
 
virtual OPTSTAT _primalSimplex () override
 Calls the primal simplex method. More...
 
virtual double _reco (int i) const override
 Returns the reduced cost of the column i. More...
 
virtual void _remCols (ArrayBuffer< int > &vars) override
 Removes the columns listed in vars. More...
 
virtual void _remRows (ArrayBuffer< int > &ind) override
 Removes the rows listed in ind. More...
 
virtual double _rhs (int i) const override
 Returns the right hand side of row i. More...
 
virtual void _row (int i, Row &r) const override
 Stores a copy of row i in r. More...
 
void _rowRealloc (int newSize) override
 Reallocates the internal memory such that newSize rows can be stored. More...
 
virtual OptSense _sense () const override
 Returns the sense of the optimization. More...
 
virtual void _sense (const OptSense &newSense) override
 Changes the sense of the optimization to newSense. More...
 
virtual int _setSimplexIterationLimit (int limit) override
 Changes the iteration limit of the Simplex algorithm. More...
 
virtual double _slack (int i) const override
 Returns the value of the slack column of the row i. More...
 
virtual SlackStat::STATUS _slackStat (int i) const override
 Returns the status of the slack column i. More...
 
virtual double _uBound (int i) const override
 Returns the upper bound of column i. More...
 
virtual double _value () const override
 Returns the optimum value of the linear program. More...
 
virtual double _xVal (int i) const override
 Returns the value of the column i. More...
 
virtual double _yVal (int i) const override
 Returns the value of the dual column of the row i. More...
 
void convertSenseToBound (double inf, const char sense, const double right, const double range, double &lower, double &upper) const
 
char csense2osi (CSense *sense) const
 Converts the ABACUS representation of the row sense to the Osi representation. More...
 
void freeChar (char *&ptr)
 
void freeChar (const char *&ptr)
 
void freeDouble (const double *&ptr)
 
void freeDouble (double *&ptr)
 
void freeInt (int *&ptr)
 
void freeStatus (CoinWarmStartBasis::Status *&)
 
OsiSolverInterface * getDefaultInterface ()
 Allocates an Open Solver Interface of type defaultOsiSolver. More...
 
void getSol ()
 Extracts the solution. More...
 
void loadDummyRow (OsiSolverInterface *s2, const double *lbounds, const double *ubounds, const double *objectives)
 Initializes the problem with a dummy row. More...
 
CoinWarmStartBasis::Status lpVarStat2osi (LPVARSTAT::STATUS stat) const
 Converts the ABACUS variable status to OSI format. More...
 
const OsiIFoperator= (const OsiIF &rhs)
 
CSense::SENSE osi2csense (char sense) const
 Converts the OSI representation of the row sense to the ABACUS representation. More...
 
LPVARSTAT::STATUS osi2lpVarStat (CoinWarmStartBasis::Status stat) const
 Converts the OSI variable status to ABACUS format. More...
 
SlackStat::STATUS osi2slackStat (CoinWarmStartBasis::Status stat) const
 Converts the OSI slack status to ABACUS format. More...
 
CoinWarmStartBasis::Status slackStat2osi (SlackStat::STATUS stat) const
 Converts the ABACUS slack status to OSI format. More...
 
OsiSolverInterface * switchInterfaces (SOLVERTYPE newMethod)
 Switches between exact and approximate solvers. More...
 

Private Attributes

const double * barXVal_
 
const double * collower_
 An array storing the column lower bounds of the linear program. More...
 
const double * colupper_
 An array storing the column upper bounds of the linear program. More...
 
char * cStat_
 An array storing the statuses of the variables after the linear program has been optimized. More...
 
SOLVERTYPE currentSolverType_
 The type of the current solver interface. More...
 
LpMasterOsilpMasterOsi_
 
int numCols_
 The number of columns currently used in the LP. More...
 
int numRows_
 The number of rows currently used in the LP. More...
 
const double * objcoeff_
 An array storing the objective function coefficients of the linear program. More...
 
OsiSolverInterface * osiLP_
 Pointer to the Osi solver interface. More...
 
double * reco_
 An array storing the values of the reduced costs after the linear program has been optimized. More...
 
const double * rhs_
 An array storing the right hand sides of the linear program. More...
 
double * rowactivity_
 An array storing the row activity of the linear program. More...
 
const char * rowsense_
 An array storing the row senses of the linear program. More...
 
char * rStat_
 An array storing the statuses of the slack variables after the linear program has been optimized. More...
 
double value_
 The value of the optimal solution. More...
 
CoinWarmStartBasis * ws_
 A warm start object storing information about a basis of the linear program. More...
 
double * xVal_
 An array storing the values of the variables after the linear program has been optimized. More...
 
double * yVal_
 An array storing the values of the dual variables after the linear program has been optimized. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from abacus::AbacusRoot
static bool ascii2bool (const string &str)
 Converts the string str to a boolean value. More...
 
static bool endsWith (const string &str, const string &end)
 Returns true if str ends with end, false otherwise. More...
 
static double fracPart (double x)
 Returns the absolute value of the fractional part of x. More...
 
static const char * onOff (bool value)
 Converts a boolean variable to the strings "on" and "off". More...
 
- Protected Member Functions inherited from abacus::LP
void colRangeCheck (int i) const
 Terminates the program if there is no column with index i. More...
 
void colsNnz (int nRow, Array< Row * > &rows, Array< int > &nnz)
 Computes the number of nonzero elements in each column of a given set of rows. More...
 
void rowRangeCheck (int r) const
 Terminates the program if there is no row with index r. More...
 
void rows2cols (int nRow, Array< Row * > &rows, Array< SparVec * > &cols)
 Computes the columnwise representation of the row matrix. More...
 
- Protected Attributes inherited from abacus::LP
SOLSTAT barXValStatus_
 
SOLSTAT basisStatus_
 This member becomes Available if the status of the variables and the slack variables of the optimal solution can be accessed with the functions lpVarStat() and slackStat(), otherwise it has the value Missing. More...
 
ogdf::StopwatchCPU lpSolverTime_
 
Mastermaster_
 A pointer to the corresponding master of the optimization. More...
 
int nOpt_
 The number of optimizations of the linear program. More...
 
OPTSTAT optStat_
 The status of the linear program. More...
 
SOLSTAT recoStatus_
 This member becomes Available if the reduced costs of the optimal solution can be accessed with the function reco(), otherwise it has the value Missing. More...
 
SOLSTAT slackStatus_
 This member becomes Available if the values of the slack variables of the optimal solution can be accessed with the function slack(), otherwise it has the value Missing. More...
 
SOLSTAT xValStatus_
 This member becomes Available if the \(x\)-values of the optimal solution can be accessed with the function xVal(), otherwise it has the value Missing. More...
 
SOLSTAT yValStatus_
 This member becomes Available if the values of the dual variables of the optimal solution can be accessed with the function yVal(), otherwise it has the value Missing/. More...
 

Detailed Description

Definition at line 47 of file osiif.h.

Member Enumeration Documentation

◆ SOLVERTYPE

The enumeration of possible solver types.

Enumerator
Exact 
Approx 

Definition at line 87 of file osiif.h.

Constructor & Destructor Documentation

◆ OsiIF() [1/3]

abacus::OsiIF::OsiIF ( Master master)

Constructor without initialization.

This constructor does not initialize the problem data of the linear program. It must be loaded later with the function initialize().

Parameters
masterA pointer to the corresponding master of the optimization.

◆ OsiIF() [2/3]

abacus::OsiIF::OsiIF ( Master master,
OptSense  sense,
int  nRow,
int  maxRow,
int  nCol,
int  maxCol,
Array< double > &  obj,
Array< double > &  lb,
Array< double > &  ub,
Array< Row * > &  rows 
)

A constructor with initialization.

Parameters
masterA pointer to the corresponding master of the optimization.
senseThe sense of the objective function.
nColThe number of columns (variables).
maxColThe maximal number of columns.
nRowThe number of rows.
maxRowThe maximal number of rows.
objAn array with the objective function coefficients.
lbAn array with the lower bounds of the columns.
ubAn array with the upper bounds of the columns.
rowsAn array storing the rows of the problem.

◆ ~OsiIF()

virtual abacus::OsiIF::~OsiIF ( )
virtual

The destructor.

◆ OsiIF() [3/3]

abacus::OsiIF::OsiIF ( const OsiIF rhs)
private

Member Function Documentation

◆ _addCols()

virtual void abacus::OsiIF::_addCols ( ArrayBuffer< Column * > &  newVars)
overrideprivatevirtual

Adds the columns newCols to the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _addRows()

virtual void abacus::OsiIF::_addRows ( ArrayBuffer< Row * > &  newRows)
overrideprivatevirtual

Adds the rows to the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _approx()

virtual OPTSTAT abacus::OsiIF::_approx ( )
overrideprivatevirtual

Calls an approximate method.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _barrier()

virtual OPTSTAT abacus::OsiIF::_barrier ( bool  doCrossover)
overrideprivatevirtual

Calls the barrier method.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _barXVal()

virtual double abacus::OsiIF::_barXVal ( int  i) const
overrideprivatevirtual

Returns the value of the column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _changeLBound()

virtual void abacus::OsiIF::_changeLBound ( int  i,
double  newLb 
)
overrideprivatevirtual

Sets the lower bound of column i to newLb.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _changeRhs()

virtual void abacus::OsiIF::_changeRhs ( Array< double > &  newRhs)
overrideprivatevirtual

Sets the right hand side of the linear program to newRhs.

This array must have at least length of the number of rows. This function implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _changeUBound()

virtual void abacus::OsiIF::_changeUBound ( int  i,
double  newUb 
)
overrideprivatevirtual

Sets the upper bound of column i to newLb.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _colRealloc()

void abacus::OsiIF::_colRealloc ( int  newSize)
overrideprivatevirtual

Reallocates the internal memory such that newSize columns can be stored.

This function is obsolete, as memory management is completely handled by Osi.

It implements the corresponding pure virtual function of the base class LP.

Implements abacus::LP.

◆ _dualSimplex()

virtual OPTSTAT abacus::OsiIF::_dualSimplex ( )
overrideprivatevirtual

Calls the dual simplex method.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _getInfeas()

virtual int abacus::OsiIF::_getInfeas ( int &  infeasRow,
int &  infeasCol,
double *  bInvRow 
) const
overrideprivatevirtual

Can be called if the last linear program has been solved with the dual simplex method and is infeasible.

This function is currently not supported by the interface.

In this case it computes the infeasible basic variable or constraint and the corresponding row nInvRow of the basis inverse. Either infeasRow or infeasCol is nonnegative. Then this number refers to an infeasible variable or slack variable, respectively. The function returns 0 if it is successful, 1 otherwise.

Currently this featureis not supported by the Open Solver Interface, therefore a call to this function always returns an error status.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _getSimplexIterationLimit()

virtual int abacus::OsiIF::_getSimplexIterationLimit ( int &  limit) const
inlineoverrideprivatevirtual

Defines a pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 461 of file osiif.h.

◆ _initialize()

virtual void abacus::OsiIF::_initialize ( OptSense  sense,
int  nRow,
int  maxRow,
int  nCol,
int  maxCol,
Array< double > &  obj,
Array< double > &  lBound,
Array< double > &  uBound,
Array< Row * > &  rows 
)
overrideprivatevirtual

Loads the linear program defined by the following arguments to the solver.

Parameters
senseThe sense of the objective function.
nRowThe number of rows.
maxRowThe maximal number of rows.
nColThe number of columns (variables).
maxColThe maximal number of columns.
objAn array with the objective function coefficients.
lBoundAn array with the lower bounds of the columns.
uBoundAn array with the upper bounds of the columns.
rowsAn array storing the rows of the problem.

Implements abacus::LP.

◆ _lBound()

virtual double abacus::OsiIF::_lBound ( int  i) const
inlineoverrideprivatevirtual

Returns the lower bound of column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 213 of file osiif.h.

◆ _loadBasis()

virtual void abacus::OsiIF::_loadBasis ( Array< LPVARSTAT::STATUS > &  lpVarStat,
Array< SlackStat::STATUS > &  slackStat 
)
overrideprivatevirtual

Loads a basis to the solver.

Parameters
lpVarStatAn array storing the status of the columns.
slackStatAn array storing the status of the slack variables.

Implements abacus::LP.

◆ _lpVarStat()

virtual LPVARSTAT::STATUS abacus::OsiIF::_lpVarStat ( int  i) const
overrideprivatevirtual

Returns the status of the column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _maxCol()

virtual int abacus::OsiIF::_maxCol ( ) const
inlineoverrideprivatevirtual

Returns the maximal number of columns of the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 199 of file osiif.h.

◆ _maxRow()

virtual int abacus::OsiIF::_maxRow ( ) const
inlineoverrideprivatevirtual

Returns the maximal number of rows of the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 185 of file osiif.h.

◆ _nCol()

virtual int abacus::OsiIF::_nCol ( ) const
inlineoverrideprivatevirtual

Returns the number of columns of the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 193 of file osiif.h.

◆ _nnz()

virtual int abacus::OsiIF::_nnz ( ) const
inlineoverrideprivatevirtual

Returns the number of nonzero elements in the constraint matrix (not including the right hand side).

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 237 of file osiif.h.

◆ _nRow()

virtual int abacus::OsiIF::_nRow ( ) const
inlineoverrideprivatevirtual

Returns the number of rows of the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 179 of file osiif.h.

◆ _obj()

virtual double abacus::OsiIF::_obj ( int  i) const
inlineoverrideprivatevirtual

Returns the objective function coefficient of column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 207 of file osiif.h.

◆ _pivotSlackVariableIn()

virtual int abacus::OsiIF::_pivotSlackVariableIn ( ArrayBuffer< int > &  rows)
overrideprivatevirtual

Pivots the slack variables stored in the buffer rows into the basis.

This function defines the pure virtual function of the base class LP. This function is currently not supported by the interface.

Returns
0 All variables could be pivoted in, 1 otherwise.
Parameters
rowsThe numbers of the slack variables that should be pivoted in.

Implements abacus::LP.

◆ _primalSimplex()

virtual OPTSTAT abacus::OsiIF::_primalSimplex ( )
overrideprivatevirtual

Calls the primal simplex method.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _reco()

virtual double abacus::OsiIF::_reco ( int  i) const
inlineoverrideprivatevirtual

Returns the reduced cost of the column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 285 of file osiif.h.

◆ _remCols()

virtual void abacus::OsiIF::_remCols ( ArrayBuffer< int > &  vars)
overrideprivatevirtual

Removes the columns listed in vars.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _remRows()

virtual void abacus::OsiIF::_remRows ( ArrayBuffer< int > &  ind)
overrideprivatevirtual

Removes the rows listed in ind.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _rhs()

virtual double abacus::OsiIF::_rhs ( int  i) const
inlineoverrideprivatevirtual

Returns the right hand side of row i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 225 of file osiif.h.

◆ _row()

virtual void abacus::OsiIF::_row ( int  i,
Row r 
) const
overrideprivatevirtual

Stores a copy of row i in r.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _rowRealloc()

void abacus::OsiIF::_rowRealloc ( int  newSize)
overrideprivatevirtual

Reallocates the internal memory such that newSize rows can be stored.

This function is obsolete, as memory management is completely handled by Osi.

It implements the corresponding pure virtual function of the base class LP. If a reallocation is performed in the base class LP, we reinitialize the internal data structure. Actually this reinitialization is redundant since it would be performed automatically if addRows() or addCols() fail. However, to be consistent, and if a reallocation is performed to decrease the size of the arrays we call reinitialize().

Implements abacus::LP.

◆ _sense() [1/2]

virtual OptSense abacus::OsiIF::_sense ( ) const
overrideprivatevirtual

Returns the sense of the optimization.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _sense() [2/2]

virtual void abacus::OsiIF::_sense ( const OptSense newSense)
overrideprivatevirtual

Changes the sense of the optimization to newSense.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _setSimplexIterationLimit()

virtual int abacus::OsiIF::_setSimplexIterationLimit ( int  limit)
inlineoverrideprivatevirtual

Changes the iteration limit of the Simplex algorithm.

This function defines a pure virtual function of the base class LP.

Parameters
limitThe new value of the iteration limit.
Returns
0 If the iteration limit could be set, 1 otherwise.

Implements abacus::LP.

Definition at line 451 of file osiif.h.

◆ _slack()

virtual double abacus::OsiIF::_slack ( int  i) const
overrideprivatevirtual

Returns the value of the slack column of the row i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _slackStat()

virtual SlackStat::STATUS abacus::OsiIF::_slackStat ( int  i) const
overrideprivatevirtual

Returns the status of the slack column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

◆ _uBound()

virtual double abacus::OsiIF::_uBound ( int  i) const
inlineoverrideprivatevirtual

Returns the upper bound of column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 219 of file osiif.h.

◆ _value()

virtual double abacus::OsiIF::_value ( ) const
inlineoverrideprivatevirtual

Returns the optimum value of the linear program.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 267 of file osiif.h.

◆ _xVal()

virtual double abacus::OsiIF::_xVal ( int  i) const
inlineoverrideprivatevirtual

Returns the value of the column i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 273 of file osiif.h.

◆ _yVal()

virtual double abacus::OsiIF::_yVal ( int  i) const
inlineoverrideprivatevirtual

Returns the value of the dual column of the row i.

It implements the pure virtual function of the base class LP.

Implements abacus::LP.

Definition at line 297 of file osiif.h.

◆ convertSenseToBound()

void abacus::OsiIF::convertSenseToBound ( double  inf,
const char  sense,
const double  right,
const double  range,
double &  lower,
double &  upper 
) const
inlineprivate

Definition at line 465 of file osiif.h.

◆ csense2osi()

char abacus::OsiIF::csense2osi ( CSense sense) const
private

Converts the ABACUS representation of the row sense to the Osi representation.

◆ currentSolverType()

SOLVERTYPE abacus::OsiIF::currentSolverType ( ) const
inline

Definition at line 89 of file osiif.h.

◆ freeChar() [1/2]

void abacus::OsiIF::freeChar ( char *&  ptr)
inlineprivate

Definition at line 122 of file osiif.h.

◆ freeChar() [2/2]

void abacus::OsiIF::freeChar ( const char *&  ptr)
inlineprivate

Definition at line 127 of file osiif.h.

◆ freeDouble() [1/2]

void abacus::OsiIF::freeDouble ( const double *&  ptr)
inlineprivate

Definition at line 107 of file osiif.h.

◆ freeDouble() [2/2]

void abacus::OsiIF::freeDouble ( double *&  ptr)
inlineprivate

Definition at line 112 of file osiif.h.

◆ freeInt()

void abacus::OsiIF::freeInt ( int *&  ptr)
inlineprivate

Definition at line 117 of file osiif.h.

◆ freeStatus()

void abacus::OsiIF::freeStatus ( CoinWarmStartBasis::Status *&  )
private

◆ getDefaultInterface()

OsiSolverInterface* abacus::OsiIF::getDefaultInterface ( )
private

Allocates an Open Solver Interface of type defaultOsiSolver.

◆ getSol()

void abacus::OsiIF::getSol ( )
private

Extracts the solution.

I.e., the value, the status, the values of the variables, slack variables, and dual variables, the reduced costs, and the statuses of the variables and slack variables form the internal solver data structure.

◆ loadDummyRow()

void abacus::OsiIF::loadDummyRow ( OsiSolverInterface *  s2,
const double *  lbounds,
const double *  ubounds,
const double *  objectives 
)
private

Initializes the problem with a dummy row.

To be used with CPLEX if there are no rows.

◆ lpVarStat2osi()

CoinWarmStartBasis::Status abacus::OsiIF::lpVarStat2osi ( LPVARSTAT::STATUS  stat) const
private

Converts the ABACUS variable status to OSI format.

◆ operator=()

const OsiIF& abacus::OsiIF::operator= ( const OsiIF rhs)
private

◆ osi2csense()

CSense::SENSE abacus::OsiIF::osi2csense ( char  sense) const
private

Converts the OSI representation of the row sense to the ABACUS representation.

◆ osi2lpVarStat()

LPVARSTAT::STATUS abacus::OsiIF::osi2lpVarStat ( CoinWarmStartBasis::Status  stat) const
private

Converts the OSI variable status to ABACUS format.

◆ osi2slackStat()

SlackStat::STATUS abacus::OsiIF::osi2slackStat ( CoinWarmStartBasis::Status  stat) const
private

Converts the OSI slack status to ABACUS format.

◆ osiLP()

OsiSolverInterface* abacus::OsiIF::osiLP ( )
inline

Definition at line 91 of file osiif.h.

◆ slackStat2osi()

CoinWarmStartBasis::Status abacus::OsiIF::slackStat2osi ( SlackStat::STATUS  stat) const
private

Converts the ABACUS slack status to OSI format.

◆ switchInterfaces()

OsiSolverInterface* abacus::OsiIF::switchInterfaces ( SOLVERTYPE  newMethod)
private

Switches between exact and approximate solvers.

Member Data Documentation

◆ barXVal_

const double* abacus::OsiIF::barXVal_
private

Definition at line 504 of file osiif.h.

◆ collower_

const double* abacus::OsiIF::collower_
private

An array storing the column lower bounds of the linear program.

Definition at line 537 of file osiif.h.

◆ colupper_

const double* abacus::OsiIF::colupper_
private

An array storing the column upper bounds of the linear program.

Definition at line 534 of file osiif.h.

◆ cStat_

char* abacus::OsiIF::cStat_
private

An array storing the statuses of the variables after the linear program has been optimized.

Definition at line 513 of file osiif.h.

◆ currentSolverType_

SOLVERTYPE abacus::OsiIF::currentSolverType_
private

The type of the current solver interface.

Definition at line 546 of file osiif.h.

◆ lpMasterOsi_

LpMasterOsi* abacus::OsiIF::lpMasterOsi_
private

Definition at line 496 of file osiif.h.

◆ numCols_

int abacus::OsiIF::numCols_
private

The number of columns currently used in the LP.

Definition at line 516 of file osiif.h.

◆ numRows_

int abacus::OsiIF::numRows_
private

The number of rows currently used in the LP.

Definition at line 519 of file osiif.h.

◆ objcoeff_

const double* abacus::OsiIF::objcoeff_
private

An array storing the objective function coefficients of the linear program.

Definition at line 540 of file osiif.h.

◆ osiLP_

OsiSolverInterface* abacus::OsiIF::osiLP_
private

Pointer to the Osi solver interface.

It is later typecast to a pointer to an object of a solver specific derived class. See osiif.cc, OsiIF::_initialize.

Definition at line 101 of file osiif.h.

◆ reco_

double* abacus::OsiIF::reco_
private

An array storing the values of the reduced costs after the linear program has been optimized.

Definition at line 507 of file osiif.h.

◆ rhs_

const double* abacus::OsiIF::rhs_
private

An array storing the right hand sides of the linear program.

Definition at line 525 of file osiif.h.

◆ rowactivity_

double* abacus::OsiIF::rowactivity_
private

An array storing the row activity of the linear program.

Definition at line 528 of file osiif.h.

◆ rowsense_

const char* abacus::OsiIF::rowsense_
private

An array storing the row senses of the linear program.

Definition at line 531 of file osiif.h.

◆ rStat_

char* abacus::OsiIF::rStat_
private

An array storing the statuses of the slack variables after the linear program has been optimized.

Definition at line 522 of file osiif.h.

◆ value_

double abacus::OsiIF::value_
private

The value of the optimal solution.

Definition at line 499 of file osiif.h.

◆ ws_

CoinWarmStartBasis* abacus::OsiIF::ws_
private

A warm start object storing information about a basis of the linear program.

Definition at line 543 of file osiif.h.

◆ xVal_

double* abacus::OsiIF::xVal_
private

An array storing the values of the variables after the linear program has been optimized.

Definition at line 502 of file osiif.h.

◆ yVal_

double* abacus::OsiIF::yVal_
private

An array storing the values of the dual variables after the linear program has been optimized.

Definition at line 510 of file osiif.h.


The documentation for this class was generated from the following file: