g4tools  5.4.0
Public Member Functions | Protected Attributes | List of all members
tools::mat< T, D > Class Template Reference

Public Member Functions

 mat ()
 
virtual ~mat ()
 
 mat (const mat &a_from)
 
matoperator= (const mat &a_from)
 
 mat (const T a_v[])
 
unsigned int dimension () const
 

Protected Attributes

m_vec [D *D]
 

Detailed Description

template<class T, unsigned int D>
class tools::mat< T, D >

Definition at line 19 of file mat.

Constructor & Destructor Documentation

◆ mat() [1/3]

template<class T , unsigned int D>
tools::mat< T, D >::mat ( )
inline

Definition at line 33 of file mat.

37  {
38 #ifdef TOOLS_MEM
39  if(a_inc) mem::increment(s_class().c_str());
40 #endif
41 #ifdef TOOLS_MAT_NEW
42  m_vec = new T[D*D];
43 #endif
44  for(unsigned int i=0;i<_D2;i++) m_vec[i] = zero();
45  }

◆ ~mat()

template<class T , unsigned int D>
virtual tools::mat< T, D >::~mat ( )
inlinevirtual

Definition at line 46 of file mat.

46  {
47 #ifdef TOOLS_MAT_NEW
48  delete [] m_vec;
49 #endif
50 #ifdef TOOLS_MEM
51  mem::decrement(s_class().c_str());
52 #endif
53  }

◆ mat() [2/3]

template<class T , unsigned int D>
tools::mat< T, D >::mat ( const mat< T, D > &  a_from)
inline

Definition at line 55 of file mat.

55  {
56 #ifdef TOOLS_MEM
57  mem::increment(s_class().c_str());
58 #endif
59 #ifdef TOOLS_MAT_NEW
60  m_vec = new T[D*D];
61 #endif
62  _copy(a_from.m_vec);
63  }

◆ mat() [3/3]

template<class T , unsigned int D>
tools::mat< T, D >::mat ( const T  a_v[])
inline

Definition at line 70 of file mat.

70  {
71 #ifdef TOOLS_MEM
72  mem::increment(s_class().c_str());
73 #endif
74 #ifdef TOOLS_MAT_NEW
75  m_vec = new T[D*D];
76 #endif
77  _copy(a_v);
78  }

Member Function Documentation

◆ dimension()

template<class T , unsigned int D>
unsigned int tools::mat< T, D >::dimension ( ) const
inline

Definition at line 80 of file mat.

80 {return D;}

◆ operator=()

template<class T , unsigned int D>
mat& tools::mat< T, D >::operator= ( const mat< T, D > &  a_from)
inline

Definition at line 64 of file mat.

64  {
65  if(&a_from==this) return *this;
66  _copy(a_from.m_vec);
67  return *this;
68  }

Member Data Documentation

◆ m_vec

template<class T , unsigned int D>
T tools::mat< T, D >::m_vec[D *D]
protected

Definition at line 85 of file mat.


The documentation for this class was generated from the following file:
tools::mat::m_vec
T m_vec[D *D]
Definition: mat:85