SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard
Class StandardSimplex

java.lang.Object
  extended by com.numericalmethod.suanshu.optimization.constrained.linearprogramming.simplex.standard.StandardSimplex
All Implemented Interfaces:
LpSolver

public class StandardSimplex
extends java.lang.Object
implements LpSolver

In our implementation, we follow the convention in "Linear Programming with MATLAB," Michael C. Ferris, Olvi L. Mangasarian, Stephen J. Wright, that the inequalities have this form: A * x ≥ b, , b ≤ 0 iff the problem is feasible.


Constructor Summary
StandardSimplex(StandardLpProblem1 problem)
           
StandardSimplex(StandardLpProblem2 problem)
           
 
Method Summary
 Tableau getResultantTableau()
          Get a copy of the Tableau after the solve operation.
 int lambdaCol()
          Get the column index for which there is no row that passes the ratio test.
 LpSolution solve()
          Solve the Linear Programming (LP) problem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardSimplex

public StandardSimplex(StandardLpProblem2 problem)

StandardSimplex

public StandardSimplex(StandardLpProblem1 problem)
                throws LpProblem.EmptyCostVector,
                       LpProblem.NoConstraint,
                       LpProblem.DimensionNotMatched
Throws:
LpProblem.EmptyCostVector
LpProblem.NoConstraint
LpProblem.DimensionNotMatched
Method Detail

solve

public LpSolution solve()
                 throws LpProblem.Infeasible
Description copied from interface: LpSolver
Solve the Linear Programming (LP) problem.

Specified by:
solve in interface LpSolver
Returns:
a (partial) solution
Throws:
LpProblem.Infeasible

lambdaCol

public int lambdaCol()
Description copied from interface: LpSolver
Get the column index for which there is no row that passes the ratio test. That is, the problem is unbounded.

To check whether a problem is bounded, we can do:

 lambdaCol() == 0;
 

Specified by:
lambdaCol in interface LpSolver
Returns:
0 if LP problem is bounded; +ve column index otherwise

getResultantTableau

public Tableau getResultantTableau()
Description copied from interface: LpSolver
Get a copy of the Tableau after the solve operation. The table can be passed to other operations, e.g., other LpSolver, for further processing.

Specified by:
getResultantTableau in interface LpSolver
Returns:
a Tableau as a result of the solve operation

SuanShu, a Java numerical and statistical library

Copyright © 2011 Numerical Method Inc. Ltd. All Rights Reserved.