Class LinearSolverUtil
java.lang.Object
io.openems.edge.ess.core.power.data.LinearSolverUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic List<org.apache.commons.math3.optim.linear.LinearConstraint>
convertToLinearConstraints
(Coefficients coefficients, List<Constraint> constraints) Gets all Constraints converted to Linear Constraints.static double[]
generateEmptyCoefficientsArray
(int length) Gets an empty coefficients array required for linear solver.static org.apache.commons.math3.optim.linear.LinearObjectiveFunction
getDefaultObjectiveFunction
(int noOfCoefficients) Gets the linear objective function in the form 1*a + 1*b + 1*c + ...
-
Constructor Details
-
LinearSolverUtil
public LinearSolverUtil()
-
-
Method Details
-
convertToLinearConstraints
public static List<org.apache.commons.math3.optim.linear.LinearConstraint> convertToLinearConstraints(Coefficients coefficients, List<Constraint> constraints) Gets all Constraints converted to Linear Constraints.- Parameters:
coefficients
- the data objectconstraints
- a list of Constraints- Returns:
- a list of LinearConstraints
-
generateEmptyCoefficientsArray
public static double[] generateEmptyCoefficientsArray(int length) Gets an empty coefficients array required for linear solver.- Parameters:
length
- the length of the array- Returns:
- an array of '0' coefficients
-
getDefaultObjectiveFunction
public static org.apache.commons.math3.optim.linear.LinearObjectiveFunction getDefaultObjectiveFunction(int noOfCoefficients) Gets the linear objective function in the form 1*a + 1*b + 1*c + ...- Parameters:
noOfCoefficients
- the number of coefficients of the objective function- Returns:
- a
LinearObjectiveFunction
-