17 #define macro_unary_traj(f) \
20 for(auto it = y.begin() ; it != y.end() ; it++) \
21 it->second = f(it->second); \
25 #define macro_binary_traj_traj(f) \
27 assert_release(x1.nb_samples() == x2.nb_samples()); \
29 auto it_y = y.begin(); \
30 auto it_x1 = x1.begin(); \
31 while(it_y != y.end()) \
33 assert_release(it_y->first == it_x1->first \
34 && "inconsistent dates between the two trajectories"); \
35 it_y->second = f(it_x1->second,it_y->second); \
41 #define macro_binary_real_traj(f) \
44 for(auto it_y = y.begin() ; it_y != y.end() ; it_y++) \
45 it_y->second = f(x1,it_y->second); \
49 #define macro_binary_traj_real(f) \
52 for(auto it_y = y.begin() ; it_y != y.end() ; it_y++) \
53 it_y->second = f(it_y->second,x2); \
57 #define macro_member_binary_traj_traj(f) \
59 assert_release(x1.nb_samples() == x2.nb_samples()); \
60 auto it_x1 = x1.begin(); \
61 auto it_x2 = x2.begin(); \
62 while(it_x1 != x1.end()) \
64 assert_release(it_x1->first == it_x2->first \
65 && "inconsistent dates between the two trajectories"); \
66 it_x1->second = f(it_x1->second,it_x2->second); \
72 #define macro_member_binary_traj_real(f) \
74 for(auto it_x1 = x1.begin() ; it_x1 != x1.end() ; it_x1++) \
75 it_x1->second = f(it_x1->second,x2); \
79 template<
typename T,
typename X1,
typename X2>
80 inline T operator_add(
const X1& x1,
const X2& x2) {
return x1 + x2; }
82 template<
typename T,
typename X1,
typename X2>
83 inline T operator_sub(
const X1& x1,
const X2& x2) {
return x1 - x2; }
85 template<
typename T,
typename X1,
typename X2>
86 inline T operator_mul(
const X1& x1,
const X2& x2) {
return x1 * x2; }
88 template<
typename T,
typename X2>
89 inline T operator_mul_scal(
double x1,
const X2& x2) {
return x1 * x2; }
91 template<
typename T,
typename X1>
92 inline T operator_mul_scal(
const X1& x1,
double x2) {
return x1 * x2; }
96 inline Vector operator_mul_aff(
const Eigen::Affine2d& x1,
const Vector& x2)
98 assert(x2.size() == 2);
99 return x1 * Eigen::Vector2d(x2);
102 template<
typename T,
typename X1,
typename X2>
103 inline T operator_div(
const X1& x1,
const X2& x2) {
return x1 / x2; }
105 template<
typename T,
typename X1>
106 inline T operator_div_scal(
const X1& x1,
double x2) {
return x1 / x2; }
113 inline const SampledTraj<T>&
operator+(
const SampledTraj<T>& x1) {
123 inline SampledTraj<T>
operator+(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
124 macro_binary_traj_traj(operator_add<T>);
131 template<
typename T,
typename Q>
132 inline SampledTraj<T>
operator+(
const SampledTraj<T>& x1,
const Q& x2)
133 macro_binary_traj_real(operator_add<T>);
140 template<
typename T,
typename Q>
141 inline SampledTraj<T>
operator+(
const Q& x1,
const SampledTraj<T>& x2)
142 macro_binary_real_traj(operator_add<T>);
150 template<
typename T,
typename Q>
151 inline SampledTraj<T>&
operator+=(SampledTraj<T>& x1,
const Q& x2)
152 macro_member_binary_traj_real(operator_add<T>);
161 inline SampledTraj<T>&
operator+=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
162 macro_member_binary_traj_traj(operator_add<T>);
169 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1) {
179 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
180 macro_binary_traj_traj(operator_sub<T>);
187 template<
typename T,
typename Q>
188 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1,
const Q& x2)
189 macro_binary_traj_real(operator_sub<T>);
196 template<
typename T,
typename Q>
197 inline SampledTraj<T>
operator-(
const Q& x1,
const SampledTraj<T>& x2)
198 macro_binary_real_traj(operator_sub<T>);
206 template<
typename T,
typename Q>
207 inline SampledTraj<T>&
operator-=(SampledTraj<T>& x1,
const Q& x2)
208 macro_member_binary_traj_real(operator_sub<T>);
217 inline SampledTraj<T>&
operator-=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
218 macro_member_binary_traj_traj(operator_sub<T>);
226 requires (!std::is_same_v<T,double>)
227 inline SampledTraj<T>
operator*(
double x1,
const SampledTraj<T>& x2)
228 macro_binary_real_traj(operator_mul_scal<T>);
236 requires (!std::is_same_v<T,double>)
237 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
double x2)
238 macro_binary_traj_real(operator_mul_scal<T>);
246 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
247 macro_binary_traj_traj(operator_mul<T>);
254 template<
typename T,
typename Q>
255 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
const Q& x2)
256 macro_binary_traj_real(operator_mul<T>);
263 template<
typename T,
typename Q>
264 inline SampledTraj<T>
operator*(
const Q& x1,
const SampledTraj<T>& x2)
265 macro_binary_real_traj(operator_mul<T>);
272 inline SampledTraj<Vector>
operator*(
const SampledTraj<Matrix>& x1,
const SampledTraj<Vector>& x2)
273 macro_binary_traj_traj(operator_mul_vec);
280 inline SampledTraj<Vector>
operator*(
const Eigen::Affine2d& x1,
const SampledTraj<Vector>& x2)
281 macro_binary_real_traj(operator_mul_aff);
289 template<
typename T,
typename Q>
290 inline SampledTraj<T>&
operator*=(SampledTraj<T>& x1,
const Q& x2)
291 macro_member_binary_traj_real(operator_mul<T>);
300 inline SampledTraj<T>&
operator*=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
301 macro_member_binary_traj_traj(operator_mul<T>);
309 requires (!std::is_same_v<T,double>)
310 inline SampledTraj<T>
operator/(
const SampledTraj<T>& x1,
double x2)
311 macro_binary_traj_real(operator_div_scal<T>);
319 inline SampledTraj<T>
operator/(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
320 macro_binary_traj_traj(operator_div<T>);
327 template<
typename T,
typename Q>
328 inline SampledTraj<T>
operator/(
const SampledTraj<T>& x1,
const Q& x2)
329 macro_binary_traj_real(operator_div<T>);
336 template<
typename T,
typename Q>
337 inline SampledTraj<T>
operator/(
const Q& x1,
const SampledTraj<T>& x2)
338 macro_binary_real_traj(operator_div<T>);
346 template<
typename T,
typename Q>
347 inline SampledTraj<T>&
operator/=(SampledTraj<T>& x1,
const Q& x2)
348 macro_member_binary_traj_real(operator_div<T>);
357 inline SampledTraj<T>&
operator/=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
358 macro_member_binary_traj_traj(operator_div<T>);
364 SampledTraj<double>
sqr(
const SampledTraj<double>& x1);
370 SampledTraj<double>
sqrt(
const SampledTraj<double>& x1);
377 SampledTraj<double>
pow(
const SampledTraj<double>& x1,
int x2);
384 SampledTraj<double>
pow(
const SampledTraj<double>& x1,
double x2);
391 SampledTraj<double>
root(
const SampledTraj<double>& x1,
int x2);
397 SampledTraj<double>
exp(
const SampledTraj<double>& x1);
403 SampledTraj<double>
log(
const SampledTraj<double>& x1);
409 SampledTraj<double>
cos(
const SampledTraj<double>& x1);
415 SampledTraj<double>
sin(
const SampledTraj<double>& x1);
421 SampledTraj<double>
tan(
const SampledTraj<double>& x1);
427 SampledTraj<double>
acos(
const SampledTraj<double>& x1);
433 SampledTraj<double>
asin(
const SampledTraj<double>& x1);
439 SampledTraj<double>
atan(
const SampledTraj<double>& x1);
446 SampledTraj<double>
atan2(
const SampledTraj<double>& x1,
const SampledTraj<double>& x2);
453 SampledTraj<double>
atan2(
const SampledTraj<double>& x1,
double x2);
460 SampledTraj<double>
atan2(
double x1,
const SampledTraj<double>& x2);
466 SampledTraj<double>
cosh(
const SampledTraj<double>& x1);
472 SampledTraj<double>
sinh(
const SampledTraj<double>& x1);
478 SampledTraj<double>
tanh(
const SampledTraj<double>& x1);
484 SampledTraj<double>
acosh(
const SampledTraj<double>& x1);
490 SampledTraj<double>
asinh(
const SampledTraj<double>& x1);
496 SampledTraj<double>
atanh(
const SampledTraj<double>& x1);
502 SampledTraj<double>
abs(
const SampledTraj<double>& x1);
509 SampledTraj<double>
min(
const SampledTraj<double>& x1,
const SampledTraj<double>& x2);
516 SampledTraj<double>
min(
const SampledTraj<double>& x1,
double x2);
523 SampledTraj<double>
min(
double x1,
const SampledTraj<double>& x2);
530 SampledTraj<double>
max(
const SampledTraj<double>& x1,
const SampledTraj<double>& x2);
537 SampledTraj<double>
max(
const SampledTraj<double>& x1,
double x2);
544 SampledTraj<double>
max(
double x1,
const SampledTraj<double>& x2);
546 SampledTraj<double>
sign(
const SampledTraj<double>& x1);
548 SampledTraj<double>
integer(
const SampledTraj<double>& x1);
550 SampledTraj<double>
floor(
const SampledTraj<double>& x1);
552 SampledTraj<double>
ceil(
const SampledTraj<double>& x1);
Definition codac2_OctaSym.h:21
Interval ceil(const Interval &x)
Returns ceil of .
Definition codac2_Interval_operations_impl.h:294
Eigen::Matrix< double,-1, 1 > Vector
Alias for a dynamically-sized column vector of doubles.
Definition codac2_Vector.h:24
Interval atan(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:133
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:461
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:484
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
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.
Interval operator-(const Interval &x, double y)
Returns with .
Definition codac2_Interval_impl.h:438
Eigen::Matrix< double,-1,-1 > Matrix
Alias for a dynamic-size matrix of doubles.
Definition codac2_Matrix.h:26
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 Q &x2) macro_member_binary_tube_real(operator_tube_sub< T >)
Pointwise subtraction assignment with a constant object of matching codomain type.
Interval root(const Interval &x, int p)
Returns the p-th root: .
Definition codac2_Interval_operations_impl.h:60
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
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