CoDiPack  2.2.0
A Code Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore > Struct Template Reference

#include <evaluationHelper.hpp>

Inheritance diagram for codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >:

Public Types

using Base = EvaluationHandleBase< Func, Type, InputStore, OutputStore >
 Abbreviation for the base class.
 
using Func = T_Func
 See EvaluationHandleBase.
 
using InputStore = T_InputStore
 See EvaluationHandleBase.
 
using OutputStore = T_OutputStore
 See EvaluationHandleBase.
 
using Type = T_Type
 See EvaluationHandleBase.
 
- Public Types inherited from codi::EvaluationHandleBase< T_Func, T_Type, T_InputStore, T_OutputStore >
using Func = T_Func
 See EvaluationHandleBase.
 
using InputStore = T_InputStore
 See EvaluationHandleBase.
 
using OutputStore = T_OutputStore
 See EvaluationHandleBase.
 
using Type = T_Type
 See EvaluationHandleBase.
 

Public Member Functions

template<typename VecX , typename Hes , typename VecY , typename Jac >
void computeHessian (VecX const &locX, Hes &hes, VecY &locY, Jac &jac)
 Perform a Hessian evaluation with the inputs provided in locX and store the result in hes, jac and locY.
 
template<typename VecX , typename Jac , typename VecY >
void computeJacobian (VecX const &locX, Jac &jac, VecY &locY)
 Perform a Jacobian evaluation with the inputs provided in locX and store the result in jac and locY.
 
template<typename VecX , typename VecY >
void computePrimal (VecX const &locX, VecY &locY)
 Perform a primal evaluation with the inputs provided in locX and store the result in locY.
 
 EvaluationHandleBase (Func &func, size_t m, size_t n)
 Constructor.
 
template<typename VecY >
void getPrimalOutputs (VecY &locY)
 Store the primal values from the CoDiPack vector into the user vector.
 
template<typename VecX >
void setPrimalInputs (VecX const &locX)
 Set the primal values from the user provided vector into the CoDiPack ones.
 
- Public Member Functions inherited from codi::EvaluationHandleBase< T_Func, T_Type, T_InputStore, T_OutputStore >
template<typename VecX , typename Hes , typename VecY , typename Jac >
void computeHessian (VecX const &locX, Hes &hes, VecY &locY, Jac &jac)
 Perform a Hessian evaluation with the inputs provided in locX and store the result in hes, jac and locY.
 
template<typename VecX , typename Jac , typename VecY >
void computeJacobian (VecX const &locX, Jac &jac, VecY &locY)
 Perform a Jacobian evaluation with the inputs provided in locX and store the result in jac and locY.
 
template<typename VecX , typename VecY >
void computePrimal (VecX const &locX, VecY &locY)
 Perform a primal evaluation with the inputs provided in locX and store the result in locY.
 
 EvaluationHandleBase (Func &func, size_t m, size_t n)
 Constructor.
 

Additional Inherited Members

- Protected Member Functions inherited from codi::EvaluationHandleBase< T_Func, T_Type, T_InputStore, T_OutputStore >
void eval ()
 Helper for the evaluation of the function object with the internal input and output vector.
 
template<typename VecY >
void getPrimalOutputs (VecY &locY)
 Store the primal values from the CoDiPack vector into the user vector.
 
template<typename VecX >
void setPrimalInputs (VecX const &locX)
 Set the primal values from the user provided vector into the CoDiPack ones.
 
- Protected Attributes inherited from codi::EvaluationHandleBase< T_Func, T_Type, T_InputStore, T_OutputStore >
DummyJacobian dummyJacobian
 Used if no output is required.
 
DummyVector dummyVector
 Used if no output is required.
 
Funcfunc
 The function object for the evaluations.
 
size_t m
 Size of the output vector.
 
size_t n
 Size of the input vector.
 
InputStore x
 Storage for the input arguments.
 
OutputStore y
 Storage for the output arguments.
 

Detailed Description

template<typename T_Func, typename T_Type, typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
struct codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >

Implementation of EvaluationHandleBase for forward mode CoDiPack types.

Member Function Documentation

◆ computeHessian()

template<typename T_Func , typename T_Type , typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
template<typename VecX , typename Hes , typename VecY , typename Jac >
void codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >::computeHessian ( VecX const &  locX,
Hes &  hes,
VecY &  locY,
Jac &  jac 
)
inline

Perform a Hessian evaluation with the inputs provided in locX and store the result in hes, jac and locY.

The vectorization is performed twice over the input vector. This evaluates the Hessian in a blockwise fashion for all output values. The function object is evaluated n*n/(vecSize1 * vecSize2) times.

◆ computeJacobian()

template<typename T_Func , typename T_Type , typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
template<typename VecX , typename Jac , typename VecY >
void codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >::computeJacobian ( VecX const &  locX,
Jac &  jac,
VecY &  locY 
)
inline

Perform a Jacobian evaluation with the inputs provided in locX and store the result in jac and locY.

The vectorization is performed over the input vector. The function object is evaluated n/vecSize times.

◆ computePrimal()

template<typename T_Func , typename T_Type , typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
template<typename VecX , typename VecY >
void codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >::computePrimal ( VecX const &  locX,
VecY &  locY 
)
inline

Perform a primal evaluation with the inputs provided in locX and store the result in locY.

◆ getPrimalOutputs()

template<typename T_Func , typename T_Type , typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
template<typename VecY >
void codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >::getPrimalOutputs ( VecY &  locY)
inline

Store the primal values from the CoDiPack vector into the user vector.

◆ setPrimalInputs()

template<typename T_Func , typename T_Type , typename T_InputStore = std::vector<T_Type>, typename T_OutputStore = std::vector<T_Type>>
template<typename VecX >
void codi::EvaluationHandleForward< T_Func, T_Type, T_InputStore, T_OutputStore >::setPrimalInputs ( VecX const &  locX)
inline

Set the primal values from the user provided vector into the CoDiPack ones.


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