Class LinearSolverUtil


  • public class LinearSolverUtil
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<org.apache.commons.math3.optim.linear.LinearConstraint> convertToLinearConstraints​(Coefficients coefficients, java.util.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 + ...
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LinearSolverUtil

        public LinearSolverUtil()
    • Method Detail

      • convertToLinearConstraints

        public static java.util.List<org.apache.commons.math3.optim.linear.LinearConstraint> convertToLinearConstraints​(Coefficients coefficients,
                                                                                                                        java.util.List<Constraint> constraints)
        Gets all Constraints converted to Linear Constraints.
        Parameters:
        coefficients - the data object
        constraints - 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