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

#include <matvec.h>

Collaboration diagram for grad::Matrix< T, N_rows, N_cols >:

Public Types

typedef ScalarTypeTraits< T >
::ScalarType 
ScalarType
 
typedef ScalarTypeTraits< T >
::DirectExpressionType 
ExpressionType
 
typedef VectorExpression
< SliceVector< T, N_cols, 1 >
, N_cols > 
RowVectorType
 
typedef VectorExpression
< SliceVector< T, N_rows,
N_cols >, N_rows > 
ColumnVectorType
 

Public Member Functions

 Matrix ()
 
 Matrix (index_type iRows, index_type iCols)
 
 Matrix (const T &A11, const T &A21, const T &A12, const T &A22)
 
 Matrix (const Matrix &A)
 
 Matrix (const Mat3x3 &A)
 
template<typename InitClass >
 Matrix (const MatrixInit< InitClass, T, N_rows, N_cols > &func)
 
template<typename Expression >
 Matrix (const MatrixExpression< Expression, N_rows, N_cols > &A)
 
template<typename T2 >
 Matrix (const Matrix< T2, N_rows, N_cols > &A, LocalDofMap *pDofMap)
 
template<typename T2 >
void Copy (const Matrix< T2, N_rows, N_cols > &A, LocalDofMap *pDofMap)
 
void Reset ()
 
void Resize (index_type iRows, index_type iCols)
 
template<typename Expression >
Matrixoperator= (const MatrixExpression< Expression, N_rows, N_cols > &A)
 
template<typename T_Rhs >
Matrixoperator+= (const Matrix< T_Rhs, N_rows, N_cols > &A)
 
template<typename T_Rhs >
Matrixoperator-= (const Matrix< T_Rhs, N_rows, N_cols > &A)
 
template<typename Expression >
Matrixoperator+= (const MatrixExpression< Expression, N_rows, N_cols > &A)
 
template<typename Expression >
Matrixoperator-= (const MatrixExpression< Expression, N_rows, N_cols > &A)
 
template<typename T_Rhs >
Matrixoperator*= (const T_Rhs &a)
 
template<typename T_Rhs >
Matrixoperator/= (const T_Rhs &a)
 
template<typename ScalarExpression >
Matrixoperator*= (const GradientExpression< ScalarExpression > &a)
 
template<typename ScalarExpression >
Matrixoperator/= (const GradientExpression< ScalarExpression > &a)
 
Matrixoperator= (const Mat3x3 &A)
 
const ScalarTypeoperator() (index_type iRow, index_type iCol) const
 
ScalarTypeoperator() (index_type iRow, index_type iCol)
 
RowVectorType GetRow (index_type iRow) const
 
ColumnVectorType GetCol (index_type iCol) const
 
index_type iGetNumRows () const
 
index_type iGetNumCols () const
 
const ScalarTypepGetMat () const
 
template<typename ScalarType2 >
bool bHaveReferenceTo (const ScalarType2 *pFirst, const ScalarType2 *pLast) const
 

Static Public Attributes

static const index_type iNumRows = N_rows
 
static const index_type iNumCols = N_cols
 
static const index_type iInitNumRows = iNumRows == DYNAMIC_SIZE ? 0 : iNumRows
 
static const index_type iInitNumCols = iNumCols == DYNAMIC_SIZE ? 0 : iNumCols
 

Private Member Functions

const ScalarTypepGetFirstElem () const
 
const ScalarTypepGetLastElem () const
 
template<typename Func , typename U >
void ApplyScalarFunc (const U &a)
 
template<typename Func , typename Expression >
void ApplyMatrixFunc (const MatrixExpression< Expression, N_rows, N_cols > &A)
 
template<typename Func , typename Expression >
void ApplyMatrixFuncNoAlias (const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &)
 
template<typename Func , typename Expression >
void ApplyMatrixFuncAlias (const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &f)
 

Private Attributes

MatrixData< ScalarType,
iNumRows, iNumCols
rgMat
 

Friends

struct MatVecHelp::ApplyAliasHelperMatrix< false >
 
struct MatVecHelp::ApplyAliasHelperMatrix< true >
 

Detailed Description

template<typename T, index_type N_rows, index_type N_cols>
class grad::Matrix< T, N_rows, N_cols >

Definition at line 92 of file matvec.h.

Member Typedef Documentation

template<typename T, index_type N_rows, index_type N_cols>
typedef VectorExpression<SliceVector<T, N_rows, N_cols>, N_rows> grad::Matrix< T, N_rows, N_cols >::ColumnVectorType

Definition at line 1920 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
typedef ScalarTypeTraits<T>::DirectExpressionType grad::Matrix< T, N_rows, N_cols >::ExpressionType

Definition at line 1917 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
typedef VectorExpression<SliceVector<T, N_cols, 1>, N_cols> grad::Matrix< T, N_rows, N_cols >::RowVectorType

Definition at line 1919 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
typedef ScalarTypeTraits<T>::ScalarType grad::Matrix< T, N_rows, N_cols >::ScalarType

Definition at line 1916 of file matvec.h.

Constructor & Destructor Documentation

template<typename T, index_type N_rows, index_type N_cols>
grad::Matrix< T, N_rows, N_cols >::Matrix ( )
inline

Definition at line 1922 of file matvec.h.

Referenced by grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncAlias().

1923  :rgMat(iInitNumRows, iInitNumCols, true) {
1924  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
static const index_type iInitNumCols
Definition: matvec.h:1915
static const index_type iInitNumRows
Definition: matvec.h:1914
template<typename T, index_type N_rows, index_type N_cols>
grad::Matrix< T, N_rows, N_cols >::Matrix ( index_type  iRows,
index_type  iCols 
)
inline

Definition at line 1926 of file matvec.h.

1927  :rgMat(iRows, iCols, true) {
1928  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
template<typename T, index_type N_rows, index_type N_cols>
grad::Matrix< T, N_rows, N_cols >::Matrix ( const T &  A11,
const T &  A21,
const T &  A12,
const T &  A22 
)
inline

Definition at line 1930 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iNumCols, and grad::Matrix< T, N_rows, N_cols >::iNumRows.

1931  :rgMat(iNumRows, iNumCols, false) {
1932  typedef typename IndexCheck<iNumRows - 2>::CheckType check_iNumRows;
1933  typedef typename IndexCheck<iNumCols - 2>::CheckType check_iNumCols;
1934 
1935  (*this)(1, 1) = A11;
1936  (*this)(2, 1) = A21;
1937  (*this)(1, 2) = A12;
1938  (*this)(2, 2) = A22;
1939  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
static const index_type iNumRows
Definition: matvec.h:1912
static const index_type iNumCols
Definition: matvec.h:1913
template<typename T, index_type N_rows, index_type N_cols>
grad::Matrix< T, N_rows, N_cols >::Matrix ( const Matrix< T, N_rows, N_cols > &  A)
inline

Definition at line 1941 of file matvec.h.

1942  :rgMat(A.rgMat) {
1943  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
template<typename T , index_type N_rows, index_type N_cols>
grad::Matrix< T, N_rows, N_cols >::Matrix ( const Mat3x3 A)
inlineexplicit

Definition at line 2233 of file matvec.h.

References grad::Direct().

2234  :rgMat(N_rows, N_cols, false) {
2235  using namespace MatVecHelp;
2236 
2237  ApplyMatrixFunc<Assign>(Direct(A));
2238 }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
MatrixExpression< MatrixDirectExpr< Matrix< T, N_rows, N_cols > >, N_rows, N_cols > Direct(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2185

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename InitClass >
grad::Matrix< T, N_rows, N_cols >::Matrix ( const MatrixInit< InitClass, T, N_rows, N_cols > &  func)
inlineexplicit

Definition at line 1948 of file matvec.h.

1949  :rgMat(func.iGetNumRows(), func.iGetNumCols(), false) {
1950  func.Initialize(*this);
1951  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void func(const T &u, const T &v, const T &w, doublereal e, T &f)
template<typename T, index_type N_rows, index_type N_cols>
template<typename Expression >
grad::Matrix< T, N_rows, N_cols >::Matrix ( const MatrixExpression< Expression, N_rows, N_cols > &  A)
inline

Definition at line 1954 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncNoAlias().

1955  :rgMat(A.iGetNumRows(), A.iGetNumCols(), false) {
1956  // No aliases are possible because the object did not exist before
1957  using namespace MatVecHelp;
1958  ApplyMatrixFuncNoAlias(A, Assign());
1959  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void ApplyMatrixFuncNoAlias(const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &)
Definition: matvec.h:2159

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename T2 >
grad::Matrix< T, N_rows, N_cols >::Matrix ( const Matrix< T2, N_rows, N_cols > &  A,
LocalDofMap pDofMap 
)
inline

Definition at line 1962 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::Copy().

1963  :rgMat(A.iGetNumRows(), A.iGetNumCols(), false) {
1964  Copy(A, pDofMap);
1965  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Copy(const Matrix< T2, N_rows, N_cols > &A, LocalDofMap *pDofMap)
Definition: matvec.h:1968

Here is the call graph for this function:

Member Function Documentation

template<typename T, index_type N_rows, index_type N_cols>
template<typename Func , typename Expression >
void grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFunc ( const MatrixExpression< Expression, N_rows, N_cols > &  A)
inlineprivate

Definition at line 2152 of file matvec.h.

Referenced by grad::Vector< T, N_rows >::ApplyMatrixFunc().

2152  {
2153  using namespace MatVecHelp;
2154 
2155  ApplyAliasHelperMatrix<MatrixExpression<Expression, N_rows, N_cols>::bAlias>::ApplyMatrixFunc(*this, A, Func());
2156  }
void ApplyMatrixFunc(const MatrixExpression< Expression, N_rows, N_cols > &A)
Definition: matvec.h:2152
template<typename T, index_type N_rows, index_type N_cols>
template<typename Func , typename Expression >
void grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncAlias ( const MatrixExpression< Expression, N_rows, N_cols > &  A,
const Func &  f 
)
inlineprivate

Definition at line 2175 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncNoAlias(), and grad::Matrix< T, N_rows, N_cols >::Matrix().

2175  {
2176  ApplyMatrixFuncNoAlias(MatrixExpression<MatrixDirectExpr<Matrix>, N_rows, N_cols>(Matrix(A)), f);
2177  }
void ApplyMatrixFuncNoAlias(const MatrixExpression< Expression, N_rows, N_cols > &A, const Func &)
Definition: matvec.h:2159

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename Func , typename Expression >
void grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncNoAlias ( const MatrixExpression< Expression, N_rows, N_cols > &  A,
const Func &   
)
inlineprivate

Definition at line 2159 of file matvec.h.

References grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumRows(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, grad::Matrix< T, N_rows, N_cols >::pGetFirstElem(), grad::Matrix< T, N_rows, N_cols >::pGetLastElem(), grad::MatrixData< T, N_rows, N_cols >::Resize(), and grad::Matrix< T, N_rows, N_cols >::rgMat.

Referenced by grad::Matrix< T, N_rows, N_cols >::ApplyMatrixFuncAlias(), grad::Vector< T, N_rows >::ApplyMatrixFuncAlias(), grad::Matrix< T, N_rows, N_cols >::Matrix(), and grad::Vector< T, N_rows >::Vector().

2159  {
2160  MATVEC_ASSERT(!A.bHaveReferenceTo(pGetFirstElem(), pGetLastElem()));
2161 
2162  rgMat.Resize(A.iGetNumRows(), A.iGetNumCols());
2163 
2164  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
2165  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
2166 
2167  for (index_type i = 1; i <= iGetNumRows(); ++i) {
2168  for (index_type j = 1; j <= iGetNumCols(); ++j) {
2169  Func::Eval((*this)(i, j), A(i, j));
2170  }
2171  }
2172  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Resize(index_type iRows, index_type iCols)
Definition: matvec.h:1755
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
integer index_type
Definition: gradient.h:104
index_type iGetNumCols() const
Definition: matvec.h:2119
const ScalarType * pGetFirstElem() const
Definition: matvec.h:2131
const ScalarType * pGetLastElem() const
Definition: matvec.h:2135

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename Func , typename U >
void grad::Matrix< T, N_rows, N_cols >::ApplyScalarFunc ( const U &  a)
inlineprivate

Definition at line 2143 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), and grad::Matrix< T, N_rows, N_cols >::iGetNumRows().

2143  {
2144  for (index_type i = 1; i <= iGetNumRows(); ++i) {
2145  for (index_type j = 1; j <= iGetNumCols(); ++j) {
2146  Func::Eval((*this)(i, j), a);
2147  }
2148  }
2149  }
index_type iGetNumRows() const
Definition: matvec.h:2118
integer index_type
Definition: gradient.h:104
index_type iGetNumCols() const
Definition: matvec.h:2119
static const doublereal a
Definition: hfluid_.h:289

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename ScalarType2 >
bool grad::Matrix< T, N_rows, N_cols >::bHaveReferenceTo ( const ScalarType2 *  pFirst,
const ScalarType2 *  pLast 
) const
inline

Definition at line 2123 of file matvec.h.

References grad::bArrayOverlap(), grad::Matrix< T, N_rows, N_cols >::pGetFirstElem(), and grad::Matrix< T, N_rows, N_cols >::pGetLastElem().

2123  {
2124  return bArrayOverlap(pGetFirstElem(),
2125  pGetLastElem(),
2126  pFirst,
2127  pLast);
2128  }
bool bArrayOverlap(const ScalarType *pFirstArray1, const ScalarType *pLastArray1, const ScalarType *pFirstArray2, const ScalarType *pLastArray2)
Definition: matvec.h:430
const ScalarType * pGetFirstElem() const
Definition: matvec.h:2131
const ScalarType * pGetLastElem() const
Definition: matvec.h:2135

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename T2 >
void grad::Matrix< T, N_rows, N_cols >::Copy ( const Matrix< T2, N_rows, N_cols > &  A,
LocalDofMap pDofMap 
)
inline

Definition at line 1968 of file matvec.h.

References grad::Copy(), grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, grad::MatrixData< T, N_rows, N_cols >::Resize(), and grad::Matrix< T, N_rows, N_cols >::rgMat.

Referenced by grad::Matrix< T, N_rows, N_cols >::Matrix(), and grad::Vector< T, N_rows >::Vector().

1968  {
1969  rgMat.Resize(A.iGetNumRows(), A.iGetNumCols());
1970 
1971  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
1972  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
1973 
1974  for (index_type i = 1; i <= A.iGetNumRows(); ++i) {
1975  for (index_type j = 1; j <= A.iGetNumCols(); ++j) {
1976  grad::Copy((*this)(i, j), A(i, j), pDofMap);
1977  }
1978  }
1979  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Resize(index_type iRows, index_type iCols)
Definition: matvec.h:1755
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
integer index_type
Definition: gradient.h:104
index_type iGetNumCols() const
Definition: matvec.h:2119
void Copy(scalar_func_type &d1, const scalar_func_type &d2, LocalDofMap *)
Definition: gradient.h:2827

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
ColumnVectorType grad::Matrix< T, N_rows, N_cols >::GetCol ( index_type  iCol) const
inline

Definition at line 2112 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, and grad::Matrix< T, N_rows, N_cols >::rgMat.

Referenced by grad::VecRotInit< T, MatrixExpr >::Initialize(), MatDynamicT_test_grad(), testMatVecProduct(), and testMatVecProductGradient().

2112  {
2113  MATVEC_ASSERT(iCol >= 1);
2114  MATVEC_ASSERT(iCol <= iGetNumCols());
2115  return ColumnVectorType(&rgMat(1, iCol), iGetNumRows(), iGetNumCols());
2116  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119
VectorExpression< SliceVector< T, N_rows, N_cols >, N_rows > ColumnVectorType
Definition: matvec.h:1920

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
RowVectorType grad::Matrix< T, N_rows, N_cols >::GetRow ( index_type  iRow) const
inline

Definition at line 2105 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, and grad::Matrix< T, N_rows, N_cols >::rgMat.

Referenced by MatDynamicT_test_grad(), testMatVecProduct(), and testMatVecProductGradient().

2105  {
2106  MATVEC_ASSERT(iRow >= 1);
2107  MATVEC_ASSERT(iRow <= iGetNumRows());
2108  return RowVectorType(&rgMat(iRow, 1), iGetNumCols(), 1);
2109  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119
VectorExpression< SliceVector< T, N_cols, 1 >, N_cols > RowVectorType
Definition: matvec.h:1919

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
index_type grad::Matrix< T, N_rows, N_cols >::iGetNumRows ( void  ) const
inline
template<typename T, index_type N_rows, index_type N_cols>
const ScalarType& grad::Matrix< T, N_rows, N_cols >::operator() ( index_type  iRow,
index_type  iCol 
) const
inline

Definition at line 2088 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, and grad::Matrix< T, N_rows, N_cols >::rgMat.

2088  {
2089  MATVEC_ASSERT(iRow >= 1);
2090  MATVEC_ASSERT(iRow <= iGetNumRows());
2091  MATVEC_ASSERT(iCol >= 1);
2092  MATVEC_ASSERT(iCol <= iGetNumCols());
2093  return rgMat(iRow, iCol);
2094  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
ScalarType& grad::Matrix< T, N_rows, N_cols >::operator() ( index_type  iRow,
index_type  iCol 
)
inline

Definition at line 2096 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), MATVEC_ASSERT, and grad::Matrix< T, N_rows, N_cols >::rgMat.

2096  {
2097  MATVEC_ASSERT(iRow >= 1);
2098  MATVEC_ASSERT(iRow <= iGetNumRows());
2099  MATVEC_ASSERT(iCol >= 1);
2100  MATVEC_ASSERT(iCol <= iGetNumCols());
2101  return rgMat(iRow, iCol);
2102  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename T_Rhs >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator*= ( const T_Rhs &  a)
inline

Definition at line 2051 of file matvec.h.

References a.

2051  {
2052  using namespace MatVecHelp;
2053 
2054  ApplyScalarFunc<Mul>(a);
2055 
2056  return *this;
2057  }
static const doublereal a
Definition: hfluid_.h:289
template<typename T, index_type N_rows, index_type N_cols>
template<typename ScalarExpression >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator*= ( const GradientExpression< ScalarExpression > &  a)
inline

Definition at line 2069 of file matvec.h.

2069  {
2070  using namespace MatVecHelp;
2071 
2072  ApplyScalarFunc<Mul>(ScalarType(a));
2073 
2074  return *this;
2075  }
ScalarTypeTraits< T >::ScalarType ScalarType
Definition: matvec.h:1916
static const doublereal a
Definition: hfluid_.h:289
template<typename T, index_type N_rows, index_type N_cols>
template<typename T_Rhs >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator+= ( const Matrix< T_Rhs, N_rows, N_cols > &  A)
inline

Definition at line 2006 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), and MATVEC_ASSERT.

2006  {
2007  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
2008  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
2009  using namespace MatVecHelp;
2010 
2011  ApplyMatrixFunc<Add>(MatrixExpression<MatrixDirectExpr<Matrix<T_Rhs, N_rows, N_cols> >, N_rows, N_cols>(A));
2012 
2013  return *this;
2014  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename Expression >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator+= ( const MatrixExpression< Expression, N_rows, N_cols > &  A)
inline

Definition at line 2029 of file matvec.h.

References grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumRows(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), and MATVEC_ASSERT.

2029  {
2030  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
2031  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
2032  using namespace MatVecHelp;
2033 
2034  ApplyMatrixFunc<Add>(A);
2035 
2036  return *this;
2037  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename T_Rhs >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator-= ( const Matrix< T_Rhs, N_rows, N_cols > &  A)
inline

Definition at line 2017 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), and MATVEC_ASSERT.

2017  {
2018  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
2019  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
2020 
2021  using namespace MatVecHelp;
2022 
2023  ApplyMatrixFunc<Sub>(MatrixExpression<MatrixDirectExpr<Matrix<T_Rhs, N_rows, N_cols> >, N_rows, N_cols>(A));
2024 
2025  return *this;
2026  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename Expression >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator-= ( const MatrixExpression< Expression, N_rows, N_cols > &  A)
inline

Definition at line 2040 of file matvec.h.

References grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumRows(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), and MATVEC_ASSERT.

2040  {
2041  MATVEC_ASSERT(A.iGetNumRows() == iGetNumRows());
2042  MATVEC_ASSERT(A.iGetNumCols() == iGetNumCols());
2043  using namespace MatVecHelp;
2044 
2045  ApplyMatrixFunc<Sub>(A);
2046 
2047  return *this;
2048  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
index_type iGetNumRows() const
Definition: matvec.h:2118
index_type iGetNumCols() const
Definition: matvec.h:2119

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
template<typename T_Rhs >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator/= ( const T_Rhs &  a)
inline

Definition at line 2060 of file matvec.h.

References a.

2060  {
2061  using namespace MatVecHelp;
2062 
2063  ApplyScalarFunc<Div>(a);
2064 
2065  return *this;
2066  }
static const doublereal a
Definition: hfluid_.h:289
template<typename T, index_type N_rows, index_type N_cols>
template<typename ScalarExpression >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator/= ( const GradientExpression< ScalarExpression > &  a)
inline

Definition at line 2078 of file matvec.h.

2078  {
2079  using namespace MatVecHelp;
2080 
2081  ApplyScalarFunc<Div>(ScalarType(a));
2082 
2083  return *this;
2084  }
ScalarTypeTraits< T >::ScalarType ScalarType
Definition: matvec.h:1916
static const doublereal a
Definition: hfluid_.h:289
template<typename T, index_type N_rows, index_type N_cols>
template<typename Expression >
Matrix& grad::Matrix< T, N_rows, N_cols >::operator= ( const MatrixExpression< Expression, N_rows, N_cols > &  A)
inline

Definition at line 1994 of file matvec.h.

References grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumCols(), grad::MatrixExpression< Expression, N_rows, N_cols, CLEAR_ALIAS >::iGetNumRows(), grad::MatrixData< T, N_rows, N_cols >::Resize(), and grad::Matrix< T, N_rows, N_cols >::rgMat.

1994  {
1995 
1996  rgMat.Resize(A.iGetNumRows(), A.iGetNumCols());
1997 
1998  using namespace MatVecHelp;
1999 
2000  ApplyMatrixFunc<Assign>(A);
2001 
2002  return *this;
2003  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Resize(index_type iRows, index_type iCols)
Definition: matvec.h:1755

Here is the call graph for this function:

template<typename T , index_type N_rows, index_type N_cols>
Matrix< T, N_rows, N_cols > & grad::Matrix< T, N_rows, N_cols >::operator= ( const Mat3x3 A)
inline

Definition at line 2242 of file matvec.h.

References grad::Direct(), grad::MatrixData< T, N_rows, N_cols >::Resize(), and grad::Matrix< T, N_rows, N_cols >::rgMat.

2242  {
2243  typedef typename MaxSizeCheck<N_rows == 3 || N_rows == DYNAMIC_SIZE>::CheckType check_iNumRows;
2244  typedef typename MaxSizeCheck<N_cols == 3 || N_cols == DYNAMIC_SIZE>::CheckType check_iNumCols;
2245 
2246  rgMat.Resize(3, 3);
2247 
2248  using namespace MatVecHelp;
2249 
2250  ApplyMatrixFunc<Assign>(Direct(A));
2251 
2252  return *this;
2253 }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Resize(index_type iRows, index_type iCols)
Definition: matvec.h:1755
MatrixExpression< MatrixDirectExpr< Matrix< T, N_rows, N_cols > >, N_rows, N_cols > Direct(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2185

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
const ScalarType* grad::Matrix< T, N_rows, N_cols >::pGetFirstElem ( ) const
inlineprivate
template<typename T, index_type N_rows, index_type N_cols>
const ScalarType* grad::Matrix< T, N_rows, N_cols >::pGetLastElem ( ) const
inlineprivate
template<typename T, index_type N_rows, index_type N_cols>
const ScalarType* grad::Matrix< T, N_rows, N_cols >::pGetMat ( ) const
inline

Definition at line 2120 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::pGetFirstElem().

Referenced by callFunc2().

2120 { return pGetFirstElem(); }
const ScalarType * pGetFirstElem() const
Definition: matvec.h:2131

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
void grad::Matrix< T, N_rows, N_cols >::Reset ( void  )
inline

Definition at line 1981 of file matvec.h.

References grad::Matrix< T, N_rows, N_cols >::iGetNumCols(), grad::Matrix< T, N_rows, N_cols >::iGetNumRows(), and grad::Reset().

Referenced by testMatVecProductGradient().

1981  {
1982  for (index_type i = 1; i <= iGetNumRows(); ++i) {
1983  for (index_type j = 1; j <= iGetNumCols(); ++j) {
1984  grad::Reset((*this)(i, j));
1985  }
1986  }
1987  }
index_type iGetNumRows() const
Definition: matvec.h:2118
integer index_type
Definition: gradient.h:104
index_type iGetNumCols() const
Definition: matvec.h:2119
void Reset(scalar_func_type &d)
Definition: gradient.h:2836

Here is the call graph for this function:

template<typename T, index_type N_rows, index_type N_cols>
void grad::Matrix< T, N_rows, N_cols >::Resize ( index_type  iRows,
index_type  iCols 
)
inline

Definition at line 1989 of file matvec.h.

References grad::MatrixData< T, N_rows, N_cols >::Resize(), and grad::Matrix< T, N_rows, N_cols >::rgMat.

1989  {
1990  rgMat.Resize(iRows, iCols);
1991  }
MatrixData< ScalarType, iNumRows, iNumCols > rgMat
Definition: matvec.h:2180
void Resize(index_type iRows, index_type iCols)
Definition: matvec.h:1755

Here is the call graph for this function:

Friends And Related Function Documentation

template<typename T, index_type N_rows, index_type N_cols>
friend struct MatVecHelp::ApplyAliasHelperMatrix< false >
friend

Definition at line 2139 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
friend struct MatVecHelp::ApplyAliasHelperMatrix< true >
friend

Definition at line 2140 of file matvec.h.

Member Data Documentation

template<typename T, index_type N_rows, index_type N_cols>
const index_type grad::Matrix< T, N_rows, N_cols >::iInitNumCols = iNumCols == DYNAMIC_SIZE ? 0 : iNumCols
static

Definition at line 1915 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
const index_type grad::Matrix< T, N_rows, N_cols >::iInitNumRows = iNumRows == DYNAMIC_SIZE ? 0 : iNumRows
static

Definition at line 1914 of file matvec.h.

template<typename T, index_type N_rows, index_type N_cols>
const index_type grad::Matrix< T, N_rows, N_cols >::iNumCols = N_cols
static

Definition at line 1913 of file matvec.h.

Referenced by grad::Matrix< T, N_rows, N_cols >::Matrix().

template<typename T, index_type N_rows, index_type N_cols>
const index_type grad::Matrix< T, N_rows, N_cols >::iNumRows = N_rows
static

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