MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
grad::MatrixData< T, N_rows, DYNAMIC_SIZE > Class Template Reference

#include <matvec.h>

Collaboration diagram for grad::MatrixData< T, N_rows, DYNAMIC_SIZE >:

Public Member Functions

 MatrixData (index_type iNumRows, index_type iNumCols, bool bZeroInit)
 
index_type iGetNumRows () const
 
index_type iGetNumCols () const
 
T & operator() (index_type i, index_type j)
 
const T & operator() (index_type i, index_type j) const
 
void Resize (index_type iRows, index_type iCols)
 
const T * pGetFirstElem () const
 
const T * pGetLastElem () const
 

Private Attributes

integer iNumCols
 
VectorData< T, DYNAMIC_SIZErgData
 

Detailed Description

template<typename T, index_type N_rows>
class grad::MatrixData< T, N_rows, DYNAMIC_SIZE >

Definition at line 1818 of file matvec.h.

Constructor & Destructor Documentation

template<typename T , index_type N_rows>
grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::MatrixData ( index_type  iNumRows,
index_type  iNumCols,
bool  bZeroInit 
)
inline

Definition at line 1821 of file matvec.h.

References MATVEC_ASSERT.

1822  :iNumCols(iNumCols),
1823  rgData(N_rows * iNumCols, bZeroInit) {
1824  MATVEC_ASSERT(iNumRows == N_rows);
1825  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860

Member Function Documentation

template<typename T , index_type N_rows>
index_type grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::iGetNumCols ( void  ) const
inline

Definition at line 1828 of file matvec.h.

template<typename T , index_type N_rows>
index_type grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::iGetNumRows ( void  ) const
inline

Definition at line 1827 of file matvec.h.

1827 { return N_rows; }
template<typename T , index_type N_rows>
T& grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::operator() ( index_type  i,
index_type  j 
)
inline

Definition at line 1830 of file matvec.h.

References MATVEC_ASSERT, and grad::MatrixData< T, N_rows, N_cols >::rgData.

1830  {
1831  MATVEC_ASSERT(i >= 1 && i <= N_rows);
1832  MATVEC_ASSERT(j >= 1 && j <= iNumCols);
1833  return rgData[(i - 1) * iNumCols + (j - 1)];
1834  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860
template<typename T , index_type N_rows>
const T& grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::operator() ( index_type  i,
index_type  j 
) const
inline

Definition at line 1836 of file matvec.h.

References MATVEC_ASSERT, and grad::MatrixData< T, N_rows, N_cols >::rgData.

1836  {
1837  MATVEC_ASSERT(i >= 1 && i <= N_rows);
1838  MATVEC_ASSERT(j >= 1 && j <= iNumCols);
1839  return rgData[(i - 1) * iNumCols + (j - 1)];
1840  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860
template<typename T , index_type N_rows>
const T* grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::pGetFirstElem ( ) const
inline

Definition at line 1851 of file matvec.h.

References grad::MatrixData< T, N_rows, N_cols >::rgData.

1851  {
1852  return rgData.pGetFirstElem();
1853  }
const T * pGetFirstElem() const
Definition: matvec.h:1714
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860
template<typename T , index_type N_rows>
const T* grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::pGetLastElem ( ) const
inline

Definition at line 1855 of file matvec.h.

References grad::MatrixData< T, N_rows, N_cols >::rgData.

1855  {
1856  return rgData.pGetLastElem();
1857  }
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860
const T * pGetLastElem() const
Definition: matvec.h:1718
template<typename T , index_type N_rows>
void grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::Resize ( index_type  iRows,
index_type  iCols 
)
inline

Definition at line 1842 of file matvec.h.

References MATVEC_ASSERT, and grad::MatrixData< T, N_rows, N_cols >::rgData.

1842  {
1843  MATVEC_ASSERT(iRows == N_rows);
1844 
1845  if (iCols != iNumCols) {
1846  rgData.Resize(iRows * iCols);
1847  iNumCols = iCols;
1848  }
1849  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
void Resize(index_type iNumRows)
Definition: matvec.h:1708
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1860

Member Data Documentation

template<typename T , index_type N_rows>
integer grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::iNumCols
private

Definition at line 1859 of file matvec.h.

template<typename T , index_type N_rows>
VectorData<T, DYNAMIC_SIZE> grad::MatrixData< T, N_rows, DYNAMIC_SIZE >::rgData
private

Definition at line 1860 of file matvec.h.


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