IETL library: traits.h

The header traits.h contains default implementations of traits classes used by the IETL

Synopsis

namespace ietl {

template <class T> struct number_traits {
typedef T magnitude_type;
};

template <class T> struct number_trait<std::complex<T> > {
typedef T magnitude_type;
};

template struct vectorspace_traits {
typedef typename VS::vector_type vector_type;
typedef typename VS::size_type size_type;
typedef typename VS::scalar_type scalar_type;
typedef typename number_traits<scalar_type>::magnitude_type magnitude_type;
};

}

The vectorspace_traits default implemenntation forwards all types to member types with the same name.

The number_traits traits class is used to determine the type for storing the norm of a vector.




copyright 2002-2004 by Matthias Troyer and Prakash Dayal