Public Member Functions | Protected Member Functions | Protected Attributes

(no description yet) More...

#include <c_function.hpp>

List of all members.

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)
CFunctionoperator= (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

Detailed Description

(no description yet)

...

Author:
Boris Houska, Hans Joachim Ferreau

Definition at line 54 of file c_function.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 48 of file c_function.cpp.

CFunction::CFunction ( uint  dim,
cFcnPtr  cFcn_ 
)

Constructor which takes a C-function pointer.

Parameters:
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.

Parameters:
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.


Member Function Documentation

returnValue CFunction::AD_backward ( double *  seed,
double *  df 
) [virtual]

Automatic Differentiation in backward mode.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
seedthe seed
dfthe 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

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberthe buffer position
seedthe seed
dfthe 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.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberthe buffer position
seed1the seed1
seed2the seed2
dfthe 1st derivative of the expression
ddfthe 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.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
xThe evaluation point x
seedthe seed
fthe value of the expression at x
dfthe 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

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberstorage position
seedthe seed
dfthe 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)

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberstorage position
xThe evaluation point x
seedthe seed
fthe value of the expression at x
dfthe 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.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberthe buffer position
seed1the seed
seed2the seed for the first derivative
dfthe derivative of the expression
ddfthe 2nd derivative of the expression

Definition at line 426 of file c_function.cpp.

Clears the buffer and resets the buffer size
to 1.

Returns:
SUCCESFUL_RETURN

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

Returns:
SUCCESSFUL_RETURN
RET_NAN
Parameters:
xthe input variable x
resultthe 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.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
xthe input variable x
resultthe result
printLthe 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)

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
numberstorage position
xthe input variable x
resultthe 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

Returns:
(void)
Parameters:
xthe input variable x
resultthe result

Definition at line 215 of file c_function.cpp.

uint CFunction::getDim ( ) const [virtual]

Returns the dimension of the symbolic expression

Returns:
The requested dimension.

Definition at line 199 of file c_function.cpp.

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.

CFunction & CFunction::operator= ( const CFunction rhs)

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.

Returns:
SUCCESFUL_RETURN
RET_NAN
Parameters:
user_data_the user-defined pointer

Definition at line 539 of file c_function.cpp.


Member Data Documentation

cFcnPtr CFunction::cFcn [protected]

Definition at line 289 of file c_function.hpp.

Definition at line 291 of file c_function.hpp.

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.

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.


The documentation for this class was generated from the following files:


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:01:37