Memosa-FVM  0.2
NumTypeTraits< float > Struct Template Reference

#include <NumType.h>

Public Types

typedef float T_Scalar
 
typedef float This_T
 
typedef float T_BuiltIn
 

Static Public Member Functions

static PrimType getPrimType ()
 
static string getTypeName ()
 
static int getDimension ()
 
static void getShape (int *shp)
 
static int getDataSize ()
 
static float getZero ()
 
static float getUnity ()
 
static float getNegativeUnity ()
 
static float sqrt (const float x)
 
static void write (FILE *fp, const float x)
 
static double doubleMeasure (const float x)
 
static void accumulateOneNorm (float &sum, const float &v)
 
static void accumulateDotProduct (float &sum, const float &v0, const float &v1)
 
static void reduceSum (T_Scalar &sum, const This_T &x)
 
static void safeDivide (float &x, const float &y)
 
static void normalize (float &x, const float &y)
 
static void setMax (float &x, const float &y)
 

Detailed Description

template<>
struct NumTypeTraits< float >

Definition at line 120 of file NumType.h.

Member Typedef Documentation

typedef float NumTypeTraits< float >::T_BuiltIn

Definition at line 124 of file NumType.h.

typedef float NumTypeTraits< float >::T_Scalar

Definition at line 122 of file NumType.h.

typedef float NumTypeTraits< float >::This_T

Definition at line 123 of file NumType.h.

Member Function Documentation

static void NumTypeTraits< float >::accumulateDotProduct ( float &  sum,
const float &  v0,
const float &  v1 
)
inlinestatic

Definition at line 139 of file NumType.h.

140  { sum += v0*v1;}
static void NumTypeTraits< float >::accumulateOneNorm ( float &  sum,
const float &  v 
)
inlinestatic

Definition at line 138 of file NumType.h.

References fabs().

138 { sum += fabs(v);}
Tangent fabs(const Tangent &a)
Definition: Tangent.h:312
static double NumTypeTraits< float >::doubleMeasure ( const float  x)
inlinestatic

Definition at line 137 of file NumType.h.

References fabs().

137 {return fabs(double(x));}
Tangent fabs(const Tangent &a)
Definition: Tangent.h:312
static int NumTypeTraits< float >::getDataSize ( )
inlinestatic

Definition at line 131 of file NumType.h.

131 {return sizeof(double);}
static int NumTypeTraits< float >::getDimension ( )
inlinestatic

Definition at line 129 of file NumType.h.

129 {return 0;}
static float NumTypeTraits< float >::getNegativeUnity ( )
inlinestatic

Definition at line 134 of file NumType.h.

134 {return -1.;}
static PrimType NumTypeTraits< float >::getPrimType ( )
inlinestatic

Definition at line 126 of file NumType.h.

References PRIM_TYPE_FLOAT.

126 {return PRIM_TYPE_FLOAT;}
static void NumTypeTraits< float >::getShape ( int *  shp)
inlinestatic

Definition at line 130 of file NumType.h.

130 {}
static string NumTypeTraits< float >::getTypeName ( )
inlinestatic

Definition at line 128 of file NumType.h.

128 {return "float";}
static float NumTypeTraits< float >::getUnity ( )
inlinestatic

Definition at line 133 of file NumType.h.

133 {return 1.;}
static float NumTypeTraits< float >::getZero ( )
inlinestatic

Definition at line 132 of file NumType.h.

132 {return 0;}
static void NumTypeTraits< float >::normalize ( float &  x,
const float &  y 
)
inlinestatic

Definition at line 143 of file NumType.h.

143 {if (y!=0) x/=y;}
static void NumTypeTraits< float >::reduceSum ( T_Scalar sum,
const This_T x 
)
inlinestatic

Definition at line 141 of file NumType.h.

141 {sum+=x;}
static void NumTypeTraits< float >::safeDivide ( float &  x,
const float &  y 
)
inlinestatic

Definition at line 142 of file NumType.h.

142 {if (y!=0) x/=y;}
static void NumTypeTraits< float >::setMax ( float &  x,
const float &  y 
)
inlinestatic

Definition at line 144 of file NumType.h.

144 {if (y>x) x=y;}
static float NumTypeTraits< float >::sqrt ( const float  x)
inlinestatic

Definition at line 135 of file NumType.h.

References sqrt().

135 {return ::sqrt(x);}
Tangent sqrt(const Tangent &a)
Definition: Tangent.h:317
static void NumTypeTraits< float >::write ( FILE *  fp,
const float  x 
)
inlinestatic

Definition at line 136 of file NumType.h.

136 {fprintf(fp,"%f",x);}

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