Memosa-FVM  0.2
VectorTranspose< T, N > Class Template Reference

#include <VectorTranspose.h>

Inheritance diagram for VectorTranspose< T, N >:

Public Types

enum  { Length = N }
 
typedef VectorTranspose< T, N > This_T
 
typedef NumTypeTraits< T >
::T_Scalar 
T_Scalar
 
typedef NumTypeTraits< T >
::T_BuiltIn 
T_BuiltIn
 
typedef T T_NumType
 

Public Member Functions

 VectorTranspose ()
 
 VectorTranspose (const VectorTranspose &x)
 
 VectorTranspose (const Vector< T, N > &v)
 
T & operator[] (int n)
 
const T & operator[] (int n) const
 
VectorTransposeoperator= (const T &o)
 
VectorTransposeoperator= (const int o)
 
VectorTransposeoperator= (const VectorTranspose &o)
 
VectorTranspose operator- ()
 
VectorTransposeoperator+= (const VectorTranspose &o)
 
VectorTransposeoperator-= (const VectorTranspose &o)
 
VectorTransposeoperator/= (const T s)
 
VectorTransposeoperator/= (const VectorTranspose &o)
 
VectorTransposeoperator*= (const T s)
 
operator*= (const Vector< T, N > &o)
 
VectorTransposeoperator*= (const VectorTranspose &o)
 
SquareTensor< T, N > getTensor (const Vector< T, N > &o)
 
void zero ()
 
bool operator< (const double tolerance) const
 
void printFromC (ostream &os) const
 

Static Public Member Functions

static string getTypeName ()
 
static int getDimension ()
 
static void getShape (int *shp)
 
static int getDataSize ()
 
static VectorTranspose getZero ()
 
static void accumulateOneNorm (VectorTranspose &sum, const VectorTranspose &v)
 
static void accumulateDotProduct (VectorTranspose &sum, const VectorTranspose &v0, const VectorTranspose &v1)
 
static void safeDivide (VectorTranspose &x, const VectorTranspose &y)
 
static void normalize (VectorTranspose &x, const VectorTranspose &y)
 
static void setMax (VectorTranspose &x, const VectorTranspose &y)
 
static void reduceSum (T_Scalar &sum, const This_T &x)
 

Static Public Attributes

static int NumPy_TypeNum = -1
 

Private Attributes

Vector< T, N > _v
 

Detailed Description

template<class T, int N>
class VectorTranspose< T, N >

Definition at line 14 of file VectorTranspose.h.

Member Typedef Documentation

template<class T, int N>
typedef NumTypeTraits<T>::T_BuiltIn VectorTranspose< T, N >::T_BuiltIn

Definition at line 19 of file VectorTranspose.h.

template<class T, int N>
typedef T VectorTranspose< T, N >::T_NumType

Definition at line 20 of file VectorTranspose.h.

template<class T, int N>
typedef NumTypeTraits<T>::T_Scalar VectorTranspose< T, N >::T_Scalar

Definition at line 18 of file VectorTranspose.h.

template<class T, int N>
typedef VectorTranspose<T,N> VectorTranspose< T, N >::This_T

Definition at line 17 of file VectorTranspose.h.

Member Enumeration Documentation

template<class T, int N>
anonymous enum
Enumerator
Length 

Definition at line 21 of file VectorTranspose.h.

Constructor & Destructor Documentation

template<class T, int N>
VectorTranspose< T, N >::VectorTranspose ( )
inline

Definition at line 25 of file VectorTranspose.h.

Referenced by VectorTranspose< X, K >::operator-().

26  {}
template<class T, int N>
VectorTranspose< T, N >::VectorTranspose ( const VectorTranspose< T, N > &  x)
inline

Definition at line 28 of file VectorTranspose.h.

28  :
29  _v(x._v)
30  {}
Vector< T, N > _v
template<class T, int N>
VectorTranspose< T, N >::VectorTranspose ( const Vector< T, N > &  v)
inline

Definition at line 32 of file VectorTranspose.h.

32  :
33  _v(v)
34  {}
Vector< T, N > _v

Member Function Documentation

template<class T, int N>
static void VectorTranspose< T, N >::accumulateDotProduct ( VectorTranspose< T, N > &  sum,
const VectorTranspose< T, N > &  v0,
const VectorTranspose< T, N > &  v1 
)
inlinestatic

Definition at line 160 of file VectorTranspose.h.

163  {
165  }
static void accumulateDotProduct(Vector &sum, const Vector &v0, const Vector &v1)
Definition: Vector.h:195
Vector< T, N > _v
template<class T, int N>
static void VectorTranspose< T, N >::accumulateOneNorm ( VectorTranspose< T, N > &  sum,
const VectorTranspose< T, N > &  v 
)
inlinestatic

Definition at line 155 of file VectorTranspose.h.

156  {
158  }
static void accumulateOneNorm(Vector &sum, const Vector &v)
Definition: Vector.h:189
Vector< T, N > _v
template<class T, int N>
static int VectorTranspose< T, N >::getDataSize ( )
inlinestatic

Definition at line 46 of file VectorTranspose.h.

47  {
49  }
template<class T, int N>
static int VectorTranspose< T, N >::getDimension ( )
inlinestatic

Definition at line 42 of file VectorTranspose.h.

template<class T, int N>
static void VectorTranspose< T, N >::getShape ( int *  shp)
inlinestatic

Definition at line 44 of file VectorTranspose.h.

44 { *shp = N; NumTypeTraits<T>::getShape(shp+1);}
template<class T, int N>
SquareTensor<T,N> VectorTranspose< T, N >::getTensor ( const Vector< T, N > &  o)
inline

Definition at line 122 of file VectorTranspose.h.

123  {
125  r.zero();
126  for(int i=0;i<N;i++)
127  for(int j=0;j<N;j++)
128  r(i,j)=o[i]*_v[j];
129  return r;
130  }
Vector< T, N > _v
template<class T, int N>
static string VectorTranspose< T, N >::getTypeName ( )
inlinestatic

Definition at line 36 of file VectorTranspose.h.

37  {
38  return "VectorTranspose<" + NumTypeTraits<T>::getTypeName() +
39  "," + intAsString(N) +
40  ">";
41  }
string intAsString(const int i)
Definition: Vector.h:11
template<class T, int N>
static VectorTranspose VectorTranspose< T, N >::getZero ( )
inlinestatic

Definition at line 137 of file VectorTranspose.h.

138  {
139  VectorTranspose z;
140  z.zero();
141  return z;
142  }
template<class T, int N>
static void VectorTranspose< T, N >::normalize ( VectorTranspose< T, N > &  x,
const VectorTranspose< T, N > &  y 
)
inlinestatic

Definition at line 172 of file VectorTranspose.h.

173  {
175  }
static void normalize(Vector &x, const Vector &y)
Definition: Vector.h:213
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator*= ( const T  s)
inline

Definition at line 103 of file VectorTranspose.h.

104  {
105  _v *= s;
106  return *this;
107  }
Vector< T, N > _v
template<class T, int N>
T VectorTranspose< T, N >::operator*= ( const Vector< T, N > &  o)
inline

Definition at line 109 of file VectorTranspose.h.

110  {
111  return dot(_v,o);
112  }
T dot(const Vector< T, 3 > &a, const Vector< T, 3 > &b)
Definition: Vector.h:253
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator*= ( const VectorTranspose< T, N > &  o)
inline

Definition at line 116 of file VectorTranspose.h.

117  {
118  _v *= o._v;
119  return *this;
120  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator+= ( const VectorTranspose< T, N > &  o)
inline

Definition at line 78 of file VectorTranspose.h.

79  {
80  _v += o._v;
81  return *this;
82  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose VectorTranspose< T, N >::operator- ( )
inline

Definition at line 73 of file VectorTranspose.h.

74  {
75  return VectorTranspose(-_v);
76  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator-= ( const VectorTranspose< T, N > &  o)
inline

Definition at line 84 of file VectorTranspose.h.

85  {
86  _v -= o._v;
87  return *this;
88  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator/= ( const T  s)
inline

Definition at line 90 of file VectorTranspose.h.

91  {
92  _v /= s;
93  return *this;
94  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator/= ( const VectorTranspose< T, N > &  o)
inline

Definition at line 97 of file VectorTranspose.h.

98  {
99  _v /= o._v;
100  return *this;
101  }
Vector< T, N > _v
template<class T, int N>
bool VectorTranspose< T, N >::operator< ( const double  tolerance) const
inline

Definition at line 144 of file VectorTranspose.h.

145  {
146  return _v < tolerance;
147  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator= ( const T &  o)
inline

Definition at line 54 of file VectorTranspose.h.

55  {
56  _v = o;
57  return *this;
58  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator= ( const int  o)
inline

Definition at line 60 of file VectorTranspose.h.

61  {
62  _v = o;
63  return *this;
64  }
Vector< T, N > _v
template<class T, int N>
VectorTranspose& VectorTranspose< T, N >::operator= ( const VectorTranspose< T, N > &  o)
inline

Definition at line 67 of file VectorTranspose.h.

68  {
69  _v = o._v;
70  return *this;
71  }
Vector< T, N > _v
template<class T, int N>
T& VectorTranspose< T, N >::operator[] ( int  n)
inline

Definition at line 51 of file VectorTranspose.h.

51 {return _v[n];}
Vector< T, N > _v
template<class T, int N>
const T& VectorTranspose< T, N >::operator[] ( int  n) const
inline

Definition at line 52 of file VectorTranspose.h.

52 {return _v[n];}
Vector< T, N > _v
template<class T, int N>
void VectorTranspose< T, N >::printFromC ( ostream &  os) const
inline

Definition at line 149 of file VectorTranspose.h.

Referenced by operator<<().

150  {
151  _v.printFromC(os);
152  os << "^T";
153  }
Vector< T, N > _v
template<class T, int N>
static void VectorTranspose< T, N >::reduceSum ( T_Scalar sum,
const This_T x 
)
inlinestatic

Definition at line 182 of file VectorTranspose.h.

183  {
184  Vector<T,N>::reduceSum(sum,x._v);
185  }
static void reduceSum(T_Scalar &sum, const This_T &x)
Definition: Vector.h:201
template<class T, int N>
static void VectorTranspose< T, N >::safeDivide ( VectorTranspose< T, N > &  x,
const VectorTranspose< T, N > &  y 
)
inlinestatic

Definition at line 167 of file VectorTranspose.h.

168  {
170  }
static void safeDivide(Vector &x, const Vector &y)
Definition: Vector.h:207
Vector< T, N > _v
template<class T, int N>
static void VectorTranspose< T, N >::setMax ( VectorTranspose< T, N > &  x,
const VectorTranspose< T, N > &  y 
)
inlinestatic

Definition at line 177 of file VectorTranspose.h.

178  {
180  }
static void setMax(Vector &x, const Vector &y)
Definition: Vector.h:221
Vector< T, N > _v
template<class T, int N>
void VectorTranspose< T, N >::zero ( )
inline

Definition at line 132 of file VectorTranspose.h.

Referenced by VectorTranspose< X, K >::getZero().

133  {
134  _v.zero();
135  }
Vector< T, N > _v

Member Data Documentation

template<class T, int N>
int VectorTranspose< T, N >::NumPy_TypeNum = -1
static

Definition at line 23 of file VectorTranspose.h.


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