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

#include <matvec.h>

Collaboration diagram for grad::MatGInit< T, VectorExpr >:

Public Member Functions

 MatGInit (const VectorExpression< VectorExpr, 3 > &g)
 
void Initialize (Matrix< T, 3, 3 > &G) const
 
index_type iGetNumRows () const
 
index_type iGetNumCols () const
 

Static Public Attributes

static const index_type iNumRows = 3
 
static const index_type iNumCols = 3
 

Private Attributes

const VectorExpression
< VectorExpr, 3 > 
g
 

Detailed Description

template<typename T, typename VectorExpr>
class grad::MatGInit< T, VectorExpr >

Definition at line 2722 of file matvec.h.

Constructor & Destructor Documentation

template<typename T , typename VectorExpr >
grad::MatGInit< T, VectorExpr >::MatGInit ( const VectorExpression< VectorExpr, 3 > &  g)
inline

Definition at line 2727 of file matvec.h.

2728  :g(g) {
2729 
2730  }
const VectorExpression< VectorExpr, 3 > g
Definition: matvec.h:2756

Member Function Documentation

template<typename T , typename VectorExpr >
index_type grad::MatGInit< T, VectorExpr >::iGetNumCols ( void  ) const
inline

Definition at line 2754 of file matvec.h.

2754 { return iNumCols; }
static const index_type iNumCols
Definition: matvec.h:2725
template<typename T , typename VectorExpr >
index_type grad::MatGInit< T, VectorExpr >::iGetNumRows ( void  ) const
inline

Definition at line 2753 of file matvec.h.

References grad::Vector< T, N_rows >::iNumRows.

2753 { return iNumRows; }
static const index_type iNumRows
Definition: matvec.h:2724
template<typename T , typename VectorExpr >
void grad::MatGInit< T, VectorExpr >::Initialize ( Matrix< T, 3, 3 > &  G) const
inline

Definition at line 2732 of file matvec.h.

References grad::Dot().

2732  {
2733 /*
2734  * G = 4/(4 + g' * g) * (eye(3) + 1/2*skew(g))
2735  *
2736  * skew(g) = [ 0, -g(3), g(2);
2737  * g(3), 0, -g(1);
2738  * -g(2), g(1), 0]
2739  */
2740  const T d = (4./(4.+Dot(g, g)));
2741 
2742  G(1, 1) = d;
2743  G(2, 1) = g(3) * d / 2.;
2744  G(3, 1) = -g(2) * d / 2.;
2745  G(1, 2) = -g(3) * d / 2.;
2746  G(2, 2) = d;
2747  G(3, 2) = g(1) * d / 2.;
2748  G(1, 3) = g(2) * d / 2.;
2749  G(2, 3) = -g(1) * d / 2.;
2750  G(3, 3) = d;
2751  }
DotTraits< VectorExprLhs, VectorExprRhs, N_rows, N_rows >::ExpressionType Dot(const VectorExpression< VectorExprLhs, N_rows > &u, const VectorExpression< VectorExprRhs, N_rows > &v)
Definition: matvec.h:3133
const VectorExpression< VectorExpr, 3 > g
Definition: matvec.h:2756

Here is the call graph for this function:

Member Data Documentation

template<typename T , typename VectorExpr >
const VectorExpression<VectorExpr, 3> grad::MatGInit< T, VectorExpr >::g
private

Definition at line 2756 of file matvec.h.

template<typename T , typename VectorExpr >
const index_type grad::MatGInit< T, VectorExpr >::iNumCols = 3
static

Definition at line 2725 of file matvec.h.

template<typename T , typename VectorExpr >
const index_type grad::MatGInit< T, VectorExpr >::iNumRows = 3
static

Definition at line 2724 of file matvec.h.


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