Catalano.Math.Optimization
Class LinearProgramming
- java.lang.Object
-
- Catalano.Math.Optimization.LinearProgramming
-
public class LinearProgramming extends java.lang.ObjectLinear Programming. Two Phase Method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classLinearProgramming.ObjectiveObjective of the function.
-
Field Summary
Fields Modifier and Type Field and Description static intINFEASIBLEThe solution is infeasible.static intOPTIMALThe solution exists.static intUNBOUNDEDThe solution is unbounded.
-
Constructor Summary
Constructors Constructor and Description LinearProgramming(LinearProgramming.Objective objective)Linear Programming.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]getCoefficients()Get coefficients.intgetIterations()Number of iterations required to be converged.doublegetSolution()Get the final solution.booleanisInfinite()Check if the solution is infinite.intSolve(double[] function, java.util.List<Constraint> constraints)Solve the simplex problem.
-
-
-
Field Detail
-
INFEASIBLE
public static final int INFEASIBLE
The solution is infeasible.- See Also:
- Constant Field Values
-
OPTIMAL
public static final int OPTIMAL
The solution exists.- See Also:
- Constant Field Values
-
UNBOUNDED
public static final int UNBOUNDED
The solution is unbounded.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
LinearProgramming
public LinearProgramming(LinearProgramming.Objective objective)
Linear Programming.- Parameters:
objective- Objective.
-
-
Method Detail
-
getIterations
public int getIterations()
Number of iterations required to be converged.- Returns:
- Number of iterations.
-
getSolution
public double getSolution()
Get the final solution.- Returns:
- Optimal objective value.
-
getCoefficients
public double[] getCoefficients()
Get coefficients.- Returns:
- Coefficients.
-
isInfinite
public boolean isInfinite()
Check if the solution is infinite.- Returns:
- True if exists one more solution, otherwise return false.
-
Solve
public int Solve(double[] function, java.util.List<Constraint> constraints)Solve the simplex problem.- Parameters:
function- Function.constraints- List of constraints.- Returns:
- Status of the solution.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG