Package org.apache.commons.math.optimization.linear

Examples of org.apache.commons.math.optimization.linear.SimplexSolver


    Relationship r = convertConstraintType(LLConstraint_llConstraint_ctype(c));
    return new LinearConstraint(coeffients, r, constant);
  }

  public IValue llOptimize(IBool minimize, IBool nonNegative, ISet constraints, IConstructor f) {
    SimplexSolver solver = new SimplexSolver();
    ArrayList<LinearConstraint> constraintsJ =
        new ArrayList<LinearConstraint>(constraints.size());
    for(IValue v : constraints ){
      constraintsJ.add(convertConstraint((IConstructor)v));
    }
    LinearObjectiveFunction fJ = convertLinObjFun(f);
    GoalType goal = minimize.getValue() ?
            GoalType.MINIMIZE : GoalType.MAXIMIZE;
    IValueFactory vf = values;
    boolean nonNegativeJ =  nonNegative.getValue();
    try {
      RealPointValuePair res =
          solver.optimize(fJ, constraintsJ, goal,nonNegativeJ);
      return vf.constructor(Maybe.Maybe_just,
          vf.constructor(
              LLSolution_llSolution, convertToRealList(res.getPoint(), vf),
              vf.real(res.getValue()) )
          );
View Full Code Here

TOP

Related Classes of org.apache.commons.math.optimization.linear.SimplexSolver

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.