20 static Interval fwd(
const Interval& x1,
const Interval& x2);
21 static ScalarType fwd_natural(
const ScalarType& x1,
const ScalarType& x2);
22 static ScalarType fwd_centered(
const ScalarType& x1,
const ScalarType& x2);
23 static void bwd(
const Interval& y, Interval& x1, Interval& x2);
30 max(
const ScalarExpr& x1,
const ScalarExpr& x2)
32 return { std::make_shared<AnalyticOperationExpr<MaxOp,ScalarType,ScalarType,ScalarType>>(x1,x2) };
35 inline ScalarType MaxOp::fwd_natural(
const ScalarType& x1,
const ScalarType& x2)
39 x1.def_domain && x2.def_domain
43 inline ScalarType MaxOp::fwd_centered(
const ScalarType& x1,
const ScalarType& x2)
45 if(centered_form_not_available_for_args(x1,x2))
46 return fwd_natural(x1,x2);
48 assert(x1.da.rows() == 1);
49 assert(x1.da.rows() == x2.da.rows() && x1.da.cols() == x2.da.cols());
51 IntervalMatrix d(1,x1.da.cols());
52 for(Index i = 0 ; i < d.size() ; i++)
53 d(0,i) =
chi(x1.a-x2.a, x2.da(0,i), x1.da(0,i));
59 x1.def_domain && x2.def_domain
84 else if(x2.lb() > x1.ub() || y.lb() > x1.ub())
87 if((x2 &= y).is_empty())
91 else if(x1.lb() > x2.ub() || y.lb() > x2.ub())
93 if((x1 &= y).is_empty())
97 else if(y.ub() < x1.lb() || y.ub() < x2.lb())
108 x1 = Interval(x1.lb(),y.ub());
111 x2 = Interval(x2.lb(),y.ub());
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
Interval max(const Interval &x, const Interval &y)
Returns .
Definition codac2_Interval_operations_impl.h:274
Interval chi(const Interval &x, const Interval &y, const Interval &z)
Return if , if , else.
Definition codac2_Interval_operations_impl.h:299