23 static Interval fwd(
const Interval& x1);
24 static ScalarType fwd_natural(
const ScalarType& x1);
25 static ScalarType fwd_centered(
const ScalarType& x1);
26 static void bwd(
const Interval& y, Interval& x1);
28 static IntervalVector fwd(
const IntervalVector& x1);
29 static VectorType fwd_natural(
const VectorType& x1);
30 static VectorType fwd_centered(
const VectorType& x1);
31 static void bwd(
const IntervalVector& y, IntervalVector& x1);
33 static IntervalMatrix fwd(
const IntervalMatrix& x1);
34 static MatrixType fwd_natural(
const MatrixType& x1);
35 static MatrixType fwd_centered(
const MatrixType& x1);
36 static void bwd(
const IntervalMatrix& y, IntervalMatrix& x1);
39 static Interval fwd(
const Interval& x1,
const Interval& x2);
40 static ScalarType fwd_natural(
const ScalarType& x1,
const ScalarType& x2);
41 static ScalarType fwd_centered(
const ScalarType& x1,
const ScalarType& x2);
42 static void bwd(
const Interval& y, Interval& x1, Interval& x2);
44 static IntervalVector fwd(
const IntervalVector& x1,
const IntervalVector& x2);
45 static VectorType fwd_natural(
const VectorType& x1,
const VectorType& x2);
46 static VectorType fwd_centered(
const VectorType& x1,
const VectorType& x2);
47 static void bwd(
const IntervalVector& y, IntervalVector& x1, IntervalVector& x2);
49 static IntervalMatrix fwd(
const IntervalMatrix& x1,
const IntervalMatrix& x2);
50 static MatrixType fwd_natural(
const MatrixType& x1,
const MatrixType& x2);
51 static MatrixType fwd_centered(
const MatrixType& x1,
const MatrixType& x2);
52 static void bwd(
const IntervalMatrix& y, IntervalMatrix& x1, IntervalMatrix& x2);
61 return { std::make_shared<AnalyticOperationExpr<AddOp,ScalarType,ScalarType>>(x1) };
67 return { std::make_shared<AnalyticOperationExpr<AddOp,VectorType,VectorType>>(x1) };
73 return { std::make_shared<AnalyticOperationExpr<AddOp,MatrixType,MatrixType>>(x1) };
82 return { std::make_shared<AnalyticOperationExpr<AddOp,ScalarType,ScalarType,ScalarType>>(x1,x2) };
88 return { std::make_shared<AnalyticOperationExpr<AddOp,VectorType,VectorType,VectorType>>(x1,x2) };
94 return { std::make_shared<AnalyticOperationExpr<AddOp,MatrixType,MatrixType,MatrixType>>(x1,x2) };
104 inline ScalarType AddOp::fwd_natural(
const ScalarType& x1)
112 inline ScalarType AddOp::fwd_centered(
const ScalarType& x1)
122 inline void AddOp::bwd([[maybe_unused]]
const Interval& y, [[maybe_unused]]
Interval& x1)
125 inline IntervalVector AddOp::fwd(
const IntervalVector& x1)
130 inline VectorType AddOp::fwd_natural(
const VectorType& x1)
138 inline VectorType AddOp::fwd_centered(
const VectorType& x1)
148 inline void AddOp::bwd([[maybe_unused]]
const IntervalVector& y, [[maybe_unused]] IntervalVector& x1)
150 assert(y.size() == x1.size());
153 inline IntervalMatrix AddOp::fwd(
const IntervalMatrix& x1)
158 inline MatrixType AddOp::fwd_natural(
const MatrixType& x1)
166 inline MatrixType AddOp::fwd_centered(
const MatrixType& x1)
168 if(centered_form_not_available_for_args(x1))
169 return fwd_natural(x1);
179 inline void AddOp::bwd([[maybe_unused]]
const IntervalMatrix& y, [[maybe_unused]] IntervalMatrix& x1)
181 assert(y.size() == x1.size());
189 inline ScalarType AddOp::fwd_natural(
const ScalarType& x1,
const ScalarType& x2)
193 x1.def_domain && x2.def_domain
197 inline ScalarType AddOp::fwd_centered(
const ScalarType& x1,
const ScalarType& x2)
199 if(centered_form_not_available_for_args(x1,x2))
200 return fwd_natural(x1,x2);
202 assert(x1.da.size() == x2.da.size());
207 x1.def_domain && x2.def_domain
213 if((x1 &= y-x2).is_empty())
216 else if((x2 &= y-x1).is_empty())
220 inline IntervalVector AddOp::fwd(
const IntervalVector& x1,
const IntervalVector& x2)
222 assert(x1.size() == x2.size());
226 inline VectorType AddOp::fwd_natural(
const VectorType& x1,
const VectorType& x2)
230 x1.def_domain && x2.def_domain
234 inline VectorType AddOp::fwd_centered(
const VectorType& x1,
const VectorType& x2)
236 if(centered_form_not_available_for_args(x1,x2))
237 return fwd_natural(x1,x2);
239 assert(x1.da.rows() == x2.da.rows() && x1.da.cols() == x2.da.cols());
244 x1.def_domain && x2.def_domain
248 inline void AddOp::bwd(
const IntervalVector& y, IntervalVector& x1, IntervalVector& x2)
250 assert(y.size() == x1.size() && y.size() == x2.size());
251 for(Index i = 0 ; i < y.size() ; i++)
252 AddOp::bwd(y[i], x1[i], x2[i]);
255 inline IntervalMatrix AddOp::fwd(
const IntervalMatrix& x1,
const IntervalMatrix& x2)
257 assert(x1.size() == x2.size());
261 inline MatrixType AddOp::fwd_natural(
const MatrixType& x1,
const MatrixType& x2)
265 x1.def_domain && x2.def_domain
269 inline MatrixType AddOp::fwd_centered(
const MatrixType& x1,
const MatrixType& x2)
275 x1.def_domain && x2.def_domain
279 inline void AddOp::bwd(
const IntervalMatrix& y, IntervalMatrix& x1, IntervalMatrix& x2)
281 assert(y.size() == x1.size() && y.size() == x2.size());
282 for(Index i = 0 ; i < y.size() ; i++)
283 AddOp::bwd(*(y.data()+i), *(x1.data()+i), *(x2.data()+i));
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:62
Ellipsoid operator+(const Ellipsoid &e1, const Ellipsoid &e2)
Compute the Minkowski sum of two ellipsoids.