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

#include <matvec.h>

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

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 iNumRows
 
VectorData< T, DYNAMIC_SIZErgData
 

Detailed Description

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

Definition at line 1864 of file matvec.h.

Constructor & Destructor Documentation

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

Definition at line 1867 of file matvec.h.

References MATVEC_ASSERT.

1868  :iNumRows(iNumRows),
1869  rgData(iNumRows * N_cols, bZeroInit) {
1870  MATVEC_ASSERT(iNumCols == N_cols);
1871  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1906

Member Function Documentation

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

Definition at line 1874 of file matvec.h.

1874 { return N_cols; }
template<typename T , index_type N_cols>
index_type grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::iGetNumRows ( void  ) const
inline

Definition at line 1873 of file matvec.h.

template<typename T , index_type N_cols>
T& grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::operator() ( index_type  i,
index_type  j 
)
inline

Definition at line 1876 of file matvec.h.

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

1876  {
1877  MATVEC_ASSERT(i >= 1 && i <= iNumRows);
1878  MATVEC_ASSERT(j >= 1 && j <= N_cols);
1879  return rgData[(i - 1) * N_cols + (j - 1)];
1880  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1906
template<typename T , index_type N_cols>
const T& grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::operator() ( index_type  i,
index_type  j 
) const
inline

Definition at line 1882 of file matvec.h.

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

1882  {
1883  MATVEC_ASSERT(i >= 1 && i <= iNumRows);
1884  MATVEC_ASSERT(j >= 1 && j <= N_cols);
1885  return rgData[(i - 1) * N_cols + (j - 1)];
1886  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1906
template<typename T , index_type N_cols>
const T* grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::pGetFirstElem ( ) const
inline

Definition at line 1897 of file matvec.h.

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

1897  {
1898  return rgData.pGetFirstElem();
1899  }
const T * pGetFirstElem() const
Definition: matvec.h:1714
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1906
template<typename T , index_type N_cols>
const T* grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::pGetLastElem ( ) const
inline

Definition at line 1901 of file matvec.h.

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

1901  {
1902  return rgData.pGetLastElem();
1903  }
VectorData< T, DYNAMIC_SIZE > rgData
Definition: matvec.h:1906
const T * pGetLastElem() const
Definition: matvec.h:1718
template<typename T , index_type N_cols>
void grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::Resize ( index_type  iRows,
index_type  iCols 
)
inline

Definition at line 1888 of file matvec.h.

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

1888  {
1889  MATVEC_ASSERT(iCols == N_cols);
1890 
1891  if (iRows != iNumRows) {
1892  rgData.Resize(iRows * iCols);
1893  iNumRows = iRows;
1894  }
1895  }
#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:1906

Member Data Documentation

template<typename T , index_type N_cols>
integer grad::MatrixData< T, DYNAMIC_SIZE, N_cols >::iNumRows
private

Definition at line 1905 of file matvec.h.

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

Definition at line 1906 of file matvec.h.


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