(no description yet) More...
#include <c_function.hpp>
Public Member Functions | |
| virtual returnValue | AD_backward (double *seed, double *df) |
| virtual returnValue | AD_backward (int number, double *seed, double *df) |
| virtual returnValue | AD_backward2 (int number, double *seed1, double *seed2, double *df, double *ddf) |
| virtual returnValue | AD_forward (double *x, double *seed, double *f, double *df) |
| virtual returnValue | AD_forward (int number, double *seed, double *df) |
| virtual returnValue | AD_forward (int number, double *x, double *seed, double *f, double *df) |
| virtual returnValue | AD_forward2 (int number, double *seed1, double *seed2, double *df, double *ddf) |
| CFunction () | |
| CFunction (uint dim, cFcnPtr cFcn_) | |
| CFunction (uint dim, cFcnPtr cFcn_, cFcnDPtr cFcnDForward_, cFcnDPtr cFcnDBackward_) | |
| CFunction (const CFunction &rhs) | |
| virtual returnValue | clearBuffer () |
| virtual returnValue | evaluate (double *x, double *result) |
| virtual returnValue | evaluate (double *x, double *result, PrintLevel printL) |
| virtual returnValue | evaluate (int number, double *x, double *result) |
| virtual void | evaluateCFunction (double *x, double *result) |
| virtual uint | getDim () const |
| virtual Expression | operator() (const Expression &arg) |
| CFunction & | operator= (const CFunction &rhs) |
| virtual returnValue | setUserData (void *user_data_) |
| virtual | ~CFunction () |
Protected Member Functions | |
| void | copy (const CFunction &arg) |
| void | deleteAll () |
| returnValue | initialize () |
Protected Attributes | |
| cFcnPtr | cFcn |
| cFcnDPtr | cFcnDBackward |
| cFcnDPtr | cFcnDForward |
| uint | dim |
| uint | maxAlloc |
| uint | nn |
| double ** | seedStore |
| void * | user_data |
| double ** | xStore |
Default constructor.
Definition at line 48 of file c_function.cpp.
| CFunction::CFunction | ( | uint | dim, |
| cFcnPtr | cFcn_ | ||
| ) |
Constructor which takes a C-function pointer.
| cFcn_ | function pointer |
Definition at line 61 of file c_function.cpp.
| CFunction::CFunction | ( | uint | dim, |
| cFcnPtr | cFcn_, | ||
| cFcnDPtr | cFcnDForward_, | ||
| cFcnDPtr | cFcnDBackward_ | ||
| ) |
Constructor which takes a C-function pointer as well as
function pointers for the corresponding derivatives.
| cFcnDForward_ | function pointer |
| cFcnDBackward_ | function pointer to forward derivatives function pointer to backward derivatives |
Definition at line 74 of file c_function.cpp.
| CFunction::CFunction | ( | const CFunction & | rhs | ) |
Copy constructor (deep copy).
Definition at line 90 of file c_function.cpp.
| CFunction::~CFunction | ( | ) | [virtual] |
Destructor.
Definition at line 91 of file c_function.cpp.
| returnValue CFunction::AD_backward | ( | double * | seed, |
| double * | df | ||
| ) | [virtual] |
Automatic Differentiation in backward mode.
| seed | the seed |
| df | the derivative of the expression |
Definition at line 398 of file c_function.cpp.
| returnValue CFunction::AD_backward | ( | int | number, |
| double * | seed, | ||
| double * | df | ||
| ) | [virtual] |
Automatic Differentiation in backward mode based on
buffered values
| number | the buffer position |
| seed | the seed |
| df | the derivative of the expression |
Definition at line 404 of file c_function.cpp.
| returnValue CFunction::AD_backward2 | ( | int | number, |
| double * | seed1, | ||
| double * | seed2, | ||
| double * | df, | ||
| double * | ddf | ||
| ) | [virtual] |
Automatic Differentiation in backward mode for 2nd order
derivatives based on buffered values.
| number | the buffer position |
| seed1 | the seed1 |
| seed2 | the seed2 |
| df | the 1st derivative of the expression |
| ddf | the 2nd derivative of the expression |
Definition at line 513 of file c_function.cpp.
| returnValue CFunction::AD_forward | ( | double * | x, |
| double * | seed, | ||
| double * | f, | ||
| double * | df | ||
| ) | [virtual] |
Automatic Differentiation in forward mode.
| x | The evaluation point x |
| seed | the seed |
| f | the value of the expression at x |
| df | the derivative of the expression |
Definition at line 267 of file c_function.cpp.
| returnValue CFunction::AD_forward | ( | int | number, |
| double * | seed, | ||
| double * | df | ||
| ) | [virtual] |
Automatic Differentiation in forward mode.
This function uses the intermediate
results from a buffer
| number | storage position |
| seed | the seed |
| df | the derivative of the expression |
Definition at line 351 of file c_function.cpp.
| returnValue CFunction::AD_forward | ( | int | number, |
| double * | x, | ||
| double * | seed, | ||
| double * | f, | ||
| double * | df | ||
| ) | [virtual] |
Automatic Differentiation in forward mode.
This function stores the intermediate
results in a buffer (needed for 2nd order automatic
differentiation in backward mode)
| number | storage position |
| x | The evaluation point x |
| seed | the seed |
| f | the value of the expression at x |
| df | the derivative of the expression |
Definition at line 300 of file c_function.cpp.
| returnValue CFunction::AD_forward2 | ( | int | number, |
| double * | seed1, | ||
| double * | seed2, | ||
| double * | df, | ||
| double * | ddf | ||
| ) | [virtual] |
Automatic Differentiation in forward mode for
2nd derivatives.
This function uses intermediate
results from a buffer.
| number | the buffer position |
| seed1 | the seed |
| seed2 | the seed for the first derivative |
| df | the derivative of the expression |
| ddf | the 2nd derivative of the expression |
Definition at line 426 of file c_function.cpp.
| returnValue CFunction::clearBuffer | ( | ) | [virtual] |
Clears the buffer and resets the buffer size
to 1.
Definition at line 518 of file c_function.cpp.
| void CFunction::copy | ( | const CFunction & | arg | ) | [protected] |
Protected copy routine.
Definition at line 118 of file c_function.cpp.
| void CFunction::deleteAll | ( | ) | [protected] |
Protected delete routine.
Definition at line 156 of file c_function.cpp.
| returnValue CFunction::evaluate | ( | double * | x, |
| double * | result | ||
| ) | [virtual] |
Evaluates the expression
| x | the input variable x |
| result | the result |
Definition at line 205 of file c_function.cpp.
| returnValue CFunction::evaluate | ( | double * | x, |
| double * | result, | ||
| PrintLevel | printL | ||
| ) | [virtual] |
Evaluates the expression and also prints
the intermediate results with a specified
print level.
| x | the input variable x |
| result | the result |
| printL | the print level |
Definition at line 223 of file c_function.cpp.
| returnValue CFunction::evaluate | ( | int | number, |
| double * | x, | ||
| double * | result | ||
| ) | [virtual] |
Evaluates the expression and stores the intermediate
results in a buffer (needed for automatic differentiation
in backward mode)
| number | storage position |
| x | the input variable x |
| result | the result |
Definition at line 239 of file c_function.cpp.
| void CFunction::evaluateCFunction | ( | double * | x, |
| double * | result | ||
| ) | [virtual] |
Possible user implementation of a C function
| x | the input variable x |
| result | the result |
Definition at line 215 of file c_function.cpp.
| uint CFunction::getDim | ( | ) | const [virtual] |
Returns the dimension of the symbolic expression
Definition at line 199 of file c_function.cpp.
| returnValue CFunction::initialize | ( | ) | [protected] |
Initializes the CFunction
Definition at line 103 of file c_function.cpp.
| Expression CFunction::operator() | ( | const Expression & | arg | ) | [virtual] |
Loading Expressions (deep copy).
Definition at line 169 of file c_function.cpp.
Assignment operator (deep copy).
Definition at line 93 of file c_function.cpp.
| returnValue CFunction::setUserData | ( | void * | user_data_ | ) | [virtual] |
Specify a pointer to be passed to the c-function
during every call.
This pointer can e.g. point to to measurements,
to an object of any class or to a struct.
| user_data_ | the user-defined pointer |
Definition at line 539 of file c_function.cpp.
cFcnPtr CFunction::cFcn [protected] |
Definition at line 289 of file c_function.hpp.
cFcnDPtr CFunction::cFcnDBackward [protected] |
Definition at line 291 of file c_function.hpp.
cFcnDPtr CFunction::cFcnDForward [protected] |
Definition at line 290 of file c_function.hpp.
uint CFunction::dim [protected] |
size of the function (output)
Definition at line 298 of file c_function.hpp.
uint CFunction::maxAlloc [protected] |
actual memory allocation
Definition at line 300 of file c_function.hpp.
uint CFunction::nn [protected] |
size of the argument (input)
Definition at line 297 of file c_function.hpp.
double** CFunction::seedStore [protected] |
storage of evaluation seeds
Definition at line 302 of file c_function.hpp.
void* CFunction::user_data [protected] |
pointer specified by the setUserData function, passed to the c function when being called
Definition at line 294 of file c_function.hpp.
double** CFunction::xStore [protected] |
storage of evaluation variables
Definition at line 301 of file c_function.hpp.