mipInstance Class Reference

General interface class for LP and MIP instances. More...

#include <ilpWrapper.h>

Inheritance diagram for mipInstance:

managedObject goblinRootObject glpkWrapper goblinLPSolver

Public Types

enum  TDisplayOpt {
  DISPLAY_PROBLEM = 0,
  DISPLAY_OBJECTIVE = 1,
  DISPLAY_RESTRICTIONS = 2,
  DISPLAY_BOUNDS = 4,
  DISPLAY_INTEGERS = 8,
  DISPLAY_FIXED = 16,
  DISPLAY_PRIMAL = 32,
  DISPLAY_DUAL = 64,
  DISPLAY_SLACKS = 128,
  DISPLAY_BASIS = 256,
  DISPLAY_TABLEAU = 512,
  DISPLAY_INVERSE = 1024,
  DISPLAY_VALUES = 2048
}
enum  TLPFormat {
  MPS_FORMAT = 0,
  LP_FORMAT = 1,
  MPS_CPLEX = 2,
  BAS_CPLEX = 3,
  BAS_GOBLIN = 4,
  GOB_FORMAT = 5
}
enum  TVarType {
  VAR_FLOAT = 0,
  VAR_INT = 1,
  VAR_CANCELED = 2
}
enum  TRestrType {
  BASIC_LB = 0,
  BASIC_UB = 1,
  NON_BASIC = 2,
  RESTR_CANCELED = 3
}
enum  TLowerUpper {
  LOWER = 0,
  UPPER = 1
}
enum  TSimplexMethod {
  SIMPLEX_AUTO = 0,
  SIMPLEX_PRIMAL = 1,
  SIMPLEX_DUAL = 2
}
enum  TStartBasis {
  START_AUTO = 0,
  START_LRANGE = 1,
  START_CURRENT = 2
}
enum  TPricing {
  VAR_PRICING = 0,
  FIRST_FIT = 1
}
enum  TQTest {
  EXACT = 0,
  MAX_ABS = 1
}

Public Member Functions

 mipInstance (goblinController &) throw ()
virtual ~mipInstance () throw ()
unsigned long Allocated () const throw ()
bool IsMixedILP () const
void Write (const char *, TOption=0) const throw (ERFile,ERRejected)
void Write (const char *, TLPFormat, TOption=0) const throw (ERFile,ERRejected)
void WriteLPNaive (const char *, TDisplayOpt=DISPLAY_PROBLEM) const throw (ERFile,ERRejected)
void WriteMPSFile (const char *, TLPFormat=MPS_CPLEX) const throw (ERFile,ERRejected)
void WriteMPSFile (ofstream &, TLPFormat=MPS_CPLEX) const throw (ERFile,ERRejected)
void WriteBASFile (const char *, TLPFormat=BAS_CPLEX) const throw (ERFile,ERRejected)
void WriteBASFile (ofstream &, TLPFormat=BAS_CPLEX) const throw (ERFile,ERRejected)
void WriteVarValues (goblinExport *) const throw ()
char * Display () const throw (ERFile,ERRejected)
void ReadMPSFile (const char *) throw (ERParse,ERRejected)
void ReadMPSFile (ifstream &) throw (ERParse,ERRejected)
void ReadBASFile (const char *) throw (ERParse,ERRejected)
void ReadBASFile (ifstream &) throw (ERParse,ERRejected)
void ReadVarValues (goblinImport *, TVar) throw (ERParse)
void NoSuchVar (char *, TVar) const throw (ERRange)
void NoSuchRestr (char *, TRestr) const throw (ERRange)
virtual TVar AddVar (TFloat, TFloat, TFloat, TVarType=VAR_FLOAT)=0 throw (ERRejected)
virtual TRestr AddRestr (TFloat, TFloat)=0 throw (ERRejected)
virtual void DeleteVar (TVar)=0 throw (ERRange,ERRejected)
virtual void DeleteRestr (TRestr)=0 throw (ERRange)
virtual void SetURange (TVar, TFloat)=0 throw (ERRange)
virtual void SetLRange (TVar, TFloat)=0 throw (ERRange)
virtual void SetUBound (TRestr, TFloat)=0 throw (ERRange)
virtual void SetLBound (TRestr, TFloat)=0 throw (ERRange)
virtual void SetCost (TVar, TFloat)=0 throw (ERRange)
virtual void SetVarType (TVar, TVarType)=0 throw (ERRange)
virtual void SetVarLabel (TVar, char *, TOwnership=OWNED_BY_SENDER)=0 throw (ERRange,ERRejected)
virtual void SetRestrLabel (TRestr, char *, TOwnership=OWNED_BY_SENDER)=0 throw (ERRange,ERRejected)
virtual void SetObjectSense (TObjectSense)=0 throw ()
virtual void SetCoeff (TRestr, TVar, TFloat)=0 throw (ERRange)
virtual void SetRow (TRestr i, TVar len, TVar *index, double *val)=0 throw (ERRange)
virtual void SetColumn (TVar j, TRestr len, TRestr *index, double *val)=0 throw (ERRange)
virtual void SetVarVisibility (TVar, bool) throw (ERRange)
virtual void SetRestrVisibility (TRestr, bool) throw (ERRange)
virtual void Resize (TRestr, TVar, TIndex)=0 throw (ERRange)
virtual void Strip ()=0 throw ()
virtual void SetVarValue (TVar, TFloat) throw (ERRange)
virtual void InitVarValues (TFloat=InfFloat) throw ()
virtual void ReleaseVarValues () throw ()
virtual TRestr K () const =0 throw ()
virtual TVar L () const =0 throw ()
virtual TIndex NZ () const =0 throw ()
virtual TFloat Cost (TVar) const =0 throw (ERRange)
virtual TFloat URange (TVar) const =0 throw (ERRange)
virtual TFloat LRange (TVar) const =0 throw (ERRange)
virtual TFloat UBound (TRestr) const =0 throw (ERRange)
virtual TFloat LBound (TRestr) const =0 throw (ERRange)
virtual TVarType VarType (TVar) const =0 throw (ERRange)
virtual char * VarLabel (TVar, TOwnership=OWNED_BY_RECEIVER) const throw (ERRange)
virtual char * RestrLabel (TRestr, TOwnership=OWNED_BY_RECEIVER) const throw (ERRange)
char * UnifiedLabel (TRestr, TOwnership=OWNED_BY_RECEIVER) const throw (ERRange)
virtual TVar VarIndex (char *) const throw ()
virtual TRestr RestrIndex (char *) const throw ()
virtual TObjectSense ObjectSense () const =0 throw ()
virtual TFloat Coeff (TRestr, TVar) const =0 throw (ERRange)
virtual TVar GetRow (TRestr i, TVar *index, double *val) const =0 throw (ERRange)
virtual TRestr GetColumn (TVar j, TRestr *index, double *val) const =0 throw (ERRange)
virtual bool VarVisibility (TVar) const throw (ERRange)
virtual bool RestrVisibility (TRestr) const throw (ERRange)
virtual TFloat VarValue (TVar) const throw (ERRange)
virtual TRestrType RestrType (TRestr) const =0 throw (ERRange)
virtual TRestr Index (TVar) const =0 throw (ERRange)
virtual TRestr RowIndex (TRestr) const =0 throw (ERRange)
virtual TVar RevIndex (TRestr) const =0 throw (ERRange)
virtual void SetRestrType (TRestr, TLowerUpper)=0 throw (ERRange,ERRejected)
virtual void SetIndex (TRestr, TVar, TLowerUpper)=0 throw (ERRange,ERRejected)
TVar PivotColumn () const throw ()
TRestr PivotRow () const throw ()
TLowerUpper PivotDirection () const throw ()
virtual void ResetBasis () throw ()
virtual bool Initial () const =0 throw ()
virtual TFloat X (TVar) const =0 throw (ERRange)
virtual TFloat Y (TRestr, TLowerUpper) const =0 throw (ERRange)
virtual TFloat Tableau (TIndex, TIndex) const =0 throw (ERRange,ERRejected)
virtual TFloat BaseInverse (TIndex, TIndex) const =0 throw (ERRange,ERRejected)
virtual void Pivot (TIndex, TIndex, TLowerUpper)=0 throw (ERRange,ERRejected)
virtual TFloat ObjVal () const throw ()
virtual TFloat Slack (TRestr, TLowerUpper) const throw (ERRange)
virtual bool PrimalFeasible (TFloat epsilon=0.01) throw ()
virtual bool DualFeasible (TFloat epsilon=0.01) throw ()
virtual TFloat SolvePrimal ()=0 throw ()
virtual TFloat SolveDual ()=0 throw ()
virtual bool StartPrimal ()=0 throw ()
virtual bool StartDual ()=0 throw ()
virtual TVar PricePrimal ()=0 throw (ERRejected)
virtual TRestr QTestPrimal (TVar)=0 throw (ERRejected)
virtual TRestr PriceDual ()=0 throw (ERRejected)
virtual TVar QTestDual (TRestr)=0 throw (ERRejected)
virtual TFloat SolveLP () throw (ERRejected)
virtual TFloat SolveMIP () throw (ERRejected)
virtual void AddCuttingPlane () throw (ERRejected)
mipInstanceClone () throw (ERRejected)
mipInstanceDualForm () throw (ERRejected)
mipInstanceStandardForm () throw (ERRejected)
mipInstanceCanonicalForm () throw (ERRejected)
void FlipObjectSense () throw ()
void ExportToAscii (const char *fileName, TOption format=0) const throw (ERFile)

Protected Member Functions

virtual void InitBasis () const =0 throw ()

Protected Attributes

TFloatvarValue
TVar numVars
TVar pivotColumn
TRestr pivotRow
TLowerUpper pivotDir

Detailed Description

General interface class for LP and MIP instances.


Member Enumeration Documentation

enum TDisplayOpt
 

Enumerator:
DISPLAY_PROBLEM 
DISPLAY_OBJECTIVE 
DISPLAY_RESTRICTIONS 
DISPLAY_BOUNDS 
DISPLAY_INTEGERS 
DISPLAY_FIXED 
DISPLAY_PRIMAL 
DISPLAY_DUAL 
DISPLAY_SLACKS 
DISPLAY_BASIS 
DISPLAY_TABLEAU 
DISPLAY_INVERSE 
DISPLAY_VALUES 

enum TLowerUpper
 

Enumerator:
LOWER 
UPPER 

enum TLPFormat
 

Enumerator:
MPS_FORMAT 
LP_FORMAT 
MPS_CPLEX 
BAS_CPLEX 
BAS_GOBLIN 
GOB_FORMAT 

enum TPricing
 

Enumerator:
VAR_PRICING 
FIRST_FIT 

enum TQTest
 

Enumerator:
EXACT 
MAX_ABS 

enum TRestrType
 

Enumerator:
BASIC_LB 
BASIC_UB 
NON_BASIC 
RESTR_CANCELED 

enum TSimplexMethod
 

Enumerator:
SIMPLEX_AUTO 
SIMPLEX_PRIMAL 
SIMPLEX_DUAL 

enum TStartBasis
 

Enumerator:
START_AUTO 
START_LRANGE 
START_CURRENT 

enum TVarType
 

Enumerator:
VAR_FLOAT 
VAR_INT 
VAR_CANCELED 


Constructor & Destructor Documentation

mipInstance goblinController  )  throw ()
 

~mipInstance  )  throw () [virtual]
 


Member Function Documentation

void AddCuttingPlane  )  throw (ERRejected) [virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual TVar AddVar TFloat  ,
TFloat  ,
TFloat  ,
TVarType  = VAR_FLOAT
throw (ERRejected) [pure virtual]
 

unsigned long Allocated  )  const throw ()
 

Reimplemented from managedObject.

Reimplemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

mipInstance * CanonicalForm  )  throw (ERRejected)
 

mipInstance * Clone  )  throw (ERRejected)
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void DeleteRestr TRestr   )  throw (ERRange) [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

bool DualFeasible TFloat  epsilon = 0.01  )  throw () [virtual]
 

mipInstance * DualForm  )  throw (ERRejected)
 

void FlipObjectSense  )  throw ()
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void InitBasis  )  const throw () [protected, pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

virtual bool Initial  )  const throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

void InitVarValues TFloat  = InfFloat  )  throw () [virtual]
 

bool IsMixedILP  )  const [virtual]
 

Query if this is an MIP like data object.

Return values:
true This is a MIP or LP data object

Reimplemented from goblinRootObject.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

void NoSuchRestr char *  ,
TRestr 
const throw (ERRange)
 

void NoSuchVar char *  ,
TVar 
const throw (ERRange)
 

virtual TObjectSense ObjectSense  )  const throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

TFloat ObjVal  )  const throw () [virtual]
 

virtual void Pivot TIndex  ,
TIndex  ,
TLowerUpper 
throw (ERRange,ERRejected) [pure virtual]
 

TVar PivotColumn  )  const throw ()
 

mipInstance::TLowerUpper PivotDirection  )  const throw ()
 

TRestr PivotRow  )  const throw ()
 

virtual TRestr PriceDual  )  throw (ERRejected) [pure virtual]
 

Implemented in glpkWrapper.

virtual TVar PricePrimal  )  throw (ERRejected) [pure virtual]
 

Implemented in glpkWrapper.

bool PrimalFeasible TFloat  epsilon = 0.01  )  throw () [virtual]
 

virtual TVar QTestDual TRestr   )  throw (ERRejected) [pure virtual]
 

Implemented in glpkWrapper.

virtual TRestr QTestPrimal TVar   )  throw (ERRejected) [pure virtual]
 

Implemented in glpkWrapper.

void ReleaseVarValues  )  throw () [virtual]
 

void ResetBasis  )  throw () [virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Reimplemented in goblinLPSolver.

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

Reimplemented in glpkWrapper, and goblinLPSolver.

virtual TRestrType RestrType TRestr   )  const throw (ERRange) [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

bool RestrVisibility TRestr   )  const throw (ERRange) [virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void SetIndex TRestr  ,
TVar  ,
TLowerUpper 
throw (ERRange,ERRejected) [pure virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void SetObjectSense TObjectSense   )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void SetRestrType TRestr  ,
TLowerUpper 
throw (ERRange,ERRejected) [pure virtual]
 

void SetRestrVisibility TRestr  ,
bool 
throw (ERRange) [virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual void SetVarType TVar  ,
TVarType 
throw (ERRange) [pure virtual]
 

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

void SetVarVisibility TVar  ,
bool 
throw (ERRange) [virtual]
 

TFloat Slack TRestr  ,
TLowerUpper 
const throw (ERRange) [virtual]
 

virtual TFloat SolveDual  )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

TFloat SolveLP  )  throw (ERRejected) [virtual]
 

Reimplemented in glpkWrapper.

TFloat SolveMIP  )  throw (ERRejected) [virtual]
 

Reimplemented in glpkWrapper.

virtual TFloat SolvePrimal  )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

mipInstance * StandardForm  )  throw (ERRejected)
 

virtual bool StartDual  )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

virtual bool StartPrimal  )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

virtual void Strip  )  throw () [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Implemented in glpkWrapper, and goblinLPSolver.

char * UnifiedLabel TRestr  ,
TOwnership  = OWNED_BY_RECEIVER
const throw (ERRange)
 

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

Implemented in glpkWrapper, and goblinLPSolver.

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

Reimplemented in goblinLPSolver.

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

Reimplemented in glpkWrapper, and goblinLPSolver.

virtual TVarType VarType TVar   )  const throw (ERRange) [pure virtual]
 

Implemented in glpkWrapper, and goblinLPSolver.

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

bool VarVisibility TVar   )  const throw (ERRange) [virtual]
 

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

Implemented in glpkWrapper, and goblinLPSolver.

virtual TFloat Y TRestr  ,
TLowerUpper 
const throw (ERRange) [pure virtual]
 


Field Documentation

TVar numVars [protected]
 

TVar pivotColumn [mutable, protected]
 

TLowerUpper pivotDir [mutable, protected]
 

TRestr pivotRow [mutable, protected]
 

TFloat* varValue [protected]