int main() { NumConstraint c("x1", "x2", "cost", "cost = cos(x1^30 + x2^30)"); IntervalVector box(3); box[0] = Interval(-100000, 100000); box[1] = Interval(-100000, 100000); cout << "box before=" << box << endl; CtcFwdBwd(c).contract(box); cout << "box after=" << box << endl; return 0; }
int main() { // z = atan2(y, x) Variable x, y, z; Function f(y, x, z, z - atan2(y, x)); NumConstraint c(f); CtcFwdBwd ctc(c); IntervalVector box(3); box[0] = Interval(1, 1); box[1] = Interval(0, 0); box[2] = Interval(-100, 100); cout << "Before contract: " << box << endl; ctc.contract(box); cout << "After contract: " << box << endl; return 0; }
int main() { // z = atan2(y, x) const ExprSymbol& x = ExprSymbol::new_(); const ExprSymbol& y = ExprSymbol::new_(); const ExprSymbol& z = ExprSymbol::new_(); Function f(y, x, z, z - atan2(y, x)); NumConstraint c(f); CtcFwdBwd ctc(c); IntervalVector box(3); box[0] = Interval(1, 1); box[1] = Interval(0, 0); box[2] = Interval(-100, 100); cout << "Before contract: " << box << endl; ctc.contract(box); cout << "After contract: " << box << endl; return 0; }
int main() { // z = atan2(y, x) const ExprSymbol& x = ExprSymbol::new_(); // Function f(x, pow(3, x) - 1); // NumConstraint c(x, pow(3, x) = 1); ExprNode const & n0 = ExprConstant::new_scalar(3.0); ExprNode const & n1 = ibex::pow(n0, x); ExprNode const & n2 = x; ExprCtr const & c1 = n1 > n2; NumConstraint c(x, c1); CtcFwdBwd ctc(c); IntervalVector box(1); box[0] = Interval(0, 10); cout << "Before contract: " << box << endl; ctc.contract(box); cout << "After contract: " << box << endl; return 0; }