MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
grad::ApplyDerivativeHelper< true > Struct Template Reference

#include <gradient.h>

Static Public Member Functions

template<typename MapVectorType , typename Expression >
static void ApplyDerivative (MapVectorType &ad, const GradientExpression< Expression > &f)
 
template<typename MapVectorType , typename Expression >
static void ApplyBinaryFunction1 (MapVectorType &ad, const GradientExpression< Expression > &f, const index_type iStartLocal, const index_type iEndLocal, const typename GradientExpression< Expression >::scalar_deriv_type df_du, const typename GradientExpression< Expression >::scalar_deriv_type df_dv)
 

Detailed Description

template<>
struct grad::ApplyDerivativeHelper< true >

Definition at line 2178 of file gradient.h.

Member Function Documentation

template<typename MapVectorType , typename Expression >
static void grad::ApplyDerivativeHelper< true >::ApplyBinaryFunction1 ( MapVectorType &  ad,
const GradientExpression< Expression > &  f,
const index_type  iStartLocal,
const index_type  iEndLocal,
const typename GradientExpression< Expression >::scalar_deriv_type  df_du,
const typename GradientExpression< Expression >::scalar_deriv_type  df_dv 
)
inlinestatic

Definition at line 2187 of file gradient.h.

2192  {
2193  typedef RangeVectorBase<typename MapVectorType::scalar_type> RangeVectorType;
2195  const index_type iStartLocalVec = RangeVectorType::iRoundStartIndexVector(iStartLocal);
2196  const index_type iEndLocalVec = RangeVectorType::iRoundEndIndexVector(iEndLocal);
2197 
2198  for (index_type i = iStartLocalVec; i < iEndLocalVec; ++i) {
2199  const vector_deriv_type ud = ad.dGetLocalVectorVector(i);
2200  const vector_deriv_type vd = f.dGetDerivativeLocalVector(i);
2201  ad.SetLocalVectorVector(i, df_du * ud + df_dv * vd);
2202  }
2203  }
integer index_type
Definition: gradient.h:104
RangeVectorBase< scalar_func_type >::vector_type vector_deriv_type
Definition: gradient.h:375
template<typename MapVectorType , typename Expression >
static void grad::ApplyDerivativeHelper< true >::ApplyDerivative ( MapVectorType &  ad,
const GradientExpression< Expression > &  f 
)
inlinestatic

Definition at line 2180 of file gradient.h.

2180  {
2181  for (index_type i = ad.iGetStartIndexLocalVector(); i < ad.iGetEndIndexLocalVector(); ++i) {
2182  ad.SetLocalVectorVector(i, f.dGetDerivativeLocalVector(i));
2183  }
2184  }
integer index_type
Definition: gradient.h:104

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