ABA_LP Class Reference

section provides a generic interface class to linear programs, from which we will derive further classes both for the solution of LP-relaxations (ABA_LPSUB) with a \ algorithm and for interfaces to LP-solvers (ABA_OSIIF). More...

#include <lp.h>

Inheritance diagram for ABA_LP:

ABA_ABACUSROOT ABA_LPSUB ABA_OSIIF ABA_LPSUBOSI ABA_LPSUBOSI List of all members.

Public Types

enum  OPTSTAT {
  Optimal, Unoptimized, Error, Feasible,
  Infeasible, Unbounded
}
enum  SOLSTAT { Available, Missing }
 This enumeration describes if parts of the solution like $x$-values, reduced costs, etc. are available. More...
enum  METHOD {
  Primal, Dual, BarrierAndCrossover, BarrierNoCrossover,
  Approximate
}

Public Member Functions

 ABA_LP (ABA_MASTER *master)
virtual ~ABA_LP ()
 The destructor.
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)
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, ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat)
 This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments:.
virtual void loadBasis (ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat)
ABA_OPTSENSE sense () const
void sense (const ABA_OPTSENSE &newSense)
int nRow () const
int maxRow () const
int nCol () const
int maxCol () const
int nnz () const
double obj (int i) const
double lBound (int i) const
double uBound (int i) const
void row (int i, ABA_ROW &r) const
double rhs (int i) const
virtual double value () const
virtual double xVal (int i)
virtual double barXVal (int i)
virtual double reco (int i)
virtual double yVal (int c)
virtual double slack (int c)
SOLSTAT xValStatus () const
SOLSTAT barXValStatus () const
SOLSTAT yValStatus () const
SOLSTAT recoStatus () const
SOLSTAT slackStatus () const
SOLSTAT basisStatus () const
int nOpt () const
virtual bool infeasible () const
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 and all inactive variables price out correctly.
virtual ABA_LPVARSTAT::STATUS lpVarStat (int i)
virtual ABA_SLACKSTAT::STATUS slackStat (int i)
virtual OPTSTAT optimize (METHOD method)
void remRows (ABA_BUFFER< int > &ind)
void addRows (ABA_BUFFER< ABA_ROW * > &newRows)
void remCols (ABA_BUFFER< int > &cols)
void addCols (ABA_BUFFER< ABA_COLUMN * > &newCols)
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)
void rowRealloc (int newSize)
void colRealloc (int newSize)
int writeBasisMatrix (const char *fileName)
 Writes the complete basis of an optimal linear program to a file.
int setSimplexIterationLimit (int limit)
int getSimplexIterationLimit (int &limit)
ABA_CPUTIMERlpSolverTime ()

Protected Member Functions

void colsNnz (int nRow, ABA_ARRAY< ABA_ROW * > &rows, ABA_ARRAY< int > &nnz)
void rows2cols (int nRow, ABA_ARRAY< ABA_ROW * > &rows, ABA_ARRAY< ABA_SPARVEC * > &cols)
void rowRangeCheck (int r) const
void colRangeCheck (int i) const
virtual ABA_OPTSENSE _sense () const=0
 The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the optimization.
virtual void _sense (const ABA_OPTSENSE &newSense)=0
virtual int _nRow () const=0
 The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows of the problem.
virtual int _maxRow () const=0
 The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal number of rows.
virtual int _nCol () const=0
 The pure virtual function _nCol() must be defined by the used LP-solver and return the number of columns.
virtual int _maxCol () const=0
 The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal number of columns.
virtual int _nnz () const=0
 The pure virtual function _nnz() must be defined by the used LP-solver and return the number of nonzero elements of the constraint matrix not including the right hand side and the bounds of the variables.
virtual double _obj (int i) const=0
 The pure virtual function _obj() must be defined by the used LP-solver and return the objective function coefficient of variable i.
virtual double _lBound (int i) const=0
 The pure virtual function _lBound() must be defined by the used LP-solver and return the lower bound of variable i.
virtual double _uBound (int i) const=0
 The pure virtual function _uBound() must be defined by the used LP-solver and return the upper bound of variable i.
virtual double _rhs (int i) const=0
 The pure virtual function _rhs() must be defined by the used LP-solver and return the right hand side of constraint i.
virtual void _row (int i, ABA_ROW &r) const=0
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)=0
 The pure virtual function _initialize() must be defined by the used LP-solver and should initialize the LP-solver with.
virtual void _loadBasis (ABA_ARRAY< ABA_LPVARSTAT::STATUS > &lpVarStat, ABA_ARRAY< ABA_SLACKSTAT::STATUS > &slackStat)=0
virtual OPTSTAT _primalSimplex ()=0
 The pure virtual function _primalSimplex() must be defined by the used LP-solver and should call the primal simplex method of the used LP-solver.
virtual OPTSTAT _dualSimplex ()=0
 The pure virtual function _dualSimplex() must be defined by the used LP-solver and should call the dual simplex method of the used LP-solver.
virtual OPTSTAT _barrier (bool doCrossover)=0
 The pure virtual function _barrier() must be defined by the used LP-solver and should call the barrier method of the used LP-solver.
virtual OPTSTAT _approx ()=0
 The pure virtual function _approx() must be defined by the used LP-solver and should call the approximative method of the used LP-solver.
virtual double _value () const=0
 The pure virtual function _value() must be defined by the used LP-solver and should return the optimum value of the linear program after it has been solved.
virtual double _xVal (int i)=0
 The pure virtual function _xVal() must be defined by the used LP-solver and should return the value of variable i in the LP-solution.
virtual double _barXVal (int i)=0
virtual double _reco (int i)=0
 The pure virtual function _reco() must be defined by the used LP-solver and should return the reduced cost of variable i.
virtual double _slack (int i)=0
 The pure virtual function _slack() must be defined by the used LP-solver and should return the value of the slack variable i.
virtual double _yVal (int i)=0
 The pure virtual function _yVal() must be defined by the used LP-solver and should return the value of the dual variable of the constraint i.
virtual ABA_LPVARSTAT::STATUS _lpVarStat (int i)=0
 The pure virtual function _lpVarStat() must be defined by the used LP-solver and should return the status of the variable i in the LP-solution.
virtual ABA_SLACKSTAT::STATUS _slackStat (int i)=0
 The pure virtual function _slackStat() must be defined by the used LP-solver and should return the status of the slack variable i in the LP-solution.
virtual int _getInfeas (int &infeasRow, int &infeasCol, double *bInvRow)=0
 The pure virtual function _getInfeas() must be defined by the used LP-solver and can be called if the last linear program has been solved with the dual simplex method and is infeasible.
virtual void _remRows (ABA_BUFFER< int > &ind)=0
 The pure virtual function _remRows() must be defined by the used LP-solver and should remove the rows with numbers given in the buffer ind from the LP-solver.
virtual void _addRows (ABA_BUFFER< ABA_ROW * > &newRows)=0
 The pure virtual function _addRows() must be defined by the used LP-solver and should add the rows given in the buffer newRows to the LP.
virtual void _remCols (ABA_BUFFER< int > &vars)=0
 The pure virtual function _remCols() must be defined by the used LP-solver and should remove the columns with numbers given in vars from the LP.
virtual void _addCols (ABA_BUFFER< ABA_COLUMN * > &newCols)=0
 The pure virtual function _addCols() must be defined by the used LP-solver and should add the columns newCols to the LP.
virtual void _changeRhs (ABA_ARRAY< double > &newRhs)=0
 The pure virtual function _changeRhs() must be defined by the used LP-solver and should set the right hand side of the constraint matrix of the LP to newRhs.
virtual void _changeLBound (int i, double newLb)=0
 The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the lower bound of variable i to newLb.
virtual void _changeUBound (int i, double newUb)=0
 The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the upper bound of variable i to newUb.
virtual int _pivotSlackVariableIn (ABA_BUFFER< int > &rows)=0
 The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis.
virtual void _rowRealloc (int newSize)=0
 The pure virtual function _rowRealloc() must be defined in the used LP-solver and should reallocate its memory such that up to newSize rows can be handled.
virtual void _colRealloc (int newSize)=0
 The pure virtual function _colRealloc() must be defined by the used LP-solver and should reallocate its memory such that up to newSize columns can be handled.
virtual int _setSimplexIterationLimit (int limit)=0
 The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm.
virtual int _getSimplexIterationLimit (int &limit)=0
 The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm.

Protected Attributes

ABA_MASTERmaster_
OPTSTAT optStat_
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.
SOLSTAT barXValStatus_
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/.
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.
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.
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.
int nOpt_
ABA_CPUTIMER lpSolverTime_

Private Member Functions

void initPostOpt ()
 Resets the optimization status and the availability statuses of the solution.
 ABA_LP (const ABA_LP &rhs)
const ABA_LPoperator= (const ABA_LP &rhs)

Friends

ostream & operator<< (ostream &out, const ABA_LP &rhs)
 The output operator writes the objective function, followed by the constraints, the bounds on the columns and the solution values (if available) to an output stream.

Detailed Description

section provides a generic interface class to linear programs, from which we will derive further classes both for the solution of LP-relaxations (ABA_LPSUB) with a \ algorithm and for interfaces to LP-solvers (ABA_OSIIF).

Definition at line 70 of file lp.h.


Member Enumeration Documentation

enum ABA_LP::OPTSTAT

The optimization status of the linear program.

Parameters:
Unoptimized Optimization is still required, this is also the case for reoptimization.
Optimized The optimization has been performed, yet only a call to |()| can give us the status of optimization.
Error An error has happened during optimization.
Optimal The optimal solution has been computed.
Feasible A primal feasible solution for the linear program, but not the optimal solution has been found.
Infeasible The linear program is primal infeasible.
Unbounded The linear program is unbounded.
Enumerator:
Optimal 
Unoptimized 
Error 
Feasible 
Infeasible 
Unbounded 

Definition at line 87 of file lp.h.

enum ABA_LP::SOLSTAT

This enumeration describes if parts of the solution like $x$-values, reduced costs, etc. are available.

Parameters:
Available The part of the solution is available.
Missing The part of the solution is missing.
Enumerator:
Available 
Missing 

Definition at line 96 of file lp.h.

enum ABA_LP::METHOD

The solution method for the linear program.

Parameters:
Primal The primal simplex method.
Dual The dual simplex method.
BarrierAndCrossover The barrier method followed by a crossover to a basis.
BarrierNoCrossover The barrier method without crossover.
Approximate An approximative solver
Enumerator:
Primal 
Dual 
BarrierAndCrossover 
BarrierNoCrossover 
Approximate 

Definition at line 107 of file lp.h.


Constructor & Destructor Documentation

ABA_LP::ABA_LP ( ABA_MASTER master  ) 

The constructor.

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

virtual ABA_LP::~ABA_LP (  )  [virtual]

The destructor.

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


Member Function Documentation

void ABA_LP::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 
)

Loads the linear program defined by its arguments.

We do not perform the initialization via arguments of a constructor, since for the most frequent application of linear programs within , the solution of the linear programming relaxations in the subproblems, the problem data is preprocessed before it is loaded. Only after the preprocessing in the constructor of the derived class, we can call initialize().

Of course, it would be possible to provide an extra constructor with automatic initialization if required.
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.

Reimplemented in ABA_LPSUB.

void ABA_LP::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,
ABA_ARRAY< ABA_LPVARSTAT::STATUS > &  lpVarStat,
ABA_ARRAY< ABA_SLACKSTAT::STATUS > &  slackStat 
)

This version of the function initialize() performs like its previous version, but also initializes the basis with the arguments:.

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

Reimplemented in ABA_LPSUB.

virtual void ABA_LP::loadBasis ( ABA_ARRAY< ABA_LPVARSTAT::STATUS > &  lpVarStat,
ABA_ARRAY< ABA_SLACKSTAT::STATUS > &  slackStat 
) [virtual]

Loads a new basis for the linear program.

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

Reimplemented in ABA_LPSUB.

ABA_OPTSENSE ABA_LP::sense (  )  const [inline]

Definition at line 705 of file lp.h.

void ABA_LP::sense ( const ABA_OPTSENSE newSense  )  [inline]

Definition at line 710 of file lp.h.

int ABA_LP::nRow (  )  const [inline]

Definition at line 715 of file lp.h.

int ABA_LP::maxRow (  )  const [inline]

Definition at line 720 of file lp.h.

int ABA_LP::nCol (  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 725 of file lp.h.

int ABA_LP::maxCol (  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 730 of file lp.h.

int ABA_LP::nnz (  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 735 of file lp.h.

double ABA_LP::obj ( int  i  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 740 of file lp.h.

double ABA_LP::lBound ( int  i  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 748 of file lp.h.

double ABA_LP::uBound ( int  i  )  const [inline]

Reimplemented in ABA_LPSUB.

Definition at line 756 of file lp.h.

void ABA_LP::row ( int  i,
ABA_ROW r 
) const [inline]

Definition at line 764 of file lp.h.

double ABA_LP::rhs ( int  i  )  const [inline]

Definition at line 772 of file lp.h.

double ABA_LP::value (  )  const [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 780 of file lp.h.

double ABA_LP::xVal ( int  i  )  [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 785 of file lp.h.

double ABA_LP::barXVal ( int  i  )  [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 793 of file lp.h.

double ABA_LP::reco ( int  i  )  [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 801 of file lp.h.

double ABA_LP::yVal ( int  c  )  [inline, virtual]

Definition at line 809 of file lp.h.

double ABA_LP::slack ( int  c  )  [inline, virtual]

Definition at line 817 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::xValStatus (  )  const [inline]

Definition at line 825 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::barXValStatus (  )  const [inline]

Definition at line 830 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::yValStatus (  )  const [inline]

Definition at line 840 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::recoStatus (  )  const [inline]

Definition at line 835 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::slackStatus (  )  const [inline]

Definition at line 845 of file lp.h.

ABA_LP::SOLSTAT ABA_LP::basisStatus (  )  const [inline]

Definition at line 850 of file lp.h.

int ABA_LP::nOpt (  )  const [inline]

Definition at line 855 of file lp.h.

bool ABA_LP::infeasible (  )  const [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 860 of file lp.h.

virtual int ABA_LP::getInfeas ( int &  infeasRow,
int &  infeasCol,
double *  bInvRow 
) [virtual]

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.

Then, the basis is dual feasible, but primal infeasible, i.e., some variables or slack variables violate their bounds. In this case the function getInfeas() determines an infeasible variable or slack variable.

Returns:
0 On success,

1 otherwise.

Parameters:
infeasRow Holds after the execution the number of an infeasible slack variable, or $-1$.
infeasVar Holds after the execution the number of an infeasible column, or $-1$.
bInvRow Holds after the execution the row of the basis inverse corresponding to the infeasible column or slack variable, which is always a basic variable. If getInfeas() is successful, then either infeasRow or infeasVar is $-1$ and the other argument holds the nonnegative number of the infeasible variable.

Reimplemented in ABA_LPSUB.

ABA_LPVARSTAT::STATUS ABA_LP::lpVarStat ( int  i  )  [inline, virtual]

Reimplemented in ABA_LPSUB.

Definition at line 866 of file lp.h.

ABA_SLACKSTAT::STATUS ABA_LP::slackStat ( int  i  )  [inline, virtual]

Definition at line 874 of file lp.h.

virtual OPTSTAT ABA_LP::optimize ( METHOD  method  )  [virtual]

Performs the optimization of the linear program.

Returns:
The status of the optimization.
Parameters:
method The method with which the optimization is performed.

Reimplemented in ABA_LPSUB.

void ABA_LP::remRows ( ABA_BUFFER< int > &  ind  ) 

Removes rows of the linear program.

Parameters:
ind The numbers of the rows that should be removed.

void ABA_LP::addRows ( ABA_BUFFER< ABA_ROW * > &  newRows  ) 

Adds rows to the linear program.

If the new number of rows exceeds the maximal number of rows a reallocation is performed.

Parameters:
newRows The rows that should be added to the linear program.

void ABA_LP::remCols ( ABA_BUFFER< int > &  cols  ) 

Removes columns from the linear program.

Parameters:
cols The numbers of the columns that should be removed.

void ABA_LP::addCols ( ABA_BUFFER< ABA_COLUMN * > &  newCols  ) 

Adds columns to the linear program.

If the new number of columns exceeds the maximal number of columns a reallocation is performed.

Parameters:
newCols The new columns that are added.

void ABA_LP::changeRhs ( ABA_ARRAY< double > &  newRhs  ) 

Changes the complete right hand side of the linear program.

Parameters:
newRhs The new right hand side of the rows.

virtual void ABA_LP::changeLBound ( int  i,
double  newLb 
) [virtual]

Changes the lower bound of a single column.

Parameters:
i The column.
newLb The new lower bound of the column.

Reimplemented in ABA_LPSUB.

virtual void ABA_LP::changeUBound ( int  i,
double  newUb 
) [virtual]

Changes the upper bound of a single column.

Parameters:
i The column.
newUb The new upper bound of the column.

Reimplemented in ABA_LPSUB.

virtual int ABA_LP::pivotSlackVariableIn ( ABA_BUFFER< int > &  rows  )  [virtual]

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

Returns:
0 All variables could be pivoted in,

1 otherwise.

Parameters:
rows The numbers of the slack variables that should be pivoted in.

void ABA_LP::rowRealloc ( int  newSize  ) 

Performs a reallocation of the row space of the linear program.

Parameters:
newSize The new maximal number of rows of the linear program.

Reimplemented in ABA_LPSUB.

void ABA_LP::colRealloc ( int  newSize  ) 

Performs a reallocation of the column space of the linear program.

Parameters:
newSize The new maximal number of columns of the linear program.

Reimplemented in ABA_LPSUB.

int ABA_LP::writeBasisMatrix ( const char *  fileName  ) 

Writes the complete basis of an optimal linear program to a file.

Returns:
0 If a basis is available and could be written,

1 otherwise.

Parameters:
fileName The name of the file the basis is written to.

int ABA_LP::setSimplexIterationLimit ( int  limit  ) 

Changes the iteration limit of the Simplex algorithm.

Returns:
0 If the iteration limit could be set,

1 otherwise.

Parameters:
limit The new value of the iteration limit.

int ABA_LP::getSimplexIterationLimit ( int &  limit  ) 

Returns:
0 If the iteration limit could be get,

1 otherwise.

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

ABA_CPUTIMER* ABA_LP::lpSolverTime (  )  [inline]

Definition at line 347 of file lp.h.

void ABA_LP::colsNnz ( int  nRow,
ABA_ARRAY< ABA_ROW * > &  rows,
ABA_ARRAY< int > &  nnz 
) [protected]

Computes the number of nonzero elements in each column of a given set of rows.

Parameters:
nRow The number of rows.
rows The array storing the rows.
nnz An array of length at least the number of columns of the linear program which will hold the number of nonzero elements of each column.

void ABA_LP::rows2cols ( int  nRow,
ABA_ARRAY< ABA_ROW * > &  rows,
ABA_ARRAY< ABA_SPARVEC * > &  cols 
) [protected]

Computes the columnwise representation of the row matrix.

Parameters:
nRow The number of rows.
rows The array storing the rows.
cols An array holding pointers to sparse vectors which will contain the columnwise representation of the constraint matrix defined by rows. The length of this array must be at least the number of columns. The elements of the array must not be 0-pointers. Sparse vectors of sufficient length should be allocated before the function is called. The size of these sparse vectors can be determined with the function colsNnz().

void ABA_LP::rowRangeCheck ( int  r  )  const [protected]

Terminates the program if there is no row with index r.

Parameters:
r The number of a row of the linear program.

void ABA_LP::colRangeCheck ( int  i  )  const [protected]

Terminates the program if there is no column with index i.

Parameters:
i The number of a column.

virtual ABA_OPTSENSE ABA_LP::_sense (  )  const [protected, pure virtual]

The pure virtual function _sense() must be defined by the used LP-solver and return the sense of the optimization.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_sense ( const ABA_OPTSENSE newSense  )  [protected, pure virtual]

Implemented in ABA_OSIIF.

virtual int ABA_LP::_nRow (  )  const [protected, pure virtual]

The pure virtual function _nRow() must be defined by the used LP-solver and return the number of rows of the problem.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_maxRow (  )  const [protected, pure virtual]

The pure virtual function _maxRow() must be defined by the used LP-solver and return the maximal number of rows.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_nCol (  )  const [protected, pure virtual]

The pure virtual function _nCol() must be defined by the used LP-solver and return the number of columns.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_maxCol (  )  const [protected, pure virtual]

The pure virtual function _maxCol() must be defined by the the used LP-solver and return the maximal number of columns.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_nnz (  )  const [protected, pure virtual]

The pure virtual function _nnz() must be defined by the used LP-solver and return the number of nonzero elements of the constraint matrix not including the right hand side and the bounds of the variables.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_obj ( int  i  )  const [protected, pure virtual]

The pure virtual function _obj() must be defined by the used LP-solver and return the objective function coefficient of variable i.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_lBound ( int  i  )  const [protected, pure virtual]

The pure virtual function _lBound() must be defined by the used LP-solver and return the lower bound of variable i.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_uBound ( int  i  )  const [protected, pure virtual]

The pure virtual function _uBound() must be defined by the used LP-solver and return the upper bound of variable i.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_rhs ( int  i  )  const [protected, pure virtual]

The pure virtual function _rhs() must be defined by the used LP-solver and return the right hand side of constraint i.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_row ( int  i,
ABA_ROW r 
) const [protected, pure virtual]

The pure virtual function _row() must be defined by the used LP-solver and store the i-th row of the problem in the row r.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_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 
) [protected, pure virtual]

The pure virtual function _initialize() must be defined by the used LP-solver and should initialize the LP-solver with.

Parameters:
sense The sense of the optimization.
nRow The number of rows.
maxRow The maximal number of rows.
nCol The number of columns.
maxCol The maximal number of columns.
obj An array with the objective functions coefficients.
lBound An array with the lower bounds of the variables.
uBound An array with the upper bounds of the variables.
rows An array storing the constraint matrix in row format.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_loadBasis ( ABA_ARRAY< ABA_LPVARSTAT::STATUS > &  lpVarStat,
ABA_ARRAY< ABA_SLACKSTAT::STATUS > &  slackStat 
) [protected, pure virtual]

This pure virtual function should load a basis into the LP-solver.

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

Implemented in ABA_OSIIF.

virtual OPTSTAT ABA_LP::_primalSimplex (  )  [protected, pure virtual]

The pure virtual function _primalSimplex() must be defined by the used LP-solver and should call the primal simplex method of the used LP-solver.

Implemented in ABA_OSIIF.

virtual OPTSTAT ABA_LP::_dualSimplex (  )  [protected, pure virtual]

The pure virtual function _dualSimplex() must be defined by the used LP-solver and should call the dual simplex method of the used LP-solver.

Implemented in ABA_OSIIF.

virtual OPTSTAT ABA_LP::_barrier ( bool  doCrossover  )  [protected, pure virtual]

The pure virtual function _barrier() must be defined by the used LP-solver and should call the barrier method of the used LP-solver.

Implemented in ABA_OSIIF.

virtual OPTSTAT ABA_LP::_approx (  )  [protected, pure virtual]

The pure virtual function _approx() must be defined by the used LP-solver and should call the approximative method of the used LP-solver.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_value (  )  const [protected, pure virtual]

The pure virtual function _value() must be defined by the used LP-solver and should return the optimum value of the linear program after it has been solved.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_xVal ( int  i  )  [protected, pure virtual]

The pure virtual function _xVal() must be defined by the used LP-solver and should return the value of variable i in the LP-solution.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_barXVal ( int  i  )  [protected, pure virtual]

Implemented in ABA_OSIIF.

virtual double ABA_LP::_reco ( int  i  )  [protected, pure virtual]

The pure virtual function _reco() must be defined by the used LP-solver and should return the reduced cost of variable i.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_slack ( int  i  )  [protected, pure virtual]

The pure virtual function _slack() must be defined by the used LP-solver and should return the value of the slack variable i.

Implemented in ABA_OSIIF.

virtual double ABA_LP::_yVal ( int  i  )  [protected, pure virtual]

The pure virtual function _yVal() must be defined by the used LP-solver and should return the value of the dual variable of the constraint i.

Implemented in ABA_OSIIF.

virtual ABA_LPVARSTAT::STATUS ABA_LP::_lpVarStat ( int  i  )  [protected, pure virtual]

The pure virtual function _lpVarStat() must be defined by the used LP-solver and should return the status of the variable i in the LP-solution.

Implemented in ABA_OSIIF.

virtual ABA_SLACKSTAT::STATUS ABA_LP::_slackStat ( int  i  )  [protected, pure virtual]

The pure virtual function _slackStat() must be defined by the used LP-solver and should return the status of the slack variable i in the LP-solution.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_getInfeas ( int &  infeasRow,
int &  infeasCol,
double *  bInvRow 
) [protected, pure virtual]

The pure virtual function _getInfeas() must be defined by the used LP-solver and can be called if the last linear program has been solved with the dual simplex method and is infeasible.

In this case it should compute the infeasible basic variable or constraint and the corresponding row bInvRow of the basis inverse. Either infeasRow or infeasCol is nonnegative. The nonnegative argument is an infeasible row or column, respectively.

Returns:
0 if it is successful

1 otherwise.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_remRows ( ABA_BUFFER< int > &  ind  )  [protected, pure virtual]

The pure virtual function _remRows() must be defined by the used LP-solver and should remove the rows with numbers given in the buffer ind from the LP-solver.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_addRows ( ABA_BUFFER< ABA_ROW * > &  newRows  )  [protected, pure virtual]

The pure virtual function _addRows() must be defined by the used LP-solver and should add the rows given in the buffer newRows to the LP.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_remCols ( ABA_BUFFER< int > &  vars  )  [protected, pure virtual]

The pure virtual function _remCols() must be defined by the used LP-solver and should remove the columns with numbers given in vars from the LP.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_addCols ( ABA_BUFFER< ABA_COLUMN * > &  newCols  )  [protected, pure virtual]

The pure virtual function _addCols() must be defined by the used LP-solver and should add the columns newCols to the LP.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_changeRhs ( ABA_ARRAY< double > &  newRhs  )  [protected, pure virtual]

The pure virtual function _changeRhs() must be defined by the used LP-solver and should set the right hand side of the constraint matrix of the LP to newRhs.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_changeLBound ( int  i,
double  newLb 
) [protected, pure virtual]

The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the lower bound of variable i to newLb.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_changeUBound ( int  i,
double  newUb 
) [protected, pure virtual]

The pure virtual function _changeLBound() must be defined by the used LP-solver and should set the upper bound of variable i to newUb.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_pivotSlackVariableIn ( ABA_BUFFER< int > &  rows  )  [protected, pure virtual]

The function pivotSlackVariableIn() pivots the slack variables stored in the buffer rows into the basis.

Returns:
0 All variables could be pivoted in,

1 otherwise.

Parameters:
rows The numbers of the slack variables that should be pivoted in.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_rowRealloc ( int  newSize  )  [protected, pure virtual]

The pure virtual function _rowRealloc() must be defined in the used LP-solver and should reallocate its memory such that up to newSize rows can be handled.

Implemented in ABA_OSIIF.

virtual void ABA_LP::_colRealloc ( int  newSize  )  [protected, pure virtual]

The pure virtual function _colRealloc() must be defined by the used LP-solver and should reallocate its memory such that up to newSize columns can be handled.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_setSimplexIterationLimit ( int  limit  )  [protected, pure virtual]

The function setSimplexIterationLimit() changes the iteration limit of the Simplex algorithm.

Returns:
0 If the iteration limit could be set,

1 otherwise.

Parameters:
limit The new value of the iteration limit.

Implemented in ABA_OSIIF.

virtual int ABA_LP::_getSimplexIterationLimit ( int &  limit  )  [protected, pure virtual]

The function getSimplexIterationLimit() retrieves the value of the iteration limit of the simplex algorithm.

Returns:
0 If the iteration limit could be get,

1 otherwise.

Parameters:
limit Stores the value of the iteration limit if the function returns 0.

Implemented in ABA_OSIIF.

void ABA_LP::initPostOpt (  )  [private]

Resets the optimization status and the availability statuses of the solution.

The function initPostOpt() must be called after each modification of the linear program. It resets the optimization status and the availability status of the solution.

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


Friends And Related Function Documentation

ostream& operator<< ( ostream &  out,
const ABA_LP rhs 
) [friend]

The output operator writes the objective function, followed by the constraints, the bounds on the columns and the solution values (if available) to an output stream.

Every ten output columns we perform a line break for better readability. This has also the advantage that LP-solvers with an input function requiring a limited length of a line (e.g., Cplex 255 characters) have a higher chance to read a file generated by this output operator.

Returns:
A reference to the output stream.
Parameters:
out The output stream.
rhs The linear program being output.


Member Data Documentation

ABA_MASTER* ABA_LP::master_ [protected]

A pointer to the corresponding master of the optimization.

Definition at line 644 of file lp.h.

OPTSTAT ABA_LP::optStat_ [protected]

The status of the linear program.

Definition at line 648 of file lp.h.

SOLSTAT ABA_LP::xValStatus_ [protected]

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.

Definition at line 654 of file lp.h.

SOLSTAT ABA_LP::barXValStatus_ [protected]

Definition at line 655 of file lp.h.

SOLSTAT ABA_LP::yValStatus_ [protected]

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

Definition at line 662 of file lp.h.

SOLSTAT ABA_LP::recoStatus_ [protected]

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.

Definition at line 668 of file lp.h.

SOLSTAT ABA_LP::slackStatus_ [protected]

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.

Definition at line 675 of file lp.h.

SOLSTAT ABA_LP::basisStatus_ [protected]

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.

Definition at line 683 of file lp.h.

int ABA_LP::nOpt_ [protected]

The number of optimizations of the linear program.

Definition at line 687 of file lp.h.

ABA_CPUTIMER ABA_LP::lpSolverTime_ [protected]

Definition at line 688 of file lp.h.


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