23 template<
typename X1,
typename X2,
typename X3>
24 static std::string str(
const X1& x1,
const X2& x2,
const X3& x3)
26 return "χ(" + x1->str() +
"," + x2->str() +
"," + x3->str() +
")";
29 template<
typename X1,
typename X2,
typename X3>
30 static std::pair<Index,Index> output_shape([[maybe_unused]]
const X1& s1,
const X2& s2, [[maybe_unused]]
const X3& s3)
32 auto shape2 = s2->output_shape();
33 assert(shape2 == s3->output_shape());
38 static inline T fwd(
const Interval& x1,
const T& x2,
const T& x3)
50 static inline T fwd_natural(
const ScalarType& x1,
const T& x2,
const T& x3)
55 && ((x1.a.lb()>0.0) ? x2.def_domain :
true)
56 && ((x1.a.ub()<=0.0) ? x3.def_domain :
true)
61 static inline T fwd_centered(
const ScalarType& x1,
const T& x2,
const T& x3)
63 if(centered_form_not_available_for_args(x1,x2,x3))
64 return fwd_natural(x1,x2,x3);
66 assert(x2.da.rows() == x3.da.rows());
71 (x1.a.lb()>0 ? x3.da : ((x1.a.ub()<=0) ? x2.da : (x2.da | x3.da))),
73 && ((x1.a.lb()>0.0) ? x2.def_domain :
true)
74 && ((x1.a.ub()<=0.0) ? x3.def_domain :
true)
79 static inline void bwd(
const T& y, Interval& x1, T& x2, T& x3)
88 if((x2 &= y).is_empty())
97 if((x3 &= y).is_empty())
104 if(y.is_disjoint(x2))
106 if((x1 &= Interval(0,oo)).is_empty())
112 if((x3 &= y).is_empty())
119 if(y.is_disjoint(x3))
121 if((x1 &= Interval(-oo,0)).is_empty())
127 if((x2 &= y).is_empty())
139 template<typename T2,typename T3,typename T=ExprType<T2>::Type>
140 inline AnalyticExprWrapper<T>
141 chi(
const ScalarExpr& x1,
const T2& x2,
const T3& x3)
143 return { std::make_shared<AnalyticOperationExpr<ChiOp,T,ScalarType,T,T>>(
144 x1,(AnalyticExprWrapper<T>)x2,(AnalyticExprWrapper<T>)x3) };
Interval chi(const Interval &x, const Interval &y, const Interval &z)
Return if , if , else.
Definition codac2_Interval_operations_impl.h:299