LTI-Lib latest version v1.9 - last update 10 Apr 2010

lti::typeInfo< T > Class Template Reference

This class allows to ask some information required in the LTI-Lib for some types. More...

#include <ltiTypeInfo.h>

Inheritance diagram for lti::typeInfo< T >:
Inheritance graph
[legend]
Collaboration diagram for lti::typeInfo< T >:
Collaboration graph
[legend]

List of all members.

Public Types

typedef T accumulation_type
typedef T square_accumulation_type

Static Public Member Functions

static T suggestedNorm () throw ()
static bool isFloatingPointType () throw ()
static const char * name () throw ()
static T min () throw ()

Detailed Description

template<class T>
class lti::typeInfo< T >

This class allows to ask some information required in the LTI-Lib for some types.

Note that the members are static, and you do not need any instance of the class to get the type information.

For more information about a type you can also use the std::numeric_limits type of the Standard Template Library.

Example:

 if (typeInfo<double>::isFloatingPointType()) {
   cout << "double is a floating point type" << endl;
 } else {
   cout << "this is a really weird case!" << endl;
 }

Member Typedef Documentation

template<class T>
typedef T lti::typeInfo< T >::accumulation_type

Type suggested for accumulation of current type elements (for example int for ubyte).

template<class T>
typedef T lti::typeInfo< T >::square_accumulation_type

Type suggested to accumulate the square of values of the current type.


Member Function Documentation

template<class T>
static bool lti::typeInfo< T >::isFloatingPointType (  )  throw () [inline, static]

return true if the type T is a floating point type.

template<class T>
static T lti::typeInfo< T >::min (  )  throw () [inline, static]

The difference of this minimum with the std::numeric_limits<T>::min() is that here the minimum value is returned for floating point types and fixed point types.

The STL method returns for floating point values the minimal representable value above zero. For max() you can use the standard version

template<class T>
static const char* lti::typeInfo< T >::name (  )  throw () [inline, static]

Return a const char* with the name of the type.

template<class T>
static T lti::typeInfo< T >::suggestedNorm (  )  throw () [inline, static]

suggest a norm for the given type.

Usually 255 is used for ubyte, 127 for byte, 65535 for all other integer types and 1.0 for the floating point types.


The documentation for this class was generated from the following file:

Generated on Sat Apr 10 15:26:44 2010 for LTI-Lib by Doxygen 1.6.1