SourceForge Logo Tiny Vector Matrix library using Expression Templates Sourceforge Project Page

tvmet::NumericTraits< T > Class Template Reference

#include <tvmet/NumericTraits.h>

List of all members.


Detailed Description

template<class T>
class tvmet::NumericTraits< T >

Traits for integral types for operations.

For each type we have to specialize this traits.

Note:
Keep in mind that the long types long long and long double doesn't have traits. This is due to the sum_type. We can't give a guarantee that there is a type of holding the sum. Therefore using this traits is only safe if you have long long resp. long double types by working on long ints and doubles. Otherwise you will get not expected result for some circumstances. Anyway, you can use big integer/float libraries and specialize the traits by your own.
Todo:
The abs function of complex<non_float_type> can have an overrun due to numeric computation. Solve it (someone using value_type=long here?)


Public Types

typedef T base_type
typedef T value_type
typedef value_type sum_type
typedef value_type diff_type
typedef value_type float_type
typedef value_type signed_type
typedef NumericTraits< value_typetraits_type
typedef const value_typeargument_type

Static Public Member Functions

static base_type real (argument_type x)
static base_type imag (argument_type x)
static value_type conj (argument_type x)
static base_type abs (argument_type x)
static value_type sqrt (argument_type x)
static base_type norm_1 (argument_type x)
static base_type norm_2 (argument_type x)
static base_type norm_inf (argument_type x)
static bool equals (argument_type lhs, argument_type rhs)


Member Typedef Documentation

template<class T>
typedef T tvmet::NumericTraits< T >::base_type

template<class T>
typedef T tvmet::NumericTraits< T >::value_type

template<class T>
typedef value_type tvmet::NumericTraits< T >::sum_type

template<class T>
typedef value_type tvmet::NumericTraits< T >::diff_type

template<class T>
typedef value_type tvmet::NumericTraits< T >::float_type

template<class T>
typedef value_type tvmet::NumericTraits< T >::signed_type

template<class T>
typedef NumericTraits<value_type> tvmet::NumericTraits< T >::traits_type

template<class T>
typedef const value_type& tvmet::NumericTraits< T >::argument_type


Member Function Documentation

template<class T>
static base_type tvmet::NumericTraits< T >::real ( argument_type  x  )  [inline, static]

template<class T>
static base_type tvmet::NumericTraits< T >::imag ( argument_type  x  )  [inline, static]

template<class T>
static value_type tvmet::NumericTraits< T >::conj ( argument_type  x  )  [inline, static]

template<class T>
static base_type tvmet::NumericTraits< T >::abs ( argument_type  x  )  [inline, static]

template<class T>
static value_type tvmet::NumericTraits< T >::sqrt ( argument_type  x  )  [inline, static]

template<class T>
static base_type tvmet::NumericTraits< T >::norm_1 ( argument_type  x  )  [inline, static]

template<class T>
static base_type tvmet::NumericTraits< T >::norm_2 ( argument_type  x  )  [inline, static]

template<class T>
static base_type tvmet::NumericTraits< T >::norm_inf ( argument_type  x  )  [inline, static]

template<class T>
static bool tvmet::NumericTraits< T >::equals ( argument_type  lhs,
argument_type  rhs 
) [inline, static]


Author: