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

#include <matvec.h>

Inheritance diagram for grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >:
Collaboration diagram for grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >:

Public Types

typedef MatrixLhsExpr::ScalarType MatrixLhsScalarExpr
 
typedef VectorRhsExpr::ScalarType VectorRhsScalarExpr
 
typedef CommonScalarType
< typename BasicScalarType
< MatrixLhsScalarExpr >
::ScalarType, typename
BasicScalarType
< VectorRhsScalarExpr >
::ScalarType >::ScalarType 
ScalarType
 
typedef ScalarType ExpressionType
 

Public Member Functions

 MatrixVectorProduct (const MatrixLhsExpr &A, const VectorRhsExpr &x)
 
ScalarType operator() (index_type i) const
 
index_type iGetNumRows () const
 
template<typename ScalarType2 >
bool bHaveReferenceTo (const ScalarType2 *pFirst, const ScalarType2 *pLast) const
 

Static Public Attributes

static const bool bAlias = MatrixLhsExpr::bAlias || VectorRhsExpr::bAlias
 
static const index_type iNumRows = MatrixLhsExpr::iNumRows
 

Private Attributes

const MatrixLhsExpr A
 
const VectorRhsExpr x
 

Detailed Description

template<typename MatrixLhsExpr, typename VectorRhsExpr>
class grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >

Definition at line 3336 of file matvec.h.

Member Typedef Documentation

template<typename MatrixLhsExpr , typename VectorRhsExpr >
typedef ScalarType grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::ExpressionType

Definition at line 3345 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
typedef MatrixLhsExpr::ScalarType grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::MatrixLhsScalarExpr

Definition at line 3340 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
typedef CommonScalarType<typename BasicScalarType<MatrixLhsScalarExpr>::ScalarType, typename BasicScalarType<VectorRhsScalarExpr>::ScalarType>::ScalarType grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::ScalarType

Definition at line 3344 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
typedef VectorRhsExpr::ScalarType grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::VectorRhsScalarExpr

Definition at line 3341 of file matvec.h.

Constructor & Destructor Documentation

template<typename MatrixLhsExpr , typename VectorRhsExpr >
grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::MatrixVectorProduct ( const MatrixLhsExpr &  A,
const VectorRhsExpr &  x 
)
inline

Member Function Documentation

template<typename MatrixLhsExpr , typename VectorRhsExpr >
template<typename ScalarType2 >
bool grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::bHaveReferenceTo ( const ScalarType2 *  pFirst,
const ScalarType2 *  pLast 
) const
inline

Definition at line 3371 of file matvec.h.

3371  {
3372  return A.bHaveReferenceTo(pFirst, pLast) || x.bHaveReferenceTo(pFirst, pLast);
3373  }
template<typename MatrixLhsExpr , typename VectorRhsExpr >
index_type grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::iGetNumRows ( void  ) const
inline

Definition at line 3366 of file matvec.h.

3366  {
3367  return A.iGetNumRows();
3368  }
template<typename MatrixLhsExpr , typename VectorRhsExpr >
ScalarType grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::operator() ( index_type  i) const
inline

Definition at line 3352 of file matvec.h.

References grad::Vector< T, N_rows >::iGetNumRows(), and MATVEC_ASSERT.

3352  {
3353  MATVEC_ASSERT(i >= 1);
3354  MATVEC_ASSERT(i <= iGetNumRows());
3355  MATVEC_ASSERT(A.iGetNumCols() == x.iGetNumRows());
3356 
3357  ScalarType b_i(0);
3358 
3359  for (integer j = 1; j <= A.iGetNumCols(); ++j) {
3360  b_i += A(i, j) * x(j);
3361  }
3362 
3363  return b_i;
3364  }
#define MATVEC_ASSERT(expr)
Definition: matvec.h:64
CommonScalarType< typename BasicScalarType< MatrixLhsScalarExpr >::ScalarType, typename BasicScalarType< VectorRhsScalarExpr >::ScalarType >::ScalarType ScalarType
Definition: matvec.h:3344
long int integer
Definition: colamd.c:51

Here is the call graph for this function:

Member Data Documentation

template<typename MatrixLhsExpr , typename VectorRhsExpr >
const MatrixLhsExpr grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::A
private

Definition at line 3376 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
const bool grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::bAlias = MatrixLhsExpr::bAlias || VectorRhsExpr::bAlias
static

Definition at line 3338 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
const index_type grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::iNumRows = MatrixLhsExpr::iNumRows
static

Definition at line 3339 of file matvec.h.

template<typename MatrixLhsExpr , typename VectorRhsExpr >
const VectorRhsExpr grad::MatrixVectorProduct< DYNAMIC_SIZE, DYNAMIC_SIZE, MatrixLhsExpr, VectorRhsExpr >::x
private

Definition at line 3377 of file matvec.h.


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