net.sourceforge.combean.mathprog.lp.model
Class LPModelSolverWithSequentialLoading

Package class diagram package LPModelSolverWithSequentialLoading
java.lang.Object
  extended by net.sourceforge.combean.mathprog.lp.model.LPModelSolverWithSequentialLoading
All Implemented Interfaces:
LPModelSolver
Direct Known Subclasses:
MIPModelSolverWithSequentialLoading

public class LPModelSolverWithSequentialLoading
extends Object
implements LPModelSolver


Constructor Summary
LPModelSolverWithSequentialLoading()
          constructor
 
Method Summary
 int getGlobalIndex(int localIdx, String offsetId, VectorOrientation orientation)
           
 int getGlobalIndex(LPModelIndex modelIndex, VectorOrientation orientation)
          Convert a model index into a global index
 LPSolver getLPSolver()
          Get the LP solver.
 LPModel getModel()
          Return the currently loaded model.
 double getSolution(LPModelIndex columnIndex)
          Return the solution value for a given variable.
 void loadModel(LPModel lpModel)
          Load a model into the previously set LP solver.
 void setLPSolver(LPSolver lpSolver)
          Set the solver to which the model shall be connected.
 void solve()
          Run the LP solver.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LPModelSolverWithSequentialLoading

public LPModelSolverWithSequentialLoading()
constructor

Method Detail

setLPSolver

public void setLPSolver(LPSolver lpSolver)
Description copied from interface: LPModelSolver
Set the solver to which the model shall be connected.

Specified by:
setLPSolver in interface LPModelSolver

getLPSolver

public LPSolver getLPSolver()
Description copied from interface: LPModelSolver
Get the LP solver.

Specified by:
getLPSolver in interface LPModelSolver
Returns:
the LP solver.

getModel

public LPModel getModel()
Description copied from interface: LPModelSolver
Return the currently loaded model.

Specified by:
getModel in interface LPModelSolver
Returns:
the currently loaded model or null if no model has been loaded.

solve

public void solve()
Description copied from interface: LPModelSolver
Run the LP solver.

Specified by:
solve in interface LPModelSolver

getSolution

public double getSolution(LPModelIndex columnIndex)
Description copied from interface: LPModelSolver
Return the solution value for a given variable. May only be called after the LP solver has calculated a primal solution.

Specified by:
getSolution in interface LPModelSolver
Parameters:
columnIndex - the column for which the solution value shall be retrieved.
Returns:
the solution value.

getGlobalIndex

public int getGlobalIndex(LPModelIndex modelIndex,
                          VectorOrientation orientation)
Description copied from interface: LPModelSolver
Convert a model index into a global index

Specified by:
getGlobalIndex in interface LPModelSolver
Parameters:
modelIndex - the model index
orientation - orientation of the index (rowwise -> the index is a column index; columnwise -> the index is a row index)
Returns:
the global index in the LP

getGlobalIndex

public int getGlobalIndex(int localIdx,
                          String offsetId,
                          VectorOrientation orientation)

loadModel

public void loadModel(LPModel lpModel)
Description copied from interface: LPModelSolver
Load a model into the previously set LP solver.

Specified by:
loadModel in interface LPModelSolver
Parameters:
lpModel - the model to be loaded.

toString

public String toString()
Overrides:
toString in class Object