19 #define macro_unary_tube(f) \
22 for(auto it = y.tdomain()->begin() ; it != y.tdomain()->end() ; it++) \
24 auto sy = y.slice(it); \
25 sy->codomain() = f(sy->codomain()); \
30 #define macro_binary_tube_tube(f,output_type) \
32 assert_release(x1.tdomain() == x2.tdomain()); \
33 auto y = output_type; \
34 for(auto it = y.tdomain()->begin() ; it != y.tdomain()->end() ; it++) \
36 auto sy = y.slice(it); \
37 sy->codomain() = f(x1.slice(it)->codomain(), x2.slice(it)->codomain()); \
42 #define macro_binary_real_tube(f) \
45 for(auto it = y.tdomain()->begin() ; it != y.tdomain()->end() ; it++) \
47 auto sy = y.slice(it); \
48 sy->codomain() = f(x1, sy->codomain()); \
53 #define macro_binary_tube_real(f) \
56 for(auto it = y.tdomain()->begin() ; it != y.tdomain()->end() ; it++) \
58 auto sy = y.slice(it); \
59 sy->codomain() = f(sy->codomain(), x2); \
64 #define macro_member_binary_tube_tube(f) \
66 assert_release(x1.tdomain() == x2.tdomain()); \
67 for(auto it = x1.tdomain()->begin() ; it != x1.tdomain()->end() ; it++) \
69 auto sx1 = x1.slice(it); \
70 sx1->codomain() = f(sx1->codomain(), x2.slice(it)->codomain()); \
75 #define macro_member_binary_tube_real(f) \
77 for(auto it = x1.tdomain()->begin() ; it != x1.tdomain()->end() ; it++) \
79 auto sx1 = x1.slice(it); \
80 sx1->codomain() = f(sx1->codomain(), x2); \
86 struct is_slicedtube : std::false_type {};
89 struct is_slicedtube<
SlicedTube<U>> : std::true_type {};
92 inline constexpr bool is_slicedtube_v = is_slicedtube<std::remove_cvref_t<U>>::value;
95 concept NonSlicedTube = !is_slicedtube_v<Q>;
98 concept NonScalarTubeCodomain =
99 !std::is_same_v<std::remove_cvref_t<T>,
double> &&
100 !std::is_same_v<std::remove_cvref_t<T>,
Interval>;
103 inline T operator_tube_union(
const T& x1,
const T& x2) {
return x1 | x2; }
106 inline T operator_tube_intersection(
const T& x1,
const T& x2) {
return x1 & x2; }
108 template<
typename T,
typename X1,
typename X2>
109 inline T operator_tube_add(
const X1& x1,
const X2& x2) {
return x1 + x2; }
111 template<
typename T,
typename X1,
typename X2>
112 inline T operator_tube_sub(
const X1& x1,
const X2& x2) {
return x1 - x2; }
114 template<
typename T,
typename X1,
typename X2>
115 inline T operator_tube_mul(
const X1& x1,
const X2& x2) {
return x1 * x2; }
118 inline T operator_tube_scal_mul(
const Interval& x1,
const T& x2) {
return x1 * x2; }
121 inline T operator_tube_mul_scal(
const T& x1,
const Interval& x2) {
return x1 * x2; }
125 template<
typename T,
typename X1,
typename X2>
126 inline T operator_tube_div(
const X1& x1,
const X2& x2) {
return x1 / x2; }
128 template<
typename T,
typename X1>
129 inline T operator_tube_div_scal(
const X1& x1,
const Interval& x2) {
return x1 / x2; }
145 macro_member_binary_tube_tube(operator_tube_union<T>);
161 macro_binary_tube_tube(operator_tube_union<T>,x1);
177 macro_member_binary_tube_tube(operator_tube_intersection<T>);
193 macro_binary_tube_tube(operator_tube_intersection<T>,x1);
224 macro_binary_tube_tube(operator_tube_add<T>,x1);
238 template<
typename T,
typename Q>
239 requires NonSlicedTube<Q>
241 macro_binary_tube_real(operator_tube_add<T>);
255 template<
typename T,
typename Q>
256 requires NonSlicedTube<Q>
258 macro_binary_real_tube(operator_tube_add<T>);
267 template<
typename T,
typename Q>
268 requires NonSlicedTube<Q>
270 macro_member_binary_tube_real(operator_tube_add<T>);
281 macro_member_binary_tube_tube(operator_tube_add<T>);
312 macro_binary_tube_tube(operator_tube_sub<T>,x1);
326 template<
typename T,
typename Q>
327 requires NonSlicedTube<Q>
329 macro_binary_tube_real(operator_tube_sub<T>);
343 template<
typename T,
typename Q>
344 requires NonSlicedTube<Q>
346 macro_binary_real_tube(operator_tube_sub<T>);
355 template<
typename T,
typename Q>
356 requires NonSlicedTube<Q>
358 macro_member_binary_tube_real(operator_tube_sub<T>);
369 macro_member_binary_tube_tube(operator_tube_sub<T>);
384 requires (!std::is_same_v<T, double>)
386 macro_binary_real_tube(operator_tube_scal_mul<T>);
401 requires (!std::is_same_v<T, double>)
403 macro_binary_tube_real(operator_tube_mul_scal<T>);
415 macro_binary_tube_tube(operator_tube_mul<Interval>,x1);
427 macro_binary_tube_tube(operator_tube_mul<IntervalVector>,x1);
439 macro_binary_tube_tube(operator_tube_mul<IntervalMatrix>,x1);
453 requires NonScalarTubeCodomain<T>
455 macro_binary_tube_tube(operator_tube_mul<T>,x2);
469 requires NonScalarTubeCodomain<T>
471 macro_binary_tube_tube(operator_tube_mul<T>,x1);
485 template<
typename T,
typename Q>
486 requires NonSlicedTube<Q>
488 macro_binary_tube_real(operator_tube_mul<T>);
502 template<
typename T,
typename Q>
503 requires NonSlicedTube<Q>
505 macro_binary_real_tube(operator_tube_mul<T>);
517 macro_binary_tube_tube(operator_tube_mul_vec,x2);
526 template<
typename T,
typename Q>
527 requires NonSlicedTube<Q>
529 macro_member_binary_tube_real(operator_tube_mul<T>);
540 macro_member_binary_tube_tube(operator_tube_mul<T>);
554 requires NonScalarTubeCodomain<T>
556 macro_member_binary_tube_tube(operator_tube_mul<T>);
571 requires (!std::is_same_v<T, double>)
573 macro_binary_tube_real(operator_tube_div_scal<T>);
585 macro_binary_tube_tube(operator_tube_div<Interval>,x1);
599 requires NonScalarTubeCodomain<T>
601 macro_binary_tube_tube(operator_tube_div<T>,x1);
615 template<
typename T,
typename Q>
616 requires NonSlicedTube<Q>
618 macro_binary_tube_real(operator_tube_div<T>);
632 template<
typename T,
typename Q>
633 requires NonSlicedTube<Q>
635 macro_binary_real_tube(operator_tube_div<T>);
644 template<
typename T,
typename Q>
645 requires NonSlicedTube<Q>
647 macro_member_binary_tube_real(operator_tube_div<T>);
658 macro_member_binary_tube_tube(operator_tube_div<T>);
672 requires NonScalarTubeCodomain<T>
674 macro_member_binary_tube_tube(operator_tube_div<T>);
Interval class, for representing closed and connected subsets of .
Definition codac2_Interval.h:49
Tube represented over a sliced temporal domain.
Definition codac2_SlicedTube.h:38
Definition codac2_OctaSym.h:21
Interval ceil(const Interval &x)
Returns ceil of .
Definition codac2_Interval_operations_impl.h:294
Interval atan(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:133
SlicedTube< T > & operator&=(SlicedTube< T > &x1, const SlicedTube< T > &x2) macro_member_binary_tube_tube(operator_tube_intersection< T >)
Pointwise intersection assignment of two tubes with the same codomain type.
Interval max(const Interval &x, const Interval &y)
Returns .
Definition codac2_Interval_operations_impl.h:274
Interval operator*(const Interval &x, double y)
Returns with .
Definition codac2_Interval_impl.h:445
Interval asinh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:237
Interval atanh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:257
Interval pow(const Interval &x, int n)
Returns , .
Definition codac2_Interval_operations_impl.h:33
SlicedTube< T > & operator+=(SlicedTube< T > &x1, const Q &x2) macro_member_binary_tube_real(operator_tube_add< T >)
Pointwise addition assignment with a constant object of matching codomain type.
Interval sqrt(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:26
Interval operator/(const Interval &x, double y)
Returns with .
Definition codac2_Interval_impl.h:468
Interval cosh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:205
Interval floor(const Interval &x)
Returns floor of .
Definition codac2_Interval_operations_impl.h:289
Interval sinh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:216
Interval acos(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:119
Eigen::Matrix< Interval,-1, 1 > IntervalVector
Alias for a dynamic-size column vector of intervals.
Definition codac2_IntervalVector.h:25
Ellipsoid operator+(const Ellipsoid &e1, const Ellipsoid &e2)
Compute the Minkowski sum of two ellipsoids.
Interval atan2(const Interval &y, const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:140
Interval log(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:85
SlicedTube< T > & operator/=(SlicedTube< T > &x1, const Q &x2) macro_member_binary_tube_real(operator_tube_div< T >)
Pointwise division assignment with a constant object of matching codomain type.
CtcInterType< typenameC1::ContractedTypes >::Ctc operator&(const C1 &c1, const C2 &c2)
Builds an intersection contractor from two contractors.
Definition codac2_CtcInter.h:216
Interval operator-(const Interval &x, double y)
Returns with .
Definition codac2_Interval_impl.h:422
Interval cos(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:98
Interval exp(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:78
Interval tanh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:223
Interval sqr(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:21
SlicedTube< T > & operator|=(SlicedTube< T > &x1, const SlicedTube< T > &x2) macro_member_binary_tube_tube(operator_tube_union< T >)
Pointwise hull-union assignment of two tubes with the same codomain type.
SlicedTube< T > & operator-=(SlicedTube< T > &x1, const Q &x2) macro_member_binary_tube_real(operator_tube_sub< T >)
Pointwise subtraction assignment with a constant object of matching codomain type.
Interval abs(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:264
Interval asin(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:126
SlicedTube< T > & operator*=(SlicedTube< T > &x1, const Q &x2) macro_member_binary_tube_real(operator_tube_mul< T >)
Pointwise multiplication assignment with a constant object of matching codomain type.
Interval integer(const Interval &x)
Returns the largest integer interval included in .
Definition codac2_Interval_operations_impl.h:284
Interval min(const Interval &x, const Interval &y)
Returns .
Definition codac2_Interval_operations_impl.h:269
Eigen::Matrix< Interval,-1,-1 > IntervalMatrix
Alias for a dynamic-size matrix of intervals.
Definition codac2_IntervalMatrix.h:25
Interval acosh(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:230
Interval sign(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:279
Interval sin(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:105
Interval tan(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:112