net.sourceforge.combean.interfaces.mathprog.lp.model
Interface LPModelSolver

Package class diagram package LPModelSolver
All Known Subinterfaces:
MIPModelSolver
All Known Implementing Classes:
LPModelSolverWithSequentialLoading, MIPModelSolverWithSequentialLoading

public interface LPModelSolver

A class which connects an LP model to a solver. Loads the model into the solver and retrieves the solution for the domain variables of the model. Responsible for assigning global indices to model indices, i.e., the LP model solver places the components with their abstract model indices into a combined LP with global indices.


Method Summary
 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.
 

Method Detail

setLPSolver

void setLPSolver(LPSolver lpSolver)
Set the solver to which the model shall be connected.

Parameters:
lpSolver -

getLPSolver

LPSolver getLPSolver()
Get the LP solver.

Returns:
the LP solver.

getGlobalIndex

int getGlobalIndex(LPModelIndex modelIndex,
                   VectorOrientation orientation)
Convert a model index into a global index

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

loadModel

void loadModel(LPModel lpModel)
Load a model into the previously set LP solver.

Parameters:
lpModel - the model to be loaded.

solve

void solve()
Run the LP solver.


getSolution

double getSolution(LPModelIndex columnIndex)
Return the solution value for a given variable. May only be called after the LP solver has calculated a primal solution.

Parameters:
columnIndex - the column for which the solution value shall be retrieved.
Returns:
the solution value.

getModel

LPModel getModel()
Return the currently loaded model.

Returns:
the currently loaded model or null if no model has been loaded.