Memosa-FVM  0.2
NumTypeTraits< int > Struct Template Reference

#include <NumType.h>

Public Types

typedef int This_T
 
typedef int T_Scalar
 
typedef int T_BuiltIn
 

Static Public Member Functions

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

Detailed Description

template<>
struct NumTypeTraits< int >

Definition at line 61 of file NumType.h.

Member Typedef Documentation

typedef int NumTypeTraits< int >::T_BuiltIn

Definition at line 65 of file NumType.h.

typedef int NumTypeTraits< int >::T_Scalar

Definition at line 64 of file NumType.h.

typedef int NumTypeTraits< int >::This_T

Definition at line 63 of file NumType.h.

Member Function Documentation

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

Definition at line 78 of file NumType.h.

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

Definition at line 77 of file NumType.h.

77 { sum += abs(v);}
static int NumTypeTraits< int >::getDataSize ( )
inlinestatic

Definition at line 71 of file NumType.h.

71 {return sizeof(int);}
static int NumTypeTraits< int >::getDimension ( )
inlinestatic

Definition at line 69 of file NumType.h.

69 {return 0;}
static int NumTypeTraits< int >::getNegativeUnity ( )
inlinestatic

Definition at line 74 of file NumType.h.

74 {return -1;}
static PrimType NumTypeTraits< int >::getPrimType ( )
inlinestatic

Definition at line 67 of file NumType.h.

References PRIM_TYPE_INT.

67 {return PRIM_TYPE_INT;}
static void NumTypeTraits< int >::getShape ( int *  shp)
inlinestatic

Definition at line 70 of file NumType.h.

70 {}
static string NumTypeTraits< int >::getTypeName ( )
inlinestatic

Definition at line 68 of file NumType.h.

68 {return "int";}
static int NumTypeTraits< int >::getUnity ( )
inlinestatic

Definition at line 73 of file NumType.h.

73 {return 1;}
static int NumTypeTraits< int >::getZero ( )
inlinestatic

Definition at line 72 of file NumType.h.

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

Definition at line 84 of file NumType.h.

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

Definition at line 81 of file NumType.h.

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

Definition at line 83 of file NumType.h.

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

Definition at line 85 of file NumType.h.

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

Definition at line 75 of file NumType.h.

References sqrt().

75 {return (int)::sqrt((double)x);}
static int sqrt(const int x)
Definition: NumType.h:75
static void NumTypeTraits< int >::write ( FILE *  fp,
const int  x 
)
inlinestatic

Definition at line 76 of file NumType.h.

76 {fprintf(fp,"%d",x);}

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