USML
matrix_math.h
1 
24 #ifndef USML_UBLAS_MATRIX_MATH_H
25 #define USML_UBLAS_MATRIX_MATH_H
26 
27 #include <usml/ublas/scalar_math.h>
28 
29 namespace usml {
30 namespace ublas {
31 
32  //**********************************************************
33  // scalar addition
34 
39  template<class E1, class T2> BOOST_UBLAS_INLINE
40  typename boost::enable_if< boost::is_convertible< T2, typename E1::value_type >,
41  typename matrix_binary_scalar2_traits<E1, const T2, scalar_plus<typename E1::value_type, T2> >::result_type
42  >::type
43  operator + (const matrix_expression<E1> &e1, const T2 &e2) {
44  typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_plus<typename E1::value_type, T2> >::expression_type expression_type;
45  return expression_type (e1 (), e2);
46  }
47 
52  template<class T1, class E2> BOOST_UBLAS_INLINE
53  typename boost::enable_if< boost::is_convertible<T1, typename E2::value_type >,
54  typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::result_type
55  >::type
56  operator + (const T1 &e1, const matrix_expression<E2> &e2) {
57  typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::expression_type expression_type;
58  return expression_type (e1, e2 ());
59  }
60 
65  template<class E1, class T2> BOOST_UBLAS_INLINE
66  typename boost::enable_if< boost::is_convertible< T2, typename E1::value_type >,
67  typename matrix_binary_scalar2_traits<E1, const T2, scalar_minus<typename E1::value_type, T2> >::result_type
68  >::type
69  operator - (const matrix_expression<E1> &e1, const T2 &e2) {
70  typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_minus<typename E1::value_type, T2> >::expression_type expression_type;
71  return expression_type (e1 (), e2);
72  }
73 
78  template<class T1, class E2> BOOST_UBLAS_INLINE
79  typename boost::enable_if< boost::is_convertible<T1, typename E2::value_type >,
80  typename matrix_binary_scalar1_traits<const T1, E2, scalar_minus<T1, typename E2::value_type> >::result_type
81  >::type
82  operator - (const T1 &e1, const matrix_expression<E2> &e2) {
83  typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_minus<T1, typename E2::value_type> >::expression_type expression_type;
84  return expression_type (e1, e2 ());
85  }
86 
87  //**********************************************************
88  // scalar division
89 
94  template<class T1, class E2> BOOST_UBLAS_INLINE
95  typename boost::enable_if< boost::is_convertible<T1, typename E2::value_type >,
96  typename matrix_binary_scalar1_traits<const T1, E2, scalar_divides<T1, typename E2::value_type> >::result_type
97  >::type
98  operator / (const T1 &e1, const matrix_expression<E2> &e2) {
99  typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_divides<T1, typename E2::value_type> >::expression_type expression_type;
100  return expression_type (e1, e2 ());
101  }
102 
103  //**********************************************************
104  // element multiplication
105 
109  template<class E1, class E2> BOOST_UBLAS_INLINE
110  typename boost::enable_if< boost::is_convertible< E1, E2 >,
111  typename matrix_binary_traits<E1, E2, scalar_multiplies<
112  typename E1::value_type, typename E2::value_type> >::result_type
113  >::type
114  operator * ( const matrix_expression<E1> &u, const matrix_expression<E2> &v ) {
115  return element_prod( u(), v() ) ;
116  }
117 
121  template<class E1, class E2> BOOST_UBLAS_INLINE
122  typename boost::enable_if< boost::is_convertible< E1, E2 >,
123  typename matrix_binary_traits<E1, E2, scalar_divides<
124  typename E1::value_type, typename E2::value_type> >::result_type
125  >::type
126  operator / ( const matrix_expression<E1> &u, const matrix_expression<E2> &v ) {
127  return element_div( u(), v() ) ;
128  }
129 
130  //**********************************************************
131  // limiting functions
132 
139  template<class E1, class T2> BOOST_UBLAS_INLINE
140  typename boost::enable_if< boost::is_convertible< T2, typename E1::value_type >,
141  typename matrix_binary_scalar2_traits<E1, const T2, scalar_max<typename E1::value_type, T2> >::result_type
142  >::type
143  max (const matrix_expression<E1> &e1, const T2 &e2) {
144  typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_max<typename E1::value_type, T2> >::expression_type expression_type;
145  return expression_type (e1 (), e2);
146  }
147 
154  template<class E1, class T2> BOOST_UBLAS_INLINE
155  typename boost::enable_if< boost::is_convertible< T2, typename E1::value_type >,
156  typename matrix_binary_scalar2_traits<E1, const T2, scalar_min<typename E1::value_type, T2> >::result_type
157  >::type
158  min (const matrix_expression<E1> &e1, const T2 &e2) {
159  typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_min<typename E1::value_type, T2> >::expression_type expression_type;
160  return expression_type (e1 (), e2);
161  }
162 
167  template<class E> BOOST_UBLAS_INLINE
168  typename matrix_unary1_traits<E,
169  scalar_floor<typename E::value_type> >::result_type
170  floor(const matrix_expression<E> &e) {
171  typedef typename matrix_unary1_traits<E,
172  scalar_floor<typename E::value_type> >::expression_type
173  expression_type;
174  return expression_type( e() );
175  }
176 
181  template<class E> BOOST_UBLAS_INLINE
182  typename matrix_unary1_traits<E,
183  scalar_ceil<typename E::value_type> >::result_type
184  ceil(const matrix_expression<E> &e) {
185  typedef typename matrix_unary1_traits<E,
186  scalar_ceil<typename E::value_type> >::expression_type
187  expression_type;
188  return expression_type( e() );
189  }
190 
191  //**********************************************************
192  // conversion functions
193 
197  template<class E> BOOST_UBLAS_INLINE
198  typename matrix_unary1_traits<E,
199  scalar_to_degrees<typename E::value_type> >::result_type
200  to_degrees(const matrix_expression<E> &e) {
201  typedef typename matrix_unary1_traits<E,
203  expression_type;
204  return expression_type( e() );
205  }
206 
210  template<class E> BOOST_UBLAS_INLINE
211  typename matrix_unary1_traits<E,
212  scalar_to_radians<typename E::value_type> >::result_type
213  to_radians(const matrix_expression<E> &e) {
214  typedef typename matrix_unary1_traits<E,
216  expression_type;
217  return expression_type( e() );
218  }
219 
224  template<class E> BOOST_UBLAS_INLINE
225  typename matrix_unary1_traits<E,
226  scalar_to_latitude<typename E::value_type> >::result_type
227  to_latitude(const matrix_expression<E> &e) {
228  typedef typename matrix_unary1_traits<E,
230  expression_type;
231  return expression_type( e() );
232  }
233 
238  template<class E> BOOST_UBLAS_INLINE
239  typename matrix_unary1_traits<E,
240  scalar_to_colatitude<typename E::value_type> >::result_type
241  to_colatitude(const matrix_expression<E> &e) {
242  typedef typename matrix_unary1_traits<E,
244  expression_type;
245  return expression_type( e() );
246  }
247 
248  //**********************************************************
249  // algebraic functions
250 
254  template<class E> BOOST_UBLAS_INLINE
255  typename matrix_unary1_traits<E,
256  scalar_abs<typename E::value_type> >::result_type
257  abs(const matrix_expression<E> &e) {
258  typedef typename matrix_unary1_traits<E,
259  scalar_abs<typename E::value_type> >::expression_type
260  expression_type;
261  return expression_type( e() );
262  }
263 
267  template<class E> BOOST_UBLAS_INLINE
268  typename matrix_unary1_traits<E,
269  scalar_abs2<typename E::value_type> >::result_type
270  abs2(const matrix_expression<E> &e) {
271  typedef typename matrix_unary1_traits<E,
272  scalar_abs2<typename E::value_type> >::expression_type
273  expression_type;
274  return expression_type( e() );
275  }
276 
280  template<class E> BOOST_UBLAS_INLINE
281  typename matrix_unary1_traits<E,
282  scalar_arg<typename E::value_type> >::result_type
283  arg(const matrix_expression<E> &e) {
284  typedef typename matrix_unary1_traits<E,
285  scalar_arg<typename E::value_type> >::expression_type
286  expression_type;
287  return expression_type( e() );
288  }
289 
293  template<class E> BOOST_UBLAS_INLINE
294  typename matrix_unary1_traits<E,
295  scalar_sqrt<typename E::value_type> >::result_type
296  sqrt(const matrix_expression<E> &e) {
297  typedef typename matrix_unary1_traits<E,
298  scalar_sqrt<typename E::value_type> >::expression_type
299  expression_type;
300  return expression_type( e() );
301  }
302 
308  template<class E1, class E2> BOOST_UBLAS_INLINE
309  typename matrix_binary_traits<E1, E2, scalar_copysign<
310  typename E1::value_type, typename E2::value_type> >::result_type
311  copysign( const matrix_expression<E1> &u, const matrix_expression<E2> &v ) {
312  typedef typename matrix_binary_traits<E1, E2,
314  >::expression_type expression_type;
315  return expression_type( u(), v() );
316  }
317 
318 
319  //**********************************************************
320  // standard trigonometric functions
321 
325  template<class E> BOOST_UBLAS_INLINE
326  typename matrix_unary1_traits<E,
327  scalar_cos<typename E::value_type> >::result_type
328  cos(const matrix_expression<E> &e) {
329  typedef typename matrix_unary1_traits<E,
330  scalar_cos<typename E::value_type> >::expression_type
331  expression_type;
332  return expression_type( e() );
333  }
334 
338  template<class E> BOOST_UBLAS_INLINE
339  typename matrix_unary1_traits<E,
340  scalar_cosh<typename E::value_type> >::result_type
341  cosh(const matrix_expression<E> &e) {
342  typedef typename matrix_unary1_traits<E,
343  scalar_cosh<typename E::value_type> >::expression_type
344  expression_type;
345  return expression_type( e() );
346  }
347 
351  template<class E> BOOST_UBLAS_INLINE
352  typename matrix_unary1_traits<E,
353  scalar_sin<typename E::value_type> >::result_type
354  sin(const matrix_expression<E> &e) {
355  typedef typename matrix_unary1_traits<E,
356  scalar_sin<typename E::value_type> >::expression_type
357  expression_type;
358  return expression_type( e() );
359  }
360 
364  template<class E> BOOST_UBLAS_INLINE
365  typename matrix_unary1_traits<E,
366  scalar_sinh<typename E::value_type> >::result_type
367  sinh(const matrix_expression<E> &e) {
368  typedef typename matrix_unary1_traits<E,
369  scalar_sinh<typename E::value_type> >::expression_type
370  expression_type;
371  return expression_type( e() );
372  }
373 
377  template<class E> BOOST_UBLAS_INLINE
378  typename matrix_unary1_traits<E,
379  scalar_tan<typename E::value_type> >::result_type
380  tan(const matrix_expression<E> &e) {
381  typedef typename matrix_unary1_traits<E,
382  scalar_tan<typename E::value_type> >::expression_type
383  expression_type;
384  return expression_type( e() );
385  }
386 
390  template<class E> BOOST_UBLAS_INLINE
391  typename matrix_unary1_traits<E,
392  scalar_tanh<typename E::value_type> >::result_type
393  tanh(const matrix_expression<E> &e) {
394  typedef typename matrix_unary1_traits<E,
395  scalar_tanh<typename E::value_type> >::expression_type
396  expression_type;
397  return expression_type( e() );
398  }
399 
400  //**********************************************************
401  // inverse trigonometric functions
402 
406  template<class E> BOOST_UBLAS_INLINE
407  typename matrix_unary1_traits<E,
408  scalar_acos<typename E::value_type> >::result_type
409  acos(const matrix_expression<E> &e) {
410  typedef typename matrix_unary1_traits<E,
411  scalar_acos<typename E::value_type> >::expression_type
412  expression_type;
413  return expression_type( e() );
414  }
415 
419  template<class E> BOOST_UBLAS_INLINE
420  typename matrix_unary1_traits<E,
421  scalar_acosh<typename E::value_type> >::result_type
422  acosh(const matrix_expression<E> &e) {
423  typedef typename matrix_unary1_traits<E,
424  scalar_acosh<typename E::value_type> >::expression_type
425  expression_type;
426  return expression_type( e() );
427  }
428 
432  template<class E> BOOST_UBLAS_INLINE
433  typename matrix_unary1_traits<E,
434  scalar_asin<typename E::value_type> >::result_type
435  asin(const matrix_expression<E> &e) {
436  typedef typename matrix_unary1_traits<E,
437  scalar_asin<typename E::value_type> >::expression_type
438  expression_type;
439  return expression_type( e() );
440  }
441 
445  template<class E> BOOST_UBLAS_INLINE
446  typename matrix_unary1_traits<E,
447  scalar_asinh<typename E::value_type> >::result_type
448  asinh(const matrix_expression<E> &e) {
449  typedef typename matrix_unary1_traits<E,
450  scalar_asinh<typename E::value_type> >::expression_type
451  expression_type;
452  return expression_type( e() );
453  }
454 
458  template<class E> BOOST_UBLAS_INLINE
459  typename matrix_unary1_traits<E,
460  scalar_atan<typename E::value_type> >::result_type
461  atan(const matrix_expression<E> &e) {
462  typedef typename matrix_unary1_traits<E,
463  scalar_atan<typename E::value_type> >::expression_type
464  expression_type;
465  return expression_type( e() );
466  }
467 
471  template<class E1, class E2> BOOST_UBLAS_INLINE
472  typename matrix_binary_traits<E1, E2, scalar_atan2<
473  typename E1::value_type, typename E2::value_type> >::result_type
474  atan2( const matrix_expression<E1> &y, const matrix_expression<E2> &x ) {
475  typedef typename matrix_binary_traits<E1, E2,
477  >::expression_type expression_type;
478  return expression_type( y(), x() );
479  }
480 
484  template<class E> BOOST_UBLAS_INLINE
485  typename matrix_unary1_traits<E,
486  scalar_atanh<typename E::value_type> >::result_type
487  atanh(const matrix_expression<E> &e) {
488  typedef typename matrix_unary1_traits<E,
489  scalar_atanh<typename E::value_type> >::expression_type
490  expression_type;
491  return expression_type( e() );
492  }
493 
494  //**********************************************************
495  // standard exponential functions
496 
500  template<class E> BOOST_UBLAS_INLINE
501  typename matrix_unary1_traits<E,
502  scalar_exp<typename E::value_type> >::result_type
503  exp(const matrix_expression<E> &e) {
504  typedef typename matrix_unary1_traits<E,
505  scalar_exp<typename E::value_type> >::expression_type
506  expression_type;
507  return expression_type( e() );
508  }
509 
513  template<class E> BOOST_UBLAS_INLINE
514  typename matrix_unary1_traits<E,
515  scalar_log<typename E::value_type> >::result_type
516  log(const matrix_expression<E> &e) {
517  typedef typename matrix_unary1_traits<E,
518  scalar_log<typename E::value_type> >::expression_type
519  expression_type;
520  return expression_type( e() );
521  }
522 
526  template<class E> BOOST_UBLAS_INLINE
527  typename matrix_unary1_traits<E,
528  scalar_log10<typename E::value_type> >::result_type
529  log10(const matrix_expression<E> &e) {
530  typedef typename matrix_unary1_traits<E,
531  scalar_log10<typename E::value_type> >::expression_type
532  expression_type;
533  return expression_type( e() );
534  }
535 
540  template<class E1, class T2> BOOST_UBLAS_INLINE
541  typename boost::enable_if< boost::is_convertible< T2, typename E1::value_type >,
542  typename matrix_binary_scalar2_traits<E1, const T2, scalar_pow<typename E1::value_type, T2> >::result_type
543  >::type
544  pow (const matrix_expression<E1> &e1, const T2 &e2) {
545  typedef typename matrix_binary_scalar2_traits<E1, const T2, scalar_pow<typename E1::value_type, T2> >::expression_type expression_type;
546  return expression_type (e1 (), e2);
547  }
548 
553  template<class T1, class E2> BOOST_UBLAS_INLINE
554  typename boost::enable_if< boost::is_convertible<T1, typename E2::value_type >,
555  typename matrix_binary_scalar1_traits<const T1, E2, scalar_pow<T1, typename E2::value_type> >::result_type
556  >::type
557  pow (const T1 &e1, const matrix_expression<E2> &e2) {
558  typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_pow<T1, typename E2::value_type> >::expression_type expression_type;
559  return expression_type (e1, e2 ());
560  }
561 
566  template<class E1, class E2> BOOST_UBLAS_INLINE
567  typename matrix_binary_traits<E1, E2, scalar_pow<
568  typename E1::value_type, typename E2::value_type> >::result_type
569  pow( const matrix_expression<E1> &u, const matrix_expression<E2> &v ) {
570  typedef typename matrix_binary_traits<E1, E2,
572  >::expression_type expression_type;
573  return expression_type( u(), v() );
574  }
575 
576  //**********************************************************
577  // signal processing functions
578 
583  template<class E> BOOST_UBLAS_INLINE
584  typename matrix_unary1_traits<E,
585  scalar_signal<typename E::value_type> >::result_type
586  signal(const matrix_expression<E> &e) {
587  typedef typename matrix_unary1_traits<E,
588  scalar_signal<typename E::value_type> >::expression_type
589  expression_type;
590  return expression_type( e() );
591  }
592 
597  template<class E> BOOST_UBLAS_INLINE
598  typename matrix_unary1_traits<E,
599  scalar_asignal<typename E::value_type> >::result_type
600  asignal(const matrix_expression<E> &e) {
601  typedef typename matrix_unary1_traits<E,
602  scalar_asignal<typename E::value_type> >::expression_type
603  expression_type;
604  return expression_type( e() );
605  }
606 
607 } // end of ublas namespace
608 } // end of usml namespace
610 
611 #endif
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_cos< typename E::value_type > >::result_type cos(const matrix_expression< E > &e)
Cosine of a matrix.
Definition: matrix_math.h:328
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_max< typename E1::value_type, T2 > >::result_type >::type max(const matrix_expression< E1 > &e1, const T2 &e2)
Maximum between a matrix and a scalar.
Definition: matrix_math.h:143
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_cosh< typename E::value_type > >::result_type cosh(const matrix_expression< E > &e)
Hyperbolic cosine of a matrix.
Definition: matrix_math.h:341
Definition: scalar_math.h:188
Definition: scalar_math.h:321
math_traits< double >::value_type to_colatitude(math_traits< double >::const_reference t)
Definition: math_traits.h:761
BOOST_UBLAS_INLINE matrix_binary_traits< E1, E2, scalar_atan2< typename E1::value_type, typename E2::value_type > >::result_type atan2(const matrix_expression< E1 > &y, const matrix_expression< E2 > &x)
Inverse tangent of matrix y / matrix x.
Definition: matrix_math.h:474
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_ceil< typename E::value_type > >::result_type ceil(const matrix_expression< E > &e)
Rounding elements of a matrix up to the nearest integer.
Definition: matrix_math.h:184
Definition: scalar_math.h:254
Definition: scalar_math.h:463
Definition: scalar_math.h:276
Definition: scalar_math.h:414
Definition: scalar_math.h:351
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_asinh< typename E::value_type > >::result_type asinh(const matrix_expression< E > &e)
Inverse hyperbolic sine of a matrix.
Definition: matrix_math.h:448
math_traits< double >::value_type to_latitude(math_traits< double >::const_reference t)
Definition: math_traits.h:755
Definition: scalar_math.h:549
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_floor< typename E::value_type > >::result_type floor(const matrix_expression< E > &e)
Rounding elements of a matrix down to the nearest integer.
Definition: matrix_math.h:170
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_abs2< typename E::value_type > >::result_type abs2(const matrix_expression< E > &e)
Magnitude squared of a complex matrix.
Definition: matrix_math.h:270
Definition: scalar_math.h:567
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_min< typename E1::value_type, T2 > >::result_type >::type min(const matrix_expression< E1 > &e1, const T2 &e2)
Minimum between a matrix and a scalar.
Definition: matrix_math.h:158
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_exp< typename E::value_type > >::result_type exp(const matrix_expression< E > &e)
Exponential of a matrix.
Definition: matrix_math.h:503
Definition: scalar_math.h:496
Definition: scalar_math.h:511
Definition: scalar_math.h:205
BOOST_UBLAS_INLINE matrix_binary_traits< E1, E2, scalar_copysign< typename E1::value_type, typename E2::value_type > >::result_type copysign(const matrix_expression< E1 > &u, const matrix_expression< E2 > &v)
Copy sign of matrix elements.
Definition: matrix_math.h:311
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_tan< typename E::value_type > >::result_type tan(const matrix_expression< E > &e)
Tangent of a matrix.
Definition: matrix_math.h:380
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< E1, E2 >, typename matrix_binary_traits< E1, E2, scalar_multiplies< typename E1::value_type, typename E2::value_type > >::result_type >::type operator*(const matrix_expression< E1 > &u, const matrix_expression< E2 > &v)
Define operator*() as an alias for element_prod().
Definition: matrix_math.h:114
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_abs< typename E::value_type > >::result_type abs(const matrix_expression< E > &e)
Magnitude of a complex matrix.
Definition: matrix_math.h:257
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_minus< typename E1::value_type, T2 > >::result_type >::type operator-(const matrix_expression< E1 > &e1, const T2 &e2)
Subtract matrix (v) and scalar (t) such that (v-t)[i] = v[i] - t.
Definition: matrix_math.h:69
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_signal< typename E::value_type > >::result_type signal(const matrix_expression< E > &e)
Converts a real phase angle into a real valued signal.
Definition: matrix_math.h:586
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_sinh< typename E::value_type > >::result_type sinh(const matrix_expression< E > &e)
Hyperbolic sine of a matrix.
Definition: matrix_math.h:367
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_pow< typename E1::value_type, T2 > >::result_type >::type pow(const matrix_expression< E1 > &e1, const T2 &e2)
Raise matrix (v) to a scalar (t) power such that (v^t)[i] = v[i] ^ t.
Definition: matrix_math.h:544
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_atan< typename E::value_type > >::result_type atan(const matrix_expression< E > &e)
Inverse tangent of a matrix.
Definition: matrix_math.h:461
Definition: scalar_math.h:168
Definition: scalar_math.h:399
Definition: scalar_math.h:222
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_acos< typename E::value_type > >::result_type acos(const matrix_expression< E > &e)
Inverse cosine of a matrix.
Definition: matrix_math.h:409
Definition: scalar_math.h:369
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_asignal< typename E::value_type > >::result_type asignal(const matrix_expression< E > &e)
Converts a real phase angle into a complex analytic signal.
Definition: matrix_math.h:600
Definition: scalar_math.h:336
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T2, typename E1::value_type >, typename matrix_binary_scalar2_traits< E1, const T2, scalar_plus< typename E1::value_type, T2 > >::result_type >::type operator+(const matrix_expression< E1 > &e1, const T2 &e2)
Add matrix (v) and scalar (t) such that (v+t)[i] = v[i] + t.
Definition: matrix_math.h:43
Definition: scalar_math.h:444
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_asin< typename E::value_type > >::result_type asin(const matrix_expression< E > &e)
Inverse sine of a matrix.
Definition: matrix_math.h:435
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_tanh< typename E::value_type > >::result_type tanh(const matrix_expression< E > &e)
Hyperbolic tangent of a matrix.
Definition: matrix_math.h:393
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_arg< typename E::value_type > >::result_type arg(const matrix_expression< E > &e)
Phase of a complex matrix.
Definition: matrix_math.h:283
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_acosh< typename E::value_type > >::result_type acosh(const matrix_expression< E > &e)
Inverse hyperbolic cosine of a matrix.
Definition: matrix_math.h:422
Definition: scalar_math.h:239
Definition: scalar_math.h:150
BOOST_UBLAS_INLINE boost::enable_if< boost::is_convertible< T1, typename E2::value_type >, typename matrix_binary_scalar1_traits< const T1, E2, scalar_divides< T1, typename E2::value_type > >::result_type >::type operator/(const T1 &e1, const matrix_expression< E2 > &e2)
Divide scalar (t) and matrix (v) such that (t/v)[i] = t / v[i].
Definition: matrix_math.h:98
Definition: scalar_math.h:115
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_sin< typename E::value_type > >::result_type sin(const matrix_expression< E > &e)
Sine of a matrix.
Definition: matrix_math.h:354
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_log10< typename E::value_type > >::result_type log10(const matrix_expression< E > &e)
Base 10 logarithm of a matrix.
Definition: matrix_math.h:529
Definition: scalar_math.h:132
Definition: scalar_math.h:429
Definition: scalar_math.h:291
Definition: scalar_math.h:481
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_log< typename E::value_type > >::result_type log(const matrix_expression< E > &e)
Natural logarithm of a matrix.
Definition: matrix_math.h:516
math_traits< double >::value_type to_degrees(math_traits< double >::const_reference t)
Definition: math_traits.h:743
Definition: scalar_math.h:384
Definition: scalar_math.h:82
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_atanh< typename E::value_type > >::result_type atanh(const matrix_expression< E > &e)
Inverse hyperbolic tangent of a matrix.
Definition: matrix_math.h:487
Definition: scalar_math.h:526
Definition: scalar_math.h:306
Definition: scalar_math.h:97
math_traits< double >::value_type to_radians(math_traits< double >::const_reference t)
Definition: math_traits.h:749
BOOST_UBLAS_INLINE matrix_unary1_traits< E, scalar_sqrt< typename E::value_type > >::result_type sqrt(const matrix_expression< E > &e)
Square root of a matrix.
Definition: matrix_math.h:296