Kokkos Node API and Local Linear Algebra Kernels Version of the Day
Public Types | Static Public Member Functions | Static Public Attributes
TSQR::ScalarTraits< Scalar > Class Template Reference

Map from Scalar type to its arithmetic properties. More...

#include <Tsqr_ScalarTraits.hpp>

List of all members.

Public Types

typedef Scalar magnitude_type

Static Public Member Functions

static Scalar zero ()
static Scalar one ()
static magnitude_type pi ()
static Scalar conj (const Scalar &z)
 Complex conjugate of z, in case is_complex == true, else just z.
static magnitude_type abs (const Scalar &z)
 Absolute value of z.

Static Public Attributes

static const bool is_specialized = false
 Was this traits class specialized for Scalar?
static const bool is_complex = false
 Whether Scalar represents a complex number.

Detailed Description

template<class Scalar>
class TSQR::ScalarTraits< Scalar >

Map from Scalar type to its arithmetic properties.

ScalarTraits dispatches from a Scalar data type, to its arithmetic properties. These include the type of its absolute value / magnitude, zero, one, $\pi$, and functions for computing its absolute value resp. conjugate.

Note:
Models for Scalar: float, double, std::complex<float>, std::complex<double> (which correspond to the four data types S,D,C,Z supported by the BLAS and LAPACK). If ScalarTraits< Scalar >::is_complex, then Scalar should have at least two different constructors: a default constructor, and a constructor of the form "Scalar (const magnitude_type&, const magnitude_type& = magnitude_type(0))". Otherwise, Scalar should have a default constructor, and a "Scalar (const magnitude_type&)" constructor. magnitude_type should follow the latter model.

Definition at line 60 of file Tsqr_ScalarTraits.hpp.


Member Typedef Documentation

template<class Scalar>
typedef Scalar TSQR::ScalarTraits< Scalar >::magnitude_type

If Scalar is complex, this is the type of its magnitude, and the type of its real and complex parts. (That means, if the real and complex parts can be negative, magnitude_type is allowed to be negative as well, even though magnitudes themselves (as returned by abs(), see below) are nonnegative.)

Definition at line 76 of file Tsqr_ScalarTraits.hpp.


Member Function Documentation

template<class Scalar>
static Scalar TSQR::ScalarTraits< Scalar >::zero ( ) [static]

The arithmetic identity for the given Scalar data type.

template<class Scalar>
static Scalar TSQR::ScalarTraits< Scalar >::one ( ) [static]

The multiplicative identity for the given Scalar data type.

template<class Scalar>
static magnitude_type TSQR::ScalarTraits< Scalar >::pi ( ) [static]

The value of $\pi$ (ratio of a circle's circumference to its diameter) for magnitude_type.

template<class Scalar>
static Scalar TSQR::ScalarTraits< Scalar >::conj ( const Scalar &  z) [inline, static]

Complex conjugate of z, in case is_complex == true, else just z.

template<class Scalar>
static magnitude_type TSQR::ScalarTraits< Scalar >::abs ( const Scalar &  z) [inline, static]

Absolute value of z.


Member Data Documentation

template<class Scalar>
const bool TSQR::ScalarTraits< Scalar >::is_specialized = false [static]

Was this traits class specialized for Scalar?

Whether we've specialized this traits class for the particular Scalar type. If you're writing your own specialization, you should set this to true.

Definition at line 67 of file Tsqr_ScalarTraits.hpp.

template<class Scalar>
const bool TSQR::ScalarTraits< Scalar >::is_complex = false [static]

Whether Scalar represents a complex number.

Definition at line 70 of file Tsqr_ScalarTraits.hpp.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends