ABA_OSIIF Class Reference

#include <osiif.h>

Inheritance diagram for ABA_OSIIF:

ABA_LP ABA_ABACUSROOT ABA_LPSUBOSI List of all members.

Public Types

enum  SOLVERTYPE { Exact, Approx }

Public Member Functions

 ABA_OSIIF (ABA_MASTER *master)
 This constructor does not initialize the problem data of the linear program. It must be loaded later with the function initialize().
 ABA_OSIIF (ABA_MASTER *master, ABA_OPTSENSE sense, int nRow, int maxRow, int nCol, int maxCol, ABA_ARRAY< double > &obj, ABA_ARRAY< double > &lb, ABA_ARRAY< double > &ub, ABA_ARRAY< ABA_ROW * > &rows)
virtual ~ABA_OSIIF ()
 The destructor.
SOLVERTYPE currentSolverType ()
OsiSolverInterface * osiLP ()

Private Member Functions

void freeDouble (const double *&)
void freeDouble (double *&)
void freeInt (int *&)
void freeChar (char *&)
void freeChar (const char *&)
void freeStatus (CoinWarmStartBasis::Status *&)
virtual void _initialize (ABA_OPTSENSE sense, int nRow, int maxRow, int nCol, int maxCol, ABA_ARRAY< double > &obj, ABA_ARRAY< double > &lBound, ABA_ARRAY< double > &uBound, ABA_ARRAY< ABA_ROW * > &rows)
 Implements the corresponding pure virtual function of the base class LP and loads the linear program defined by the following arguments to the solver.
virtual void _loadBasis (ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat)
virtual ABA_OPTSENSE _sense () const
virtual void _sense (const ABA_OPTSENSE &newSense)
 This version of the function _sense() changes the sense of the optimization.
virtual int _nRow () const
virtual int _maxRow () const
virtual int _nCol () const
virtual int _maxCol () const
virtual double _obj (int i) const
virtual double _lBound (int i) const
virtual double _uBound (int i) const
virtual double _rhs (int i) const
virtual void _row (int i, ABA_ROW &r) const
virtual int _nnz () const
 Returns the number of nonzero elements in the constraint matrix (not including the right hand side).
virtual OPTSTAT _primalSimplex ()
virtual OPTSTAT _dualSimplex ()
virtual OPTSTAT _barrier (bool doCrossover)
virtual OPTSTAT _approx ()
virtual double _value () const
virtual double _xVal (int i)
virtual double _barXVal (int i)
virtual double _reco (int i)
virtual double _slack (int i)
virtual double _yVal (int i)
virtual ABA_LPVARSTAT::STATUS _lpVarStat (int i)
virtual ABA_SLACKSTAT::STATUS _slackStat (int i)
virtual int _getInfeas (int &infeasRow, int &infeasCol, double *bInvRow)
 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.
virtual void _remRows (ABA_BUFFER< int > &ind)
virtual void _addRows (ABA_BUFFER< ABA_ROW * > &newRows)
virtual void _remCols (ABA_BUFFER< int > &vars)
virtual void _addCols (ABA_BUFFER< ABA_COLUMN * > &newVars)
virtual void _changeRhs (ABA_ARRAY< double > &newRhs)
virtual void _changeLBound (int i, double newLb)
virtual void _changeUBound (int i, double newUb)
virtual int _pivotSlackVariableIn (ABA_BUFFER< int > &rows)
 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.
void getSol ()
 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.
char csense2osi (ABA_CSENSE *sense) const
 Converts the ABACUS representation of the row sense to the Osi representation.
ABA_CSENSE::SENSE osi2csense (char sense) const
 Converts the OSI representation of the row sense to the ABACUS representation.
CoinWarmStartBasis::Status lpVarStat2osi (ABA_LPVARSTAT::STATUS stat) const
 Converts the ABACUS variable status to OSI format.
ABA_LPVARSTAT::STATUS osi2lpVarStat (CoinWarmStartBasis::Status stat) const
 Converts the OSI variable status to ABACUS format.
CoinWarmStartBasis::Status slackStat2osi (ABA_SLACKSTAT::STATUS stat) const
 Converts the ABACUS slack status to OSI format.
ABA_SLACKSTAT::STATUS osi2slackStat (CoinWarmStartBasis::Status stat) const
 Converts the OSI slack status to ABACUS format.
OsiSolverInterface * getDefaultInterface ()
 Allocates an Open Solver Interface of type defaultOsiSolver.
OsiSolverInterface * switchInterfaces (SOLVERTYPE newMethod)
 Switches between exact and approximate solvers.
void loadDummyRow (OsiSolverInterface *s2, const double *lbounds, const double *ubounds, const double *objectives)
 Initializes the problem with a dummy row To be used with CPLEX if there are no rows.
void _rowRealloc (int newSize)
void _colRealloc (int newSize)
virtual int _setSimplexIterationLimit (int limit)
virtual int _getSimplexIterationLimit (int &limit)
 ABA_OSIIF (const ABA_OSIIF &rhs)
const ABA_OSIIFoperator= (const ABA_OSIIF &rhs)
void convertSenseToBound (double inf, const char sense, const double right, const double range, double &lower, double &upper) const

Private Attributes

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

Detailed Description

Definition at line 43 of file osiif.h.


Member Enumeration Documentation

enum ABA_OSIIF::SOLVERTYPE

The enumeration of possible solver types

Enumerator:
Exact 
Approx 

Definition at line 85 of file osiif.h.


Constructor & Destructor Documentation

ABA_OSIIF::ABA_OSIIF ( ABA_MASTER master  ) 

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

Parameters:
master A pointer to the corresponding master of the optimization.

ABA_OSIIF::ABA_OSIIF ( ABA_MASTER master,
ABA_OPTSENSE  sense,
int  nRow,
int  maxRow,
int  nCol,
int  maxCol,
ABA_ARRAY< double > &  obj,
ABA_ARRAY< double > &  lb,
ABA_ARRAY< double > &  ub,
ABA_ARRAY< ABA_ROW * > &  rows 
)

A constructor with initialization.

Parameters:
master A pointer to the corresponding master of the optimization.
sense The sense of the objective function.
nCol The number of columns (variables).
maxCol The maximal number of columns.
nRow The number of rows.
maxRow The maximal number of rows.
obj An array with the objective function coefficients.
lb An array with the lower bounds of the columns.
ub An array with the upper bounds of the columns.
rows An array storing the rows of the problem.

virtual ABA_OSIIF::~ABA_OSIIF (  )  [virtual]

The destructor.

ABA_OSIIF::ABA_OSIIF ( const ABA_OSIIF rhs  )  [private]


Member Function Documentation

SOLVERTYPE ABA_OSIIF::currentSolverType (  )  [inline]

Definition at line 87 of file osiif.h.

OsiSolverInterface * ABA_OSIIF::osiLP (  )  [inline]

Definition at line 559 of file osiif.h.

void ABA_OSIIF::freeDouble ( const double *&   )  [private]

void ABA_OSIIF::freeDouble ( double *&   )  [private]

void ABA_OSIIF::freeInt ( int *&   )  [private]

void ABA_OSIIF::freeChar ( char *&   )  [private]

void ABA_OSIIF::freeChar ( const char *&   )  [private]

void ABA_OSIIF::freeStatus ( CoinWarmStartBasis::Status *&   )  [private]

virtual void ABA_OSIIF::_initialize ( ABA_OPTSENSE  sense,
int  nRow,
int  maxRow,
int  nCol,
int  maxCol,
ABA_ARRAY< double > &  obj,
ABA_ARRAY< double > &  lBound,
ABA_ARRAY< double > &  uBound,
ABA_ARRAY< ABA_ROW * > &  rows 
) [private, virtual]

Implements the corresponding pure virtual function of the base class LP and loads the linear program defined by the following arguments to the solver.

Parameters:
sense The sense of the objective function.
nCol The number of columns (variables).
maxCol The maximal number of columns.
nRow The number of rows.
maxRow The maximal number of rows.
obj An array with the objective function coefficients.
lb An array with the lower bounds of the columns.
ub An array with the upper bounds of the columns.
rows An array storing the rows of the problem.

Implements ABA_LP.

virtual void ABA_OSIIF::_loadBasis ( ABA_ARRAY< ABA_LPVARSTAT::STATUS > &  lpVarStat,
ABA_ARRAY< ABA_SLACKSTAT::STATUS > &  slackStat 
) [private, virtual]

Loads a basis to the solver

Parameters:
lpVarStat An array storing the status of the columns.
lpVarStat An array storing the status of the slack variables.

Implements ABA_LP.

virtual ABA_OPTSENSE ABA_OSIIF::_sense (  )  const [private, virtual]

Returns the sense of the optimization.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_sense ( const ABA_OPTSENSE newSense  )  [private, virtual]

This version of the function _sense() changes the sense of the optimization.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_nRow (  )  const [private, virtual]

Returns the number of rows of the linear program.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_maxRow (  )  const [private, virtual]

Returns the maximal number of rows of the linear program.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_nCol (  )  const [private, virtual]

Returns the number of columns of the linear program.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_maxCol (  )  const [private, virtual]

Returns the maximal number of columns of the linear program.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_obj ( int  i  )  const [private, virtual]

Returns the objective function coefficient of column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_lBound ( int  i  )  const [private, virtual]

Returns the lower bound of column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_uBound ( int  i  )  const [private, virtual]

Returns the upper bound of column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_rhs ( int  i  )  const [private, virtual]

Returns the right hand side of row i.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_row ( int  i,
ABA_ROW r 
) const [private, virtual]

Stores a copy of row i in r.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_nnz (  )  const [private, virtual]

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 ABA_LP.

virtual OPTSTAT ABA_OSIIF::_primalSimplex (  )  [private, virtual]

Calls the primal simplex method.

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

Implements ABA_LP.

virtual OPTSTAT ABA_OSIIF::_dualSimplex (  )  [private, virtual]

Calls the dual simplex method.

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

Implements ABA_LP.

virtual OPTSTAT ABA_OSIIF::_barrier ( bool  doCrossover  )  [private, virtual]

Calls the barrier method.

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

Implements ABA_LP.

virtual OPTSTAT ABA_OSIIF::_approx (  )  [private, virtual]

Calls an approximate method.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_value (  )  const [private, virtual]

Returns the optimum value of the linear program.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_xVal ( int  i  )  [private, virtual]

Returns the value of the column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_barXVal ( int  i  )  [private, virtual]

Returns the value of the column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_reco ( int  i  )  [private, virtual]

Returns the reduced cost of the column i.

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

Implements ABA_LP.

virtual double ABA_OSIIF::_slack ( int  i  )  [private, virtual]

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

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

Implements ABA_LP.

virtual double ABA_OSIIF::_yVal ( int  i  )  [private, virtual]

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

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

Implements ABA_LP.

virtual ABA_LPVARSTAT::STATUS ABA_OSIIF::_lpVarStat ( int  i  )  [private, virtual]

Returns the status of the column i.

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

Implements ABA_LP.

virtual ABA_SLACKSTAT::STATUS ABA_OSIIF::_slackStat ( int  i  )  [private, virtual]

Returns the status of the slack column i.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_getInfeas ( int &  infeasRow,
int &  infeasCol,
double *  bInvRow 
) [private, virtual]

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 ABA_LP.

virtual void ABA_OSIIF::_remRows ( ABA_BUFFER< int > &  ind  )  [private, virtual]

Removes the rows listed in ind.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_addRows ( ABA_BUFFER< ABA_ROW * > &  newRows  )  [private, virtual]

Adds the rows to the linear program.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_remCols ( ABA_BUFFER< int > &  vars  )  [private, virtual]

Removes the columns listed in vars.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_addCols ( ABA_BUFFER< ABA_COLUMN * > &  newVars  )  [private, virtual]

Adds the columns newCols to the linear program.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_changeRhs ( ABA_ARRAY< double > &  newRhs  )  [private, virtual]

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 ABA_LP.

virtual void ABA_OSIIF::_changeLBound ( int  i,
double  newLb 
) [private, virtual]

Sets the lower bound of column i to newLb.

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

Implements ABA_LP.

virtual void ABA_OSIIF::_changeUBound ( int  i,
double  newUb 
) [private, virtual]

Sets the upper bound of column i to newLb.

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

Implements ABA_LP.

virtual int ABA_OSIIF::_pivotSlackVariableIn ( ABA_BUFFER< int > &  rows  )  [private, virtual]

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:
rows The numbers of the slack variables that should be pivoted in.

Implements ABA_LP.

void ABA_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.

char ABA_OSIIF::csense2osi ( ABA_CSENSE sense  )  const [private]

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

ABA_CSENSE::SENSE ABA_OSIIF::osi2csense ( char  sense  )  const [private]

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

CoinWarmStartBasis::Status ABA_OSIIF::lpVarStat2osi ( ABA_LPVARSTAT::STATUS  stat  )  const [private]

Converts the ABACUS variable status to OSI format.

ABA_LPVARSTAT::STATUS ABA_OSIIF::osi2lpVarStat ( CoinWarmStartBasis::Status  stat  )  const [private]

Converts the OSI variable status to ABACUS format.

CoinWarmStartBasis::Status ABA_OSIIF::slackStat2osi ( ABA_SLACKSTAT::STATUS  stat  )  const [private]

Converts the ABACUS slack status to OSI format.

ABA_SLACKSTAT::STATUS ABA_OSIIF::osi2slackStat ( CoinWarmStartBasis::Status  stat  )  const [private]

Converts the OSI slack status to ABACUS format.

OsiSolverInterface* ABA_OSIIF::getDefaultInterface (  )  [private]

Allocates an Open Solver Interface of type defaultOsiSolver.

OsiSolverInterface* ABA_OSIIF::switchInterfaces ( SOLVERTYPE  newMethod  )  [private]

Switches between exact and approximate solvers.

void ABA_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.

void ABA_OSIIF::_rowRealloc ( int  newSize  )  [private, virtual]

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 ABA_LP.

void ABA_OSIIF::_colRealloc ( int  newSize  )  [private, virtual]

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 ABA_LP.

virtual int ABA_OSIIF::_setSimplexIterationLimit ( int  limit  )  [private, virtual]

Changes the iteration limit of the Simplex algorithm.

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

Returns:
0 If the iteration limit could be set,

1 otherwise.

Parameters:
limit The new value of the iteration limit.

Implements ABA_LP.

virtual int ABA_OSIIF::_getSimplexIterationLimit ( int &  limit  )  [private, virtual]

Defines a pure virtual function of the base class LP.

Returns:
0 If the iteration limit could be retrieved,

1 otherwise.

Parameters:
limit Stores the iteration limit if the return value is 0.

Implements ABA_LP.

const ABA_OSIIF& ABA_OSIIF::operator= ( const ABA_OSIIF rhs  )  [private]

void ABA_OSIIF::convertSenseToBound ( double  inf,
const char  sense,
const double  right,
const double  range,
double &  lower,
double &  upper 
) const [inline, private]

Definition at line 530 of file osiif.h.


Member Data Documentation

OsiSolverInterface* ABA_OSIIF::osiLP_ [private]

Definition at line 100 of file osiif.h.

ABA_LPMASTEROSI* ABA_OSIIF::lpMasterOsi_ [private]

Definition at line 454 of file osiif.h.

double ABA_OSIIF::value_ [private]

The value of the optimal solution.

Definition at line 458 of file osiif.h.

const double* ABA_OSIIF::xVal_ [private]

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

Definition at line 463 of file osiif.h.

const double* ABA_OSIIF::barXVal_ [private]

Definition at line 464 of file osiif.h.

const double* ABA_OSIIF::reco_ [private]

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

Definition at line 469 of file osiif.h.

const double* ABA_OSIIF::yVal_ [private]

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

Definition at line 474 of file osiif.h.

const char* ABA_OSIIF::cStat_ [private]

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

Definition at line 479 of file osiif.h.

int ABA_OSIIF::numCols_ [private]

The number of columns currently used in the LP.

Definition at line 483 of file osiif.h.

int ABA_OSIIF::numRows_ [private]

The number of rows currently used in the LP.

Definition at line 487 of file osiif.h.

const char* ABA_OSIIF::rStat_ [private]

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

Definition at line 492 of file osiif.h.

const double* ABA_OSIIF::rhs_ [private]

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

Definition at line 496 of file osiif.h.

const double* ABA_OSIIF::rowactivity_ [private]

An array storing the row activity of the linear program.

Definition at line 500 of file osiif.h.

const char* ABA_OSIIF::rowsense_ [private]

An array storing the row senses of the linear program.

Definition at line 504 of file osiif.h.

const double* ABA_OSIIF::colupper_ [private]

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

Definition at line 508 of file osiif.h.

const double* ABA_OSIIF::collower_ [private]

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

Definition at line 512 of file osiif.h.

const double* ABA_OSIIF::objcoeff_ [private]

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

Definition at line 516 of file osiif.h.

CoinWarmStartBasis* ABA_OSIIF::ws_ [private]

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

Definition at line 520 of file osiif.h.

SOLVERTYPE ABA_OSIIF::currentSolverType_ [private]

The type of the current solver interface.

Definition at line 524 of file osiif.h.


The documentation for this class was generated from the following file:
Generated on Tue Aug 14 18:09:58 2007 for ABACUS by  doxygen 1.5.1