21 template<
typename X1,
typename X2,
typename X3>
22 static std::string str(
const X1& x1,
const X2& x2,
const X3& x3)
24 return "χ(" + x1->str() +
"," + x2->str() +
"," + x3->str() +
")";
27 template<
typename X1,
typename X2,
typename X3>
28 static std::pair<Index,Index> output_shape([[maybe_unused]]
const X1& s1,
const X2& s2,
const X3& s3)
30 auto shape2 = s2->output_shape();
31 auto shape3 = s3->output_shape();
32 assert(shape2 == shape3);
36 static Interval fwd(
const Interval& x1,
const Interval& x2,
const Interval& x3);
37 static ScalarType fwd_natural(
const ScalarType& x1,
const ScalarType& x2,
const ScalarType& x3);
38 static ScalarType fwd_centered(
const ScalarType& x1,
const ScalarType& x2,
const ScalarType& x3);
39 static void bwd(
const Interval& y, Interval& x1, Interval& x2, Interval& x3);
46 chi(
const ScalarExpr& x1,
const ScalarExpr& x2,
const ScalarExpr& x3)
48 return { std::make_shared<AnalyticOperationExpr<ChiOp,ScalarType,ScalarType,ScalarType,ScalarType>>(x1,x2,x3) };
58 inline ScalarType ChiOp::fwd_natural(
const ScalarType& x1,
const ScalarType& x2,
const ScalarType& x3)
62 x1.def_domain && x2.def_domain && x3.def_domain
66 inline ScalarType ChiOp::fwd_centered(
const ScalarType& x1,
const ScalarType& x2,
const ScalarType& x3)
72 x1.def_domain && x2.def_domain && x3.def_domain
84 if((x2 &= y).is_empty())
93 if((x3 &= y).is_empty())
100 if(y.is_disjoint(x2))
102 if((x1 &= Interval(0,oo)).is_empty())
108 if((x3 &= y).is_empty())
115 if(y.is_disjoint(x3))
117 if((x1 &= Interval(-oo,0)).is_empty())
123 if((x2 &= y).is_empty())
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
Interval chi(const Interval &x, const Interval &y, const Interval &z)
Return if , if , else.
Definition codac2_Interval_operations_impl.h:299