Package com.imsl.math
Class LinearProgramming
java.lang.Object
com.imsl.math.LinearProgramming
- All Implemented Interfaces:
Serializable,Cloneable
Deprecated.
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
$$\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).
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDeprecated.static classDeprecated.static classDeprecated.static classDeprecated.static classDeprecated.No longer used, replaced with anIllegalArgumentException. -
Constructor Summary
ConstructorsConstructorDescriptionLinearProgramming(double[][] a, double[] b, double[] c) Deprecated.Constructor variables of typedouble. -
Method Summary
Modifier and TypeMethodDescriptionclone()Deprecated.Creates and returns a copy of this object.double[]Deprecated.Returns the dual solution.doubleDeprecated.Returns the optimal value of the objective function.double[]Deprecated.Returns the solution x of the linear programming problem.voidsetConstraintType(int[] constraintType) Deprecated.Sets the types of general constraints in the matrix a.voidsetLowerBound(double[] lowerBound) Deprecated.Sets the lower bound on the variables.voidsetMaximumIteration(int iterations) Deprecated.Sets the maximum number of iterations.voidsetUpperBound(double[] upperBound) Deprecated.Sets the upper bound on the variables.voidsetUpperLimit(double[] upperLimit) Deprecated.Sets the upper limit of the constraints.final voidsolve()Deprecated.Solves the program using the revised simplex algorithm.
-
Constructor Details
-
LinearProgramming
public LinearProgramming(double[][] a, double[] b, double[] c) Deprecated.Constructor variables of typedouble.- Parameters:
a- Adoublematrix with coefficients of the constraintsb- Adoublearray containing the right-hand side of the constraints.c- Adoublearray containing the coefficients of the objective function.- Throws:
IllegalArgumentException- is thrown if the dimensions ofa,b.length, andc.lengthare not consistent.
-
-
Method Details
-
clone
Deprecated.Creates and returns a copy of this object. -
solve
public final void solve() throws LinearProgramming.BoundsInconsistentException, LinearProgramming.NumericDifficultyException, LinearProgramming.ProblemInfeasibleException, LinearProgramming.ProblemUnboundedException, SingularMatrixExceptionDeprecated.Solves the program using the revised simplex algorithm.- Throws:
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.SingularMatrixException
-
setMaximumIteration
public void setMaximumIteration(int iterations) Deprecated.Sets the maximum number of iterations. Default is set to 10000.- Parameters:
iterations- anintscalar specifying the maximum number of iterations.
-
setUpperLimit
public void setUpperLimit(double[] upperLimit) Deprecated.Sets the upper limit of the constraints.- Parameters:
upperLimit- adoublearray containing the upper limit of the constraints that have both the lower and the upper bounds.
-
setLowerBound
public void setLowerBound(double[] lowerBound) Deprecated.Sets the lower bound on the variables. If there is no lower bound on a variable, then 1.0e30 should be set as the lower bound.- Parameters:
lowerBound- adoublearray containing the lower bound on the variables.
-
setUpperBound
public void setUpperBound(double[] upperBound) Deprecated.Sets the upper bound on the variables. If there is no upper bound on a variable, then -1.0e30 should be set as the upper bound.- Parameters:
upperBound- adoublearray containing the upper bound on the variables.
-
setConstraintType
public void setConstraintType(int[] constraintType) Deprecated.Sets the types of general constraints in the matrix a.- Parameters:
constraintType- anintarray 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\)
-
getOptimalValue
public double getOptimalValue()Deprecated.Returns the optimal value of the objective function.- Returns:
- a
doublescalar containing the optimal value of the objective function.
-
getPrimalSolution
public double[] getPrimalSolution()Deprecated.Returns the solution x of the linear programming problem.- Returns:
- a
doublearray containing the solution x of the linear programming problem.
-
getDualSolution
public double[] getDualSolution()Deprecated.Returns the dual solution.- Returns:
- a
doublearray containing the dual solution of the linear programming problem.
-
LinearProgramminghas been replaced byDenseLP.