|
JMSL 2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.imsl.math.LinearProgramming
Linear programming problem using the revised simplex algorithm.
Class LinearProgramming uses a revised simplex method to
solve linear programming problems, i.e., problems of the form
![]()
subject to
![]()
![]()
where c is the objective coefficient vector,
A is the coefficient matrix, and the vectors
,
,
,
and
are the lower and upper bounds on the
constraints and the variables, respectively.
For a complete description of the revised simplex method, see Murtagh (1981) or Murty (1983).
| Nested Class Summary | |
static class |
LinearProgramming.BoundsInconsistentException
The bounds given are inconsistent. |
static class |
LinearProgramming.NumericDifficultyException
Numerical difficulty occurred. |
static class |
LinearProgramming.WrongConstraintTypeException
Deprecated. The values for the type of constraint must be either 0, 1 or 2. |
| Constructor Summary | |
LinearProgramming(double[][] a,
double[] b,
double[] c)
Constructor variables of type double. |
|
| Method Summary | |
double[] |
getDualSolution()
Returns the dual solution. |
double |
getOptimalValue()
Returns the optimal value of the objective function. |
double[] |
getPrimalSolution()
Returns the solution x of the linear programming problem. |
void |
setConstraintType(int[] constraintType)
Sets the types of general constraints in the matrix a. |
void |
setLowerBound(double[] lowerBound)
Sets the upper limit of the constraints. |
void |
setMaximumIteration(int iterations)
Sets the maximum number of iterations. |
void |
setUpperBound(double[] upperBound)
Sets the upper bound on the variables. |
void |
setUpperLimit(double[] upperLimit)
Sets the upper limit of the constraints. |
void |
solve()
Solves the program using the revised simplex algorithm. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public LinearProgramming(double[][] a,
double[] b,
double[] c)
double.
a - A double matrix with coefficients of the constraintsb - A double array containing the right-hand side of the constraints.c - A double array containing the coefficients of the objective function.
IllegalArgumentException - is thrown if the dimensions of a,
b.length, and c.length are not consistent.| Method Detail |
public final void solve()
throws LinearProgramming.BoundsInconsistentException,
LinearProgramming.NumericDifficultyException,
SingularMatrixException
LinearProgramming.BoundsInconsistentException
LinearProgramming.NumericDifficultyException
SingularMatrixExceptionpublic void setMaximumIteration(int iterations)
iterations - a int scalar specifying the maximum
number of iterations.public void setUpperLimit(double[] upperLimit)
upperLimit - a double array containing the upper
limit of the constraints that have both the lower
and the upper bounds.public void setLowerBound(double[] lowerBound)
public void setUpperBound(double[] upperBound)
upperBound - a double array containing the upper
bound on the variables.public void setConstraintType(int[] constraintType)
constraintType - a int array containing the types
of general constraints.
|
constraintType |
Constraint |
| 0 | |
| 1 | |
| 2 | |
| 3 |
public double getOptimalValue()
double scalar containing the optimal
value of the objective function.public double[] getPrimalSolution()
double array containing the
solution x of the linear programming problem.public double[] getDualSolution()
double array containing the dual
solution of the linear programming problem.
|
JMSL 2.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||