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)(double in[], double ou[], void *my_data), int minvars, int moutvars, void *mdata=0)
 Create the function wrapper. More...
 
virtual void Eval (ChMatrix<> &A, const ChMatrix<> &B)
 INTERFACE: Evaluate A=f(B) More...
 

Constructor & Destructor Documentation

chrono::ChFxCfunction::ChFxCfunction ( void(*)(double in[], double ou[], void *my_data)  mfunc,
int  minvars,
int  moutvars,
void *  mdata = 0 
)

Create the function wrapper.

Parameters
mfuncthe pointer to the C function
minvarsthe number of input vars (the size of double in[])
moutvarsthe number of output vars (the size of double ou[])
mdatageneric user data, if needed as my_data for C function.

Member Function Documentation

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

INTERFACE: Evaluate A=f(B)

Parameters
Aresults here
Binput here

Implements chrono::ChFx.