Search in sources :

Example 1 with Expr2LP

use of org.matheclipse.core.convert.Expr2LP in project symja_android_library by axkr.

the class NMinimize method getConstraints.

protected static List<LinearConstraint> getConstraints(VariablesSet vars, IExpr listOfconstraints) {
    Expr2LP x2LP;
    List<LinearConstraint> constraints = new ArrayList<LinearConstraint>();
    IAST andAST = (IAST) listOfconstraints;
    for (int i = 1; i < andAST.size(); i++) {
        x2LP = new Expr2LP(andAST.get(i), vars);
        constraints.add(x2LP.expr2Constraint());
    }
    return constraints;
}
Also used : Expr2LP(org.matheclipse.core.convert.Expr2LP) ArrayList(java.util.ArrayList) LinearConstraint(org.hipparchus.optim.linear.LinearConstraint) IAST(org.matheclipse.core.interfaces.IAST) LinearConstraint(org.hipparchus.optim.linear.LinearConstraint) NonNegativeConstraint(org.hipparchus.optim.linear.NonNegativeConstraint)

Aggregations

ArrayList (java.util.ArrayList)1 LinearConstraint (org.hipparchus.optim.linear.LinearConstraint)1 NonNegativeConstraint (org.hipparchus.optim.linear.NonNegativeConstraint)1 Expr2LP (org.matheclipse.core.convert.Expr2LP)1 IAST (org.matheclipse.core.interfaces.IAST)1