chrono::ChFxCfunction Class Reference

Description

Class for A=f(B) math functions, where the function is defined by wrapping a C function of the 'old' type, i.e.

a pointer to simple C call that works over arrays of values and return array of values: double (func)(double p[], void my_data); as often used in C/C++ math libraries.

#include <ChFx.h>

Inheritance diagram for chrono::ChFxCfunction:
Collaboration diagram for chrono::ChFxCfunction:

Public Member Functions

 ChFxCfunction (void(*mfunc)(const double *in, double *out, void *my_data), int moutvars, void *mdata=nullptr)
 Create the function wrapper. More...
 
virtual void Eval (ChVectorDynamic<> &A, const ChVectorDynamic<> &B)
 Evaluate A=f(B). More...
 

Constructor & Destructor Documentation

◆ ChFxCfunction()

chrono::ChFxCfunction::ChFxCfunction ( void(*)(const double *in, double *out, void *my_data)  mfunc,
int  moutvars,
void *  mdata = nullptr 
)
inline

Create the function wrapper.

Parameters
mfuncpointer to the C function
moutvarsnumber of output vars (size of out[])
mdatauser data, passed C function.

Member Function Documentation

◆ Eval()

virtual void chrono::ChFxCfunction::Eval ( ChVectorDynamic<> &  A,
const ChVectorDynamic<> &  B 
)
inlinevirtual

Evaluate A=f(B).

Parameters
Aresult output variables here
Binput variables here

Implements chrono::ChFx.


The documentation for this class was generated from the following file:
  • /builds/uwsbel/chrono/src/chrono/core/ChFx.h