goblinLPSolver Class Reference

Self-contained implementation of an LP Solver. More...

#include <lpSolver.h>

Inheritance diagram for goblinLPSolver:

mipInstance managedObject goblinRootObject

Public Member Functions

 goblinLPSolver (TRestr, TVar, TIndex, TObjectSense, goblinController &=goblinDefaultContext) throw ()
 goblinLPSolver (const char *impFileName, goblinController &thisContext=goblinDefaultContext) throw (ERFile,ERParse)
 ~goblinLPSolver () throw ()
unsigned long Allocated () const throw ()
unsigned long Size () const throw ()
TVar AddVar (TFloat, TFloat, TFloat, TVarType=VAR_FLOAT) throw (ERRejected)
TRestr AddRestr (TFloat, TFloat) throw (ERRejected)
void DeleteVar (TVar) throw (ERRange,ERRejected)
void DeleteRestr (TRestr) throw (ERRange)
void SetURange (TVar, TFloat) throw (ERRange)
void SetLRange (TVar, TFloat) throw (ERRange)
void SetUBound (TRestr, TFloat) throw (ERRange)
void SetLBound (TRestr, TFloat) throw (ERRange)
void SetCost (TVar, TFloat) throw (ERRange)
void SetVarType (TVar, TVarType) throw (ERRange)
void SetVarLabel (TVar, char *, TOwnership=OWNED_BY_SENDER) throw (ERRange,ERRejected)
void SetRestrLabel (TRestr, char *, TOwnership=OWNED_BY_SENDER) throw (ERRange,ERRejected)
void SetObjectSense (TObjectSense dd) throw ()
void SetCoeff (TRestr, TVar, TFloat) throw (ERRange)
void SetRow (TRestr i, TVar len, TVar *index, double *val) throw (ERRange)
void SetColumn (TVar j, TRestr len, TRestr *index, double *val) throw (ERRange)
void Resize (TRestr, TVar, TIndex) throw (ERRange)
void Strip () throw ()
TRestr K () const throw ()
TVar L () const throw ()
TIndex NZ () const throw ()
TFloat Cost (TVar) const throw (ERRange)
TFloat URange (TVar) const throw (ERRange)
TFloat LRange (TVar) const throw (ERRange)
TFloat UBound (TRestr) const throw (ERRange)
TFloat LBound (TRestr) const throw (ERRange)
TVarType VarType (TVar) const throw (ERRange)
char * VarLabel (TVar, TOwnership=OWNED_BY_RECEIVER) const throw (ERRange)
char * RestrLabel (TRestr, TOwnership=OWNED_BY_RECEIVER) const throw (ERRange)
TVar VarIndex (char *) const throw ()
TRestr RestrIndex (char *) const throw ()
bool CCost () const throw ()
bool CURange () const throw ()
bool CLRange () const throw ()
bool CUBound () const throw ()
bool CLBound () const throw ()
bool CVarType () const throw ()
TObjectSense ObjectSense () const throw ()
TFloat Coeff (TRestr, TVar) const throw (ERRange)
TVar GetRow (TRestr i, TVar *index, double *val) const throw (ERRange)
TRestr GetColumn (TVar j, TRestr *index, double *val) const throw (ERRange)
TRestrType RestrType (TRestr) const throw (ERRange)
TRestr Index (TVar) const throw (ERRange)
TVar RowIndex (TRestr) const throw (ERRange)
TVar RevIndex (TRestr) const throw (ERRange)
void SetRestrType (TRestr, TLowerUpper) throw (ERRange,ERRejected)
void SetIndex (TRestr, TVar, TLowerUpper) throw (ERRange,ERRejected)
void InitBasis () const throw ()
bool Initial () const throw ()
TFloat X (TVar) const throw (ERRange)
TFloat Y (TRestr, TLowerUpper) const throw (ERRange)
TFloat Tableau (TIndex, TIndex) const throw (ERRange,ERRejected)
TFloat BaseInverse (TIndex, TIndex) const throw (ERRange,ERRejected)
void Pivot (TIndex, TIndex, TLowerUpper) throw (ERRange,ERRejected)
bool StartPrimal () throw ()
TFloat SolvePrimal () throw ()
bool StartDual () throw ()
TFloat SolveDual () throw ()

Detailed Description

Self-contained implementation of an LP Solver.

LPs are considered to be in the form

min/max c^tx under L <= Ax <= U, l <= x <= u

Variable indexing: 0,1,..,L()-1

Restriction indexing: 0,1,..,K()+L()-1

Restriction i is

LBound(i) <= A_ix <= UBound(i) for i < K()

and

LRange(i-K()) <= x <= URange(i-K()) for i >= K()


Constructor & Destructor Documentation

goblinLPSolver TRestr  ,
TVar  ,
TIndex  ,
TObjectSense  ,
goblinController = goblinDefaultContext
throw ()
 

goblinLPSolver const char *  impFileName,
goblinController thisContext = goblinDefaultContext
throw (ERFile,ERParse)
 

~goblinLPSolver  )  throw ()
 


Member Function Documentation

TRestr AddRestr TFloat  ,
TFloat 
throw (ERRejected) [virtual]
 

Implements mipInstance.

TRestr AddVar TFloat  ,
TFloat  ,
TFloat  ,
TVarType  = VAR_FLOAT
throw (ERRejected)
 

unsigned long Allocated  )  const throw ()
 

Reimplemented from mipInstance.

TFloat BaseInverse TIndex  ,
TIndex 
const throw (ERRange,ERRejected) [virtual]
 

Implements mipInstance.

bool CCost  )  const throw ()
 

bool CLBound  )  const throw ()
 

bool CLRange  )  const throw ()
 

TFloat Coeff TRestr  ,
TVar 
const throw (ERRange) [virtual]
 

Implements mipInstance.

TFloat Cost TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

bool CUBound  )  const throw ()
 

bool CURange  )  const throw ()
 

bool CVarType  )  const throw ()
 

void DeleteRestr TRestr   )  throw (ERRange) [virtual]
 

Implements mipInstance.

void DeleteVar TVar   )  throw (ERRange,ERRejected) [virtual]
 

Implements mipInstance.

TRestr GetColumn TVar  j,
TRestr index,
double *  val
const throw (ERRange) [virtual]
 

Implements mipInstance.

TVar GetRow TRestr  i,
TVar index,
double *  val
const throw (ERRange) [virtual]
 

Implements mipInstance.

TRestr Index TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

void InitBasis  )  const throw () [virtual]
 

Implements mipInstance.

bool Initial  )  const throw () [virtual]
 

Implements mipInstance.

TFloat LBound TRestr   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TFloat LRange TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TObjectSense ObjectSense  )  const throw () [virtual]
 

Implements mipInstance.

void Pivot TIndex  ,
TIndex  ,
TLowerUpper 
throw (ERRange,ERRejected)
 

void Resize TRestr  ,
TVar  ,
TIndex 
throw (ERRange) [virtual]
 

Implements mipInstance.

TRestr RestrIndex char *   )  const throw () [virtual]
 

Reimplemented from mipInstance.

char * RestrLabel TRestr  ,
TOwnership  = OWNED_BY_RECEIVER
const throw (ERRange) [virtual]
 

Reimplemented from mipInstance.

mipInstance::TRestrType RestrType TRestr   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TVar RevIndex TRestr   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TVar RowIndex TRestr   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

void SetCoeff TRestr  ,
TVar  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetColumn TVar  j,
TRestr  len,
TRestr index,
double *  val
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetCost TVar  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetIndex TRestr  ,
TVar  ,
TLowerUpper 
throw (ERRange,ERRejected)
 

void SetLBound TRestr  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetLRange TVar  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetObjectSense TObjectSense  dd  )  throw () [virtual]
 

Implements mipInstance.

void SetRestrLabel TRestr  ,
char *  ,
TOwnership  = OWNED_BY_SENDER
throw (ERRange,ERRejected) [virtual]
 

Implements mipInstance.

void SetRestrType TRestr  ,
TLowerUpper 
throw (ERRange,ERRejected)
 

void SetRow TRestr  i,
TVar  len,
TVar index,
double *  val
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetUBound TRestr  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetURange TVar  ,
TFloat 
throw (ERRange) [virtual]
 

Implements mipInstance.

void SetVarLabel TVar  ,
char *  ,
TOwnership  = OWNED_BY_SENDER
throw (ERRange,ERRejected) [virtual]
 

Implements mipInstance.

void SetVarType TVar  ,
TVarType 
throw (ERRange)
 

unsigned long Size  )  const throw () [virtual]
 

Implements goblinRootObject.

TFloat SolveDual  )  throw () [virtual]
 

Implements mipInstance.

TFloat SolvePrimal  )  throw () [virtual]
 

Implements mipInstance.

bool StartDual  )  throw () [virtual]
 

Implements mipInstance.

bool StartPrimal  )  throw () [virtual]
 

Implements mipInstance.

void Strip  )  throw () [virtual]
 

Implements mipInstance.

TFloat Tableau TIndex  ,
TIndex 
const throw (ERRange,ERRejected) [virtual]
 

Implements mipInstance.

TFloat UBound TRestr   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TFloat URange TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TVar VarIndex char *   )  const throw () [virtual]
 

Reimplemented from mipInstance.

char * VarLabel TVar  ,
TOwnership  = OWNED_BY_RECEIVER
const throw (ERRange) [virtual]
 

Reimplemented from mipInstance.

mipInstance::TVarType VarType TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TFloat X TVar   )  const throw (ERRange) [virtual]
 

Implements mipInstance.

TFloat Y TRestr  ,
TLowerUpper 
const throw (ERRange)