23 static Interval fwd(
const Interval& x1,
const Interval& x2);
24 static ScalarType fwd_natural(
const ScalarType& x1,
const ScalarType& x2);
25 static ScalarType fwd_centered(
const ScalarType& x1,
const ScalarType& x2);
26 static void bwd(
const Interval& y, Interval& x1, Interval& x2);
28 static IntervalVector fwd(
const IntervalVector& x1,
const Interval& x2);
29 static VectorType fwd_natural(
const VectorType& x1,
const ScalarType& x2);
30 static VectorType fwd_centered(
const VectorType& x1,
const ScalarType& x2);
31 static void bwd(
const IntervalVector& y, IntervalVector& x1, Interval& x2);
33 static IntervalMatrix fwd(
const IntervalMatrix& x1,
const Interval& x2);
34 static MatrixType fwd_natural(
const MatrixType& x1,
const ScalarType& x2);
35 static MatrixType fwd_centered(
const MatrixType& x1,
const ScalarType& x2);
36 static void bwd(
const IntervalMatrix& y, IntervalMatrix& x1, Interval& x2);
43 operator/(
const ScalarExpr& x1,
const ScalarExpr& x2)
45 return { std::make_shared<AnalyticOperationExpr<DivOp,ScalarType,ScalarType,ScalarType>>(x1,x2) };
49 operator/(
const VectorExpr& x1,
const ScalarExpr& x2)
51 return { std::make_shared<AnalyticOperationExpr<DivOp,VectorType,VectorType,ScalarType>>(x1,x2) };
55 operator/(
const MatrixExpr& x1,
const ScalarExpr& x2)
57 return { std::make_shared<AnalyticOperationExpr<DivOp,MatrixType,MatrixType,ScalarType>>(x1,x2) };
67 inline ScalarType DivOp::fwd_natural(
const ScalarType& x1,
const ScalarType& x2)
71 x1.def_domain && x2.def_domain && x2.a != 0.
75 inline ScalarType DivOp::fwd_centered(
const ScalarType& x1,
const ScalarType& x2)
77 if(centered_form_not_available_for_args(x1,x2))
78 return fwd_natural(x1,x2);
80 assert(x1.da.size() == x2.da.size());
82 IntervalMatrix d(1,x1.da.size());
83 for(Index i = 0 ; i < d.size() ; i++)
84 d(0,i) = (x1.da(0,i)*x2.a-x1.a*x2.da(0,i))/
sqr(x2.a);
90 x1.def_domain && x2.def_domain && x2.a != 0.
96 if((x1 &= y*x2).is_empty())
102 MulOp::bwd(x1, tmp, x2);
108 inline IntervalVector DivOp::fwd(
const IntervalVector& x1,
const Interval& x2)
113 inline VectorType DivOp::fwd_natural(
const VectorType& x1,
const ScalarType& x2)
117 x1.def_domain && x2.def_domain && x2.a != 0.
121 inline VectorType DivOp::fwd_centered(
const VectorType& x1,
const ScalarType& x2)
123 if(centered_form_not_available_for_args(x1,x2))
124 return fwd_natural(x1,x2);
126 assert(x1.da.size() == x2.da.size());
128 IntervalMatrix d(1,x1.da.size());
129 assert_release(
false &&
"not implemented yet");
135 x1.def_domain && x2.def_domain && x2.a != 0.
139 inline void DivOp::bwd(
const IntervalVector& y, IntervalVector& x1,
Interval& x2)
141 assert(x1.size() == y.size());
142 for(Index i = 0 ; i < x1.size() ; i++)
143 DivOp::bwd(y[i], x1[i], x2);
146 inline IntervalMatrix DivOp::fwd(
const IntervalMatrix& x1,
const Interval& x2)
151 inline MatrixType DivOp::fwd_natural(
const MatrixType& x1,
const ScalarType& x2)
155 x1.def_domain && x2.def_domain && x2.a != 0.
159 inline MatrixType DivOp::fwd_centered(
const MatrixType& x1,
const ScalarType& x2)
161 if(centered_form_not_available_for_args(x1,x2))
162 return fwd_natural(x1,x2);
164 assert(x1.da.size() == x2.da.size());
170 x1.def_domain && x2.def_domain && x2.a != 0.
174 inline void DivOp::bwd([[maybe_unused]]
const IntervalMatrix& y, [[maybe_unused]] IntervalMatrix& x1, [[maybe_unused]]
Interval& x2)
176 assert(x1.size() == y.size());
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
Interval operator/(const Interval &x, double y)
Returns with .
Definition codac2_Interval_impl.h:435
Interval sqr(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:21