23 #define macro_unary_traj(f) \
26 for(auto it = y.begin() ; it != y.end() ; it++) \
27 it->second = f(it->second); \
31 #define macro_binary_traj_traj(f) \
33 assert_release(x1.nb_samples() == x2.nb_samples()); \
35 auto it_y = y.begin(); \
36 auto it_x1 = x1.begin(); \
37 while(it_y != y.end()) \
39 assert_release(it_y->first == it_x1->first \
40 && "inconsistent dates between the two trajectories"); \
41 it_y->second = f(it_x1->second,it_y->second); \
47 #define macro_binary_real_traj(f) \
50 for(auto it_y = y.begin() ; it_y != y.end() ; it_y++) \
51 it_y->second = f(x1,it_y->second); \
55 #define macro_binary_traj_real(f) \
58 for(auto it_y = y.begin() ; it_y != y.end() ; it_y++) \
59 it_y->second = f(it_y->second,x2); \
63 #define macro_member_binary_traj_traj(f) \
65 assert_release(x1.nb_samples() == x2.nb_samples()); \
66 auto it_x1 = x1.begin(); \
67 auto it_x2 = x2.begin(); \
68 while(it_x1 != x1.end()) \
70 assert_release(it_x1->first == it_x2->first \
71 && "inconsistent dates between the two trajectories"); \
72 it_x1->second = f(it_x1->second,it_x2->second); \
78 #define macro_member_binary_traj_real(f) \
80 for(auto it_x1 = x1.begin() ; it_x1 != x1.end() ; it_x1++) \
81 it_x1->second = f(it_x1->second,x2); \
85 template<
typename T,
typename X1,
typename X2>
86 inline T operator_add(
const X1& x1,
const X2& x2) {
return x1 + x2; }
88 template<
typename T,
typename X1,
typename X2>
89 inline T operator_sub(
const X1& x1,
const X2& x2) {
return x1 - x2; }
91 template<
typename T,
typename X1,
typename X2>
92 inline T operator_mul(
const X1& x1,
const X2& x2) {
return x1 * x2; }
94 template<
typename T,
typename X2>
95 inline T operator_mul_scal(
double x1,
const X2& x2) {
return x1 * x2; }
97 template<
typename T,
typename X1>
98 inline T operator_mul_scal(
const X1& x1,
double x2) {
return x1 * x2; }
100 inline Matrix operator_mul_vec(
const Matrix& x1,
const Vector& x2) {
return x1 * x2; }
102 inline Vector operator_mul_aff(
const Eigen::Affine2d& x1,
const Vector& x2)
104 assert(x2.size() == 2);
105 return x1 * Eigen::Vector2d(x2);
108 template<
typename T,
typename X1,
typename X2>
109 inline T operator_div(
const X1& x1,
const X2& x2) {
return x1 / x2; }
111 template<
typename T,
typename X1>
112 inline T operator_div_scal(
const X1& x1,
double x2) {
return x1 / x2; }
119 inline const SampledTraj<T>&
operator+(
const SampledTraj<T>& x1) {
129 inline SampledTraj<T>
operator+(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
130 macro_binary_traj_traj(operator_add<T>)
137 template<
typename T,
typename Q>
138 inline SampledTraj<T>
operator+(
const SampledTraj<T>& x1,
const Q& x2)
139 macro_binary_traj_real(operator_add<T>)
146 template<
typename T,
typename Q>
147 inline SampledTraj<T>
operator+(
const Q& x1,
const SampledTraj<T>& x2)
148 macro_binary_real_traj(operator_add<T>)
156 template<
typename T,
typename Q>
157 inline SampledTraj<T>&
operator+=(SampledTraj<T>& x1,
const Q& x2)
158 macro_member_binary_traj_real(operator_add<T>)
167 inline SampledTraj<T>&
operator+=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
168 macro_member_binary_traj_traj(operator_add<T>)
175 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1) {
185 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
186 macro_binary_traj_traj(operator_sub<T>)
193 template<
typename T,
typename Q>
194 inline SampledTraj<T>
operator-(
const SampledTraj<T>& x1,
const Q& x2)
195 macro_binary_traj_real(operator_sub<T>)
202 template<
typename T,
typename Q>
203 inline SampledTraj<T>
operator-(
const Q& x1,
const SampledTraj<T>& x2)
204 macro_binary_real_traj(operator_sub<T>)
212 template<
typename T,
typename Q>
213 inline SampledTraj<T>&
operator-=(SampledTraj<T>& x1,
const Q& x2)
214 macro_member_binary_traj_real(operator_sub<T>)
223 inline SampledTraj<T>&
operator-=(SampledTraj<T>& x1,
const SampledTraj<T>& x2)
224 macro_member_binary_traj_traj(operator_sub<T>)
232 requires (!std::is_same_v<T,double>)
233 inline SampledTraj<T>
operator*(
double x1,
const SampledTraj<T>& x2)
234 macro_binary_real_traj(operator_mul_scal<T>)
242 requires (!std::is_same_v<T,double>)
243 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
double x2)
244 macro_binary_traj_real(operator_mul_scal<T>)
252 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
const SampledTraj<T>& x2)
253 macro_binary_traj_traj(operator_mul<T>)
260 template<
typename T,
typename Q>
261 inline SampledTraj<T>
operator*(
const SampledTraj<T>& x1,
const Q& x2)
262 macro_binary_traj_real(operator_mul<T>)
269 template<
typename T,
typename Q>
270 inline SampledTraj<T>
operator*(
const Q& x1,
const SampledTraj<T>& x2)
271 macro_binary_real_traj(operator_mul<T>)
279 macro_binary_traj_traj(operator_mul_vec)
287 macro_binary_real_traj(operator_mul_aff)
295 template<typename T,typename Q>
296 inline SampledTraj<T>& operator*=(SampledTraj<T>& x1, const Q& x2)
297 macro_member_binary_traj_real(operator_mul<T>)
306 inline SampledTraj<T>& operator*=(SampledTraj<T>& x1, const SampledTraj<T>& x2)
307 macro_member_binary_traj_traj(operator_mul<T>)
315 requires (!std::is_same_v<T,
double>)
316 inline SampledTraj<T> operator/(const SampledTraj<T>& x1,
double x2)
317 macro_binary_traj_real(operator_div_scal<T>)
325 inline SampledTraj<T> operator/(const SampledTraj<T>& x1, const SampledTraj<T>& x2)
326 macro_binary_traj_traj(operator_div<T>)
333 template<typename T,typename Q>
334 inline SampledTraj<T> operator/(const SampledTraj<T>& x1, const Q& x2)
335 macro_binary_traj_real(operator_div<T>)
342 template<typename T,typename Q>
343 inline SampledTraj<T> operator/(const Q& x1, const SampledTraj<T>& x2)
344 macro_binary_real_traj(operator_div<T>)
352 template<typename T,typename Q>
353 inline SampledTraj<T>& operator/=(SampledTraj<T>& x1, const Q& x2)
354 macro_member_binary_traj_real(operator_div<T>)
363 inline SampledTraj<T>& operator/=(SampledTraj<T>& x1, const SampledTraj<T>& x2)
364 macro_member_binary_traj_traj(operator_div<T>)
370 SampledTraj<
double>
sqr(const SampledTraj<
double>& x1);
376 SampledTraj<
double>
sqrt(const SampledTraj<
double>& x1);
383 SampledTraj<
double>
pow(const SampledTraj<
double>& x1,
int x2);
390 SampledTraj<
double>
pow(const SampledTraj<
double>& x1,
double x2);
397 SampledTraj<
double>
root(const SampledTraj<
double>& x1,
int x2);
403 SampledTraj<
double>
exp(const SampledTraj<
double>& x1);
409 SampledTraj<
double>
log(const SampledTraj<
double>& x1);
415 SampledTraj<
double>
cos(const SampledTraj<
double>& x1);
421 SampledTraj<
double>
sin(const SampledTraj<
double>& x1);
427 SampledTraj<
double>
tan(const SampledTraj<
double>& x1);
433 SampledTraj<
double>
acos(const SampledTraj<
double>& x1);
439 SampledTraj<
double>
asin(const SampledTraj<
double>& x1);
445 SampledTraj<
double>
atan(const SampledTraj<
double>& x1);
452 SampledTraj<
double>
atan2(const SampledTraj<
double>& x1, const SampledTraj<
double>& x2);
459 SampledTraj<
double>
atan2(const SampledTraj<
double>& x1,
double x2);
466 SampledTraj<
double>
atan2(
double x1, const SampledTraj<
double>& x2);
472 SampledTraj<
double>
cosh(const SampledTraj<
double>& x1);
478 SampledTraj<
double>
sinh(const SampledTraj<
double>& x1);
484 SampledTraj<
double>
tanh(const SampledTraj<
double>& x1);
490 SampledTraj<
double>
acosh(const SampledTraj<
double>& x1);
496 SampledTraj<
double>
asinh(const SampledTraj<
double>& x1);
502 SampledTraj<
double>
atanh(const SampledTraj<
double>& x1);
508 SampledTraj<
double>
abs(const SampledTraj<
double>& x1);
515 SampledTraj<
double>
min(const SampledTraj<
double>& x1, const SampledTraj<
double>& x2);
522 SampledTraj<
double>
min(const SampledTraj<
double>& x1,
double x2);
529 SampledTraj<
double>
min(
double x1, const SampledTraj<
double>& x2);
536 SampledTraj<
double>
max(const SampledTraj<
double>& x1, const SampledTraj<
double>& x2);
543 SampledTraj<
double>
max(const SampledTraj<
double>& x1,
double x2);
550 SampledTraj<
double>
max(
double x1, const SampledTraj<
double>& x2);
552 SampledTraj<
double>
sign(const SampledTraj<
double>& x1);
554 SampledTraj<
double>
integer(const SampledTraj<
double>& x1);
556 SampledTraj<
double>
floor(const SampledTraj<
double>& x1);
558 SampledTraj<
double>
ceil(const SampledTraj<
double>& x1);
Definition codac2_matrices.h:47
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
SlicedTube< T > & operator+=(SlicedTube< T > &x1, const Q &x2)
Pointwise addition assignment with a constant object of matching codomain type.
Definition codac2_SlicedTube_operations.h:275
Interval max(const Interval &x, const Interval &y)
Returns .
Definition codac2_Interval_operations_impl.h:274
SlicedTube< T > & operator-=(SlicedTube< T > &x1, const Q &x2)
Pointwise subtraction assignment with a constant object of matching codomain type.
Definition codac2_SlicedTube_operations.h:363
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
Interval sqrt(const Interval &x)
Returns .
Definition codac2_Interval_operations_impl.h:26
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
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
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
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