USML
math_traits.h
1 
5 #ifndef USML_UBLAS_MATH_TRAITS_HH
6 #define USML_UBLAS_MATH_TRAITS_HH
7 
8 #include<cmath>
9 #include<complex>
10 #include<boost/numeric/ublas/vector.hpp>
11 #include<boost/numeric/ublas/matrix.hpp>
12 #include<boost/numeric/ublas/io.hpp>
13 #include <usml/usml_config.h>
14 
15 # define TWO_PI (2.0*M_PI)
16 
17 namespace usml {
18 namespace ublas {
19 
20 using std::cout;
21 using std::operator<<;
22 using std::endl;
23 
24 using std::complex;
25 using std::size_t;
26 
27 using std::max;
28 using std::min;
29 using std::floor;
30 using std::ceil;
31 
32 using std::abs;
33 using std::arg;
34 using std::sqrt;
35 
36 using std::cos;
37 using std::cosh;
38 using std::sin;
39 using std::sinh;
40 using std::tan;
41 using std::tanh;
42 
43 using std::acos;
44 using std::asin;
45 using std::atan;
46 using std::atan2;
47 
48 using std::exp;
49 using std::log;
50 using std::log10;
51 using std::pow;
52 
53 using namespace boost::numeric::ublas;
54 
55 const complex<double> DOUBLE_I = complex<double> (0.0, 1.0);
56 const complex<float> FLOAT_I = complex<float> (0.0, 1.0);
57 
76 template<class T> struct math_traits
77 {
79  typedef T value_type;
80  typedef const T & const_reference;
81  typedef T & reference;
82  typedef T real_type;
83 
84  //*********************************************************
85  // conversion functions
86 
87  static inline value_type to_degrees(const_reference t);
88  static inline value_type to_radians(const_reference t);
89  static inline value_type to_latitude(const_reference t);
90  static inline value_type to_colatitude(const_reference t);
91 
92  //*********************************************************
93  // algebraic functions
94 
95  static inline value_type sqrt(const_reference t);
96 
97  //*********************************************************
98  // trigonometric functions
99 
100  static inline value_type cos(const_reference t);
101  static inline value_type cosh(const_reference t);
102  static inline value_type sin(const_reference t);
103  static inline value_type sinh(const_reference t);
104  static inline value_type tan(const_reference t);
105  static inline value_type tanh(const_reference t);
106 
107  //*********************************************************
108  // inverse trigonometric functions
109 
110  static inline value_type acos(const_reference t);
111  static inline value_type acosh(const_reference t);
112  static inline value_type asin(const_reference t);
113  static inline value_type asinh(const_reference t);
114  static inline value_type atan(const_reference t);
115  static inline value_type atan2(const_reference y, const_reference x);
116  static inline value_type atanh(const_reference t);
117 
118  //*********************************************************
119  // exponential functions
120 
121  static inline value_type exp(const_reference t);
122  static inline value_type log(const_reference t);
123  static inline value_type log10(const_reference t);
124  static inline value_type pow(const_reference t, int e);
125  static inline value_type pow(const_reference t, const_reference e);
126 };
127 
133 template<> struct math_traits<double>
134 {
136  typedef double value_type;
137  typedef const double & const_reference;
138  typedef double & reference;
139  typedef double real_type;
140 
141  //*********************************************************
142  // limiting functions
143 
145  {
146  return std::max(t1, t2);
147  }
149  {
150  return std::min(t1, t2);
151  }
153  {
154  return std::floor(t);
155  }
156  static inline value_type ceil(const_reference t)
157  {
158  return std::ceil(t);
159  }
160 
161  //*********************************************************
162  // conversion functions
163 
165  {
166  return t * (180.0 / M_PI);
167  }
168 
170  {
171  return t * (M_PI / 180.0);
172  }
173 
175  {
176  return 90.0 - to_degrees(t);
177  }
178 
180  {
181  return to_radians(90.0 - t);
182  }
183 
184  //*********************************************************
185  // algebraic functions
186 
187  static inline value_type sqrt(const_reference t)
188  {
189  return std::sqrt(t);
190  }
192  {
193  return ( t2 < 0.0 ) ? -t1 : t1 ;
194  }
195 
196  //*********************************************************
197  // trigonometric functions
198 
199  static inline value_type cos(const_reference t)
200  {
201  return std::cos(t);
202  }
203  static inline value_type cosh(const_reference t)
204  {
205  return std::cosh(t);
206  }
207  static inline value_type sin(const_reference t)
208  {
209  return std::sin(t);
210  }
211  static inline value_type sinh(const_reference t)
212  {
213  return std::sinh(t);
214  }
215  static inline value_type tan(const_reference t)
216  {
217  return std::tan(t);
218  }
219  static inline value_type tanh(const_reference t)
220  {
221  return std::tanh(t);
222  }
223 
224  //*********************************************************
225  // inverse trigonometric functions
226  // @xref A. Jeffery, Handbook of Math Formulas
227  // and Integrals, pp. 124-127.
228 
229  static inline value_type acos(const_reference t)
230  {
231  return std::acos(t);
232  }
234  {
235  return log(t + sqrt(t * t - 1.0));
236  }
237  static inline value_type asin(const_reference t)
238  {
239  return std::asin(t);
240  }
242  {
243  return log(t + sqrt(t * t + 1.0));
244  }
245  static inline value_type atan(const_reference t)
246  {
247  return std::atan(t);
248  }
250  {
251  return std::atan2(y, x);
252  }
254  {
255  return 0.5 * log((1.0 + t) / (1.0 - t));
256  }
257 
258  //*********************************************************
259  // exponential functions
260 
261  static inline value_type exp(const_reference t)
262  {
263  return std::exp(t);
264  }
265  static inline value_type log(const_reference t)
266  {
267  return std::log(t);
268  }
270  {
271  return std::log10(t);
272  }
273  static inline value_type pow(const_reference t, int e)
274  {
275  return std::pow(t, e);
276  }
278  {
279  return std::pow(t, e);
280  }
281 
282  //*********************************************************
283  // functions specific to double return values.
284 
285  static inline real_type abs(const_reference t)
286  {
287  return std::abs(t);
288  }
289  static inline real_type arg(const_reference t)
290  {
291  return 0.0;
292  }
293  static inline real_type abs2(const_reference t)
294  {
295  return t * t;
296  }
297 
298  static inline real_type abs(const complex<value_type> &t)
299  {
300  return std::abs(t);
301  }
302  static inline real_type arg(const complex<value_type> &t)
303  {
304  return std::arg(t);
305  }
306  static inline real_type abs2(const complex<value_type> &t)
307  {
308  return t.real() * t.real() + t.imag() * t.imag();
309  }
310 };
311 
317 template<> struct math_traits<float>
318 {
320  typedef float value_type;
321  typedef const float & const_reference;
322  typedef float & reference;
323  typedef float real_type;
324 
325  //*********************************************************
326  // limiting functions
327 
329  {
330  return std::max(t1, t2);
331  }
333  {
334  return std::min(t1, t2);
335  }
337  {
338  return std::floor(t);
339  }
340  static inline value_type ceil(const_reference t)
341  {
342  return std::ceil(t);
343  }
344 
345  //*********************************************************
346  // conversion functions
347 
349  {
350  return t * (180.0 / M_PI);
351  }
352 
354  {
355  return t * (M_PI / 180.0);
356  }
357 
359  {
360  return 90.0 - to_degrees(t);
361  }
362 
364  {
365  return to_radians(90.0 - t);
366  }
367 
368  //*********************************************************
369  // algebraic functions
370 
371  static inline value_type sqrt(const_reference t)
372  {
373  return std::sqrt(t);
374  }
376  {
377  return ( t2 < 0.0 ) ? -t1 : t1 ;
378  }
379 
380  //*********************************************************
381  // trigonometric functions
382 
383  static inline value_type cos(const_reference t)
384  {
385  return std::cos(t);
386  }
387  static inline value_type cosh(const_reference t)
388  {
389  return std::cosh(t);
390  }
391  static inline value_type sin(const_reference t)
392  {
393  return std::sin(t);
394  }
395  static inline value_type sinh(const_reference t)
396  {
397  return std::sinh(t);
398  }
399  static inline value_type tan(const_reference t)
400  {
401  return std::tan(t);
402  }
403  static inline value_type tanh(const_reference t)
404  {
405  return std::tanh(t);
406  }
407 
408  //*********************************************************
409  // inverse trigonometric functions
410  // @xref A. Jeffery, Handbook of Math Formulas
411  // and Integrals, pp. 124-127.
412 
413  static inline value_type acos(const_reference t)
414  {
415  return std::acos(t);
416  }
418  {
419  return log(t + sqrt(t * t - 1.0f));
420  }
421  static inline value_type asin(const_reference t)
422  {
423  return std::asin(t);
424  }
426  {
427  return log(t + sqrt(t * t + 1.0f));
428  }
429  static inline value_type atan(const_reference t)
430  {
431  return std::atan(t);
432  }
434  {
435  return std::atan2(y, x);
436  }
438  {
439  return 0.5 * log((1.0f + t) / (1.0f - t));
440  }
441 
442  //*********************************************************
443  // exponential functions
444 
445  static inline value_type exp(const_reference t)
446  {
447  return std::exp(t);
448  }
449  static inline value_type log(const_reference t)
450  {
451  return std::log(t);
452  }
454  {
455  return std::log10(t);
456  }
457  static inline value_type pow(const_reference t, int e)
458  {
459  return std::pow(t, e);
460  }
462  {
463  return std::pow(t, e);
464  }
465 
466  //*********************************************************
467  // functions specific to float return values.
468 
469  static inline real_type abs(const_reference t)
470  {
471  return std::abs(t);
472  }
473  static inline real_type arg(const_reference t)
474  {
475  return 0.0;
476  }
477  static inline real_type abs2(const_reference t)
478  {
479  return t * t;
480  }
481 
482  static inline real_type abs(const complex<value_type> &t)
483  {
484  return std::abs(t);
485  }
486  static inline real_type arg(const complex<value_type> &t)
487  {
488  return std::arg(t);
489  }
490  static inline real_type abs2(const complex<value_type> &t)
491  {
492  return t.real() * t.real() + t.imag() * t.imag();
493  }
494 };
495 
502 template<> struct math_traits<complex<double> >
503 {
505  typedef complex<double> value_type;
506  typedef const complex<double> & const_reference;
507  typedef complex<double> & reference;
508  typedef double real_type;
509 
510  //*********************************************************
511  // complex functions
512 
513  static inline value_type sqrt(const_reference t)
514  {
515  return std::sqrt(t);
516  }
517  //*********************************************************
518  // trigonometric functions
519 
520  static inline value_type cos(const_reference t)
521  {
522  return std::cos(t);
523  }
524  static inline value_type cosh(const_reference t)
525  {
526  return std::cosh(t);
527  }
528  static inline value_type sin(const_reference t)
529  {
530  return std::sin(t);
531  }
532  static inline value_type sinh(const_reference t)
533  {
534  return std::sinh(t);
535  }
536  static inline value_type tan(const_reference t)
537  {
538  return std::tan(t);
539  }
540  static inline value_type tanh(const_reference t)
541  {
542  return std::tanh(t);
543  }
544 
545  //*********************************************************
546  // inverse trigonometric functions
547  // @xref A. Jeffery, Handbook of Math Formulas
548  // and Integrals, pp. 124-127.
549 
550  static inline value_type acos(const_reference t)
551  {
552  return DOUBLE_I * log(t + sqrt(t * t - 1.0));
553  }
555  {
556  return log(t + sqrt(t * t - 1.0));
557  }
558  static inline value_type asin(const_reference t)
559  {
560  return -DOUBLE_I * log(DOUBLE_I * t + sqrt(1.0 - t * t));
561  }
563  {
564  return log(t + sqrt(t * t + 1.0));
565  }
566  static inline value_type atan(const_reference t)
567  {
568  return log((1.0 + DOUBLE_I * t) / (1.0 - DOUBLE_I * t)) / (2.0
569  * DOUBLE_I);
570  }
572  {
573  return atan(y / x);
574  }
576  {
577  return 0.5 * log((1.0 + t) / (1.0 - t));
578  }
579 
580  //*********************************************************
581  // exponential functions
582 
583  static inline value_type exp(const_reference t)
584  {
585  return std::exp(t);
586  }
587  static inline value_type log(const_reference t)
588  {
589  return std::log(t);
590  }
592  {
593  return std::log10(t);
594  }
595  static inline value_type pow(const_reference t, int e)
596  {
597  return std::pow(t, e);
598  }
600  {
601  return std::pow(t, e);
602  }
603 
604  //*********************************************************
605  // functions specific to complex<double> return values.
606 
608  {
609  return std::pow(t, e);
610  }
612  {
613  return std::pow(t, e);
614  }
615 
616 };
617 
624 template<> struct math_traits<complex<float> >
625 {
627  typedef complex<float> value_type;
628  typedef const complex<float> & const_reference;
629  typedef complex<float> & reference;
630  typedef float real_type;
631 
632  //*********************************************************
633  // complex functions
634 
635  static inline value_type sqrt(const_reference t)
636  {
637  return std::sqrt(t);
638  }
639  //*********************************************************
640  // trigonometric functions
641 
642  static inline value_type cos(const_reference t)
643  {
644  return std::cos(t);
645  }
646  static inline value_type cosh(const_reference t)
647  {
648  return std::cosh(t);
649  }
650  static inline value_type sin(const_reference t)
651  {
652  return std::sin(t);
653  }
654  static inline value_type sinh(const_reference t)
655  {
656  return std::sinh(t);
657  }
658  static inline value_type tan(const_reference t)
659  {
660  return std::tan(t);
661  }
662  static inline value_type tanh(const_reference t)
663  {
664  return std::tanh(t);
665  }
666 
667  //*********************************************************
668  // inverse trigonometric functions
669  // @xref A. Jeffery, Handbook of Math Formulas
670  // and Integrals, pp. 124-127.
671 
672  static inline value_type acos(const_reference t)
673  {
674  return FLOAT_I * log(t + sqrt(t * t - 1.0f));
675  }
677  {
678  return log(t + sqrt(t * t - 1.0f));
679  }
680  static inline value_type asin(const_reference t)
681  {
682  return -FLOAT_I * log(FLOAT_I * t + sqrt(1.0f - t * t));
683  }
685  {
686  return log(t + sqrt(t * t + 1.0f));
687  }
688  static inline value_type atan(const_reference t)
689  {
690  return log((1.0f + FLOAT_I * t) / (1.0f - FLOAT_I * t)) / (2.0f
691  * FLOAT_I);
692  }
694  {
695  return atan(y / x);
696  }
698  {
699  return 0.5f * log((1.0f + t) / (1.0f - t));
700  }
701 
702  //*********************************************************
703  // exponential functions
704 
705  static inline value_type exp(const_reference t)
706  {
707  return std::exp(t);
708  }
709  static inline value_type log(const_reference t)
710  {
711  return std::log(t);
712  }
714  {
715  return std::log10(t);
716  }
717  static inline value_type pow(const_reference t, int e)
718  {
719  return std::pow(t, e);
720  }
722  {
723  return std::pow(t, e);
724  }
725 
726  //*********************************************************
727  // functions specific to complex<float> return values.
728 
730  {
731  return std::pow(t, e);
732  }
734  {
735  return std::pow(t, e);
736  }
737 
738 };
739 
740 //*********************************************************
741 // conversion functions specializations for double
742 
745 {
747 }
748 
751 {
753 }
754 
757 {
759 }
760 
763 {
765 }
766 
767 //*********************************************************
768 // add GNU C++ math functions to Visual C++
769 
770 #ifdef _MSC_VER // Microsoft Visual C++
771  #ifndef NAN
772  #define NAN std::numeric_limits<double>::quiet_NaN()
773  #endif
774  inline int isnan(double x) { return _isnan(x); }
775  inline int round(double x) { return floor(x + 0.5); }
776 
779  {
780  return math_traits<double>::acosh(t);
781  }
784  {
785  return math_traits<double>::asinh(t);
786  }
789  {
790  return math_traits<double>::atanh(t);
791  }
792 
793 #endif
794 
795 
796 } // end of ublas namespace
797 } // end of usml namespace
798 
799 #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 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
static value_type pow(const_reference t, int e)
Definition: math_traits.h:595
static value_type asin(const_reference t)
Definition: math_traits.h:558
math_traits< double >::value_type to_colatitude(math_traits< double >::const_reference t)
Definition: math_traits.h:761
static value_type exp(const_reference t)
Definition: math_traits.h:705
complex< double > & reference
Definition: math_traits.h:507
const complex< float > FLOAT_I
Definition: math_traits.h:56
static value_type atan2(const_reference y, const_reference x)
Definition: math_traits.h:693
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
const complex< double > DOUBLE_I
Definition: math_traits.h:55
static value_type atanh(const_reference t)
Definition: math_traits.h:437
static value_type log10(const_reference t)
Definition: math_traits.h:713
static value_type atan2(const_reference y, const_reference x)
Definition: math_traits.h:571
static value_type sqrt(const_reference t)
Definition: math_traits.h:513
static real_type abs2(const complex< value_type > &t)
Definition: math_traits.h:490
float value_type
Definition: math_traits.h:320
Definition: math_traits.h:76
static value_type cos(const_reference t)
Definition: math_traits.h:383
static value_type asinh(const_reference t)
Definition: math_traits.h:425
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
static real_type abs(const_reference t)
Definition: math_traits.h:285
static value_type atan2(const_reference y, const_reference x)
Definition: math_traits.h:249
static value_type to_degrees(const_reference t)
Definition: math_traits.h:348
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
static value_type min(const_reference t1, const_reference t2)
Definition: math_traits.h:148
T & reference
Definition: math_traits.h:81
static value_type log(const_reference t)
Definition: math_traits.h:709
static value_type tan(const_reference t)
Definition: math_traits.h:399
static value_type asinh(const_reference t)
Definition: math_traits.h:684
static value_type asinh(const_reference t)
Definition: math_traits.h:241
static value_type exp(const_reference t)
Definition: math_traits.h:445
static value_type to_latitude(const_reference t)
Definition: math_traits.h:174
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
static value_type asin(const_reference t)
Definition: math_traits.h:680
static value_type asin(const_reference t)
Definition: math_traits.h:421
static value_type acos(const_reference t)
Definition: math_traits.h:413
math_traits< double > self_type
Definition: math_traits.h:135
static real_type arg(const complex< value_type > &t)
Definition: math_traits.h:486
static value_type tanh(const_reference t)
Definition: math_traits.h:219
static value_type log(const_reference t)
Definition: math_traits.h:587
static real_type abs(const complex< value_type > &t)
Definition: math_traits.h:482
static value_type pow(const_reference t, const_reference e)
Definition: math_traits.h:599
static value_type log(const_reference t)
Definition: math_traits.h:449
static real_type arg(const_reference t)
Definition: math_traits.h:289
static value_type cosh(const_reference t)
Definition: math_traits.h:203
static value_type cos(const_reference t)
Definition: math_traits.h:199
static value_type to_radians(const_reference t)
Definition: math_traits.h:353
static value_type to_colatitude(const_reference t)
Definition: math_traits.h:179
static value_type to_degrees(const_reference t)
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
math_traits< float > self_type
Definition: math_traits.h:319
T value_type
Definition: math_traits.h:79
static value_type atan(const_reference t)
Definition: math_traits.h:429
static value_type copysign(const_reference t1, const_reference t2)
Definition: math_traits.h:375
static value_type ceil(const_reference t)
Definition: math_traits.h:340
static value_type pow(const_reference t, int e)
Definition: math_traits.h:273
static value_type sin(const_reference t)
Definition: math_traits.h:207
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
double real_type
Definition: math_traits.h:508
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
static value_type log10(const_reference t)
Definition: math_traits.h:453
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
static value_type to_latitude(const_reference t)
Definition: math_traits.h:358
complex< double > value_type
Definition: math_traits.h:505
math_traits< complex< float > > self_type
Definition: math_traits.h:626
const complex< double > & const_reference
Definition: math_traits.h:506
static value_type atan2(const_reference y, const_reference x)
Definition: math_traits.h:433
static real_type arg(const complex< value_type > &t)
Definition: math_traits.h:302
static value_type pow(const_reference t, int e)
Definition: math_traits.h:717
static value_type tanh(const_reference t)
Definition: math_traits.h:540
static value_type acosh(const_reference t)
Definition: math_traits.h:554
static real_type arg(const_reference t)
Definition: math_traits.h:473
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: math_traits.h:133
const double & const_reference
Definition: math_traits.h:137
static value_type sinh(const_reference t)
Definition: math_traits.h:211
math_traits< T > self_type
Definition: math_traits.h:78
static value_type tanh(const_reference t)
Definition: math_traits.h:662
static value_type atanh(const_reference t)
Definition: math_traits.h:697
static value_type sinh(const_reference t)
Definition: math_traits.h:654
float real_type
Definition: math_traits.h:323
static value_type to_degrees(const_reference t)
Definition: math_traits.h:164
double & reference
Definition: math_traits.h:138
static value_type floor(const_reference t)
Definition: math_traits.h:152
static value_type max(const_reference t1, const_reference t2)
Definition: math_traits.h:328
static value_type asinh(const_reference t)
Definition: math_traits.h:562
const float & const_reference
Definition: math_traits.h:321
static real_type abs2(const_reference t)
Definition: math_traits.h:477
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
static real_type abs2(const complex< value_type > &t)
Definition: math_traits.h:306
static value_type acosh(const_reference t)
Definition: math_traits.h:676
T real_type
Definition: math_traits.h:82
static value_type cos(const_reference t)
Definition: math_traits.h:642
static value_type exp(const_reference t)
Definition: math_traits.h:583
static value_type sin(const_reference t)
Definition: math_traits.h:650
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
static value_type asin(const_reference t)
Definition: math_traits.h:237
static real_type abs(const_reference t)
Definition: math_traits.h:469
static value_type sqrt(const_reference t)
Definition: math_traits.h:371
static value_type pow(real_type t, const_reference e)
Definition: math_traits.h:733
static value_type sin(const_reference t)
Definition: math_traits.h:391
static value_type pow(const_reference t, real_type e)
Definition: math_traits.h:729
math_traits< complex< double > > self_type
Definition: math_traits.h:504
float & reference
Definition: math_traits.h:322
complex< float > & reference
Definition: math_traits.h:629
static value_type tanh(const_reference t)
Definition: math_traits.h:403
static value_type ceil(const_reference t)
Definition: math_traits.h:156
static value_type max(const_reference t1, const_reference t2)
Definition: math_traits.h:144
static value_type to_radians(const_reference t)
Definition: math_traits.h:169
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
static value_type asinh(const_reference t)
static value_type to_latitude(const_reference t)
static value_type pow(const_reference t, const_reference e)
Definition: math_traits.h:461
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
static value_type pow(const_reference t, real_type e)
Definition: math_traits.h:607
static value_type atanh(const_reference t)
Definition: math_traits.h:575
static value_type tan(const_reference t)
Definition: math_traits.h:215
static real_type abs(const complex< value_type > &t)
Definition: math_traits.h:298
static value_type log10(const_reference t)
Definition: math_traits.h:269
double real_type
Definition: math_traits.h:139
static value_type to_colatitude(const_reference t)
Definition: math_traits.h:363
static value_type cosh(const_reference t)
Definition: math_traits.h:524
static value_type atan(const_reference t)
Definition: math_traits.h:566
static value_type exp(const_reference t)
Definition: math_traits.h:261
const T & const_reference
Definition: math_traits.h:80
static value_type to_radians(const_reference t)
static value_type pow(const_reference t, int e)
Definition: math_traits.h:457
static value_type tan(const_reference t)
Definition: math_traits.h:658
static value_type copysign(const_reference t1, const_reference t2)
Definition: math_traits.h:191
float real_type
Definition: math_traits.h:630
static value_type cos(const_reference t)
Definition: math_traits.h:520
static real_type abs2(const_reference t)
Definition: math_traits.h:293
static value_type tan(const_reference t)
Definition: math_traits.h:536
double value_type
Definition: math_traits.h:136
static value_type atan(const_reference t)
Definition: math_traits.h:245
static value_type acos(const_reference t)
Definition: math_traits.h:229
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
static value_type acosh(const_reference t)
Definition: math_traits.h:233
static value_type sinh(const_reference t)
Definition: math_traits.h:395
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
static value_type pow(real_type t, const_reference e)
Definition: math_traits.h:611
static value_type acosh(const_reference t)
Definition: math_traits.h:417
static value_type to_colatitude(const_reference t)
static value_type log(const_reference t)
Definition: math_traits.h:265
const complex< float > & const_reference
Definition: math_traits.h:628
static value_type pow(const_reference t, const_reference e)
Definition: math_traits.h:277
static value_type acos(const_reference t)
Definition: math_traits.h:550
static value_type atanh(const_reference t)
complex< float > value_type
Definition: math_traits.h:627
static value_type atan(const_reference t)
Definition: math_traits.h:688
static value_type cosh(const_reference t)
Definition: math_traits.h:646
static value_type cosh(const_reference t)
Definition: math_traits.h:387
static value_type log10(const_reference t)
Definition: math_traits.h:591
Definition: math_traits.h:317
static value_type min(const_reference t1, const_reference t2)
Definition: math_traits.h:332
static value_type atanh(const_reference t)
Definition: math_traits.h:253
static value_type sqrt(const_reference t)
Definition: math_traits.h:187
static value_type pow(const_reference t, const_reference e)
Definition: math_traits.h:721
math_traits< double >::value_type to_radians(math_traits< double >::const_reference t)
Definition: math_traits.h:749
static value_type acosh(const_reference t)
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
static value_type sin(const_reference t)
Definition: math_traits.h:528
static value_type sqrt(const_reference t)
Definition: math_traits.h:635
static value_type floor(const_reference t)
Definition: math_traits.h:336
static value_type acos(const_reference t)
Definition: math_traits.h:672
static value_type sinh(const_reference t)
Definition: math_traits.h:532