LinearProgramming has been replaced by DenseLP.public class LinearProgramming extends Object implements Serializable, Cloneable
Class LinearProgramming uses a revised simplex method to
solve linear programming problems, i.e., problems of the form
$$\mathop {\min }\limits_{x\; \in \;R^n } c^T x$$
subject to
$$b_l \le A_x \le b_u$$
$$\,\,x_l \le x \le x_u$$
where c is the objective coefficient vector, A is the coefficient matrix, and the vectors \(b_l\), \(b_u\), \(x_l\), and \(x_u\) are the lower and upper bounds on the constraints and the variables, respectively.
NOTE: This code is obsolete. For any new development one should use DenseLP instead.
For a complete description of the revised simplex method, see Murtagh (1981) or Murty (1983).
| Modifier and Type | Class and Description |
|---|---|
static class |
LinearProgramming.BoundsInconsistentException
Deprecated.
|
static class |
LinearProgramming.NumericDifficultyException
Deprecated.
|
static class |
LinearProgramming.ProblemInfeasibleException
Deprecated.
|
static class |
LinearProgramming.ProblemUnboundedException
Deprecated.
|
static class |
LinearProgramming.WrongConstraintTypeException
Deprecated.
No longer used, replaced with an
IllegalArgumentException. |
| Constructor and Description |
|---|
LinearProgramming(double[][] a,
double[] b,
double[] c)
Deprecated.
Constructor variables of type
double. |
| Modifier and Type | Method and Description |
|---|---|
Object |
clone()
Deprecated.
Creates and returns a copy of this object.
|
double[] |
getDualSolution()
Deprecated.
Returns the dual solution.
|
double |
getOptimalValue()
Deprecated.
Returns the optimal value of the objective function.
|
double[] |
getPrimalSolution()
Deprecated.
Returns the solution x of the linear programming problem.
|
void |
setConstraintType(int[] constraintType)
Deprecated.
Sets the types of general constraints in the matrix a.
|
void |
setLowerBound(double[] lowerBound)
Deprecated.
Sets the lower bound on the variables.
|
void |
setMaximumIteration(int iterations)
Deprecated.
Sets the maximum number of iterations.
|
void |
setUpperBound(double[] upperBound)
Deprecated.
Sets the upper bound on the variables.
|
void |
setUpperLimit(double[] upperLimit)
Deprecated.
Sets the upper limit of the constraints.
|
void |
solve()
Deprecated.
Solves the program using the revised simplex algorithm.
|
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.public Object clone()
public final void solve()
throws LinearProgramming.BoundsInconsistentException,
LinearProgramming.NumericDifficultyException,
LinearProgramming.ProblemInfeasibleException,
LinearProgramming.ProblemUnboundedException,
SingularMatrixException
LinearProgramming.BoundsInconsistentException - is thrown if the bounds are inconsistent.LinearProgramming.ProblemInfeasibleException - is thrown if there is no feasible solution
to the problem.LinearProgramming.ProblemUnboundedException - is thrown if there is no finite solution
to the problem.LinearProgramming.NumericDifficultyException - is thrown if there is a numerical problem
during the solution.SingularMatrixExceptionpublic void setMaximumIteration(int iterations)
iterations - an 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)
lowerBound - a double array containing the lower
bound on the variables.public void setUpperBound(double[] upperBound)
upperBound - a double array containing the upper
bound on the variables.public void setConstraintType(int[] constraintType)
constraintType - an int array containing the types
of general constraints.
|
constraintType |
Constraint |
| 0 | \({\rm {r}}_i = {\rm {b}}_i\) |
| 1 | \({\rm {r}}_i \le {\rm {bu}}_i\) |
| 2 | \({\rm {r}}_i \ge {\rm {b}}_i\) |
| 3 | \({\rm {b}}_i \le {\rm {r}}_i \le {\rm {bu}}_i\) |
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.Copyright © 2020 Rogue Wave Software. All rights reserved.