Public Member Functions | Protected Attributes

Allows to export code of an ACADO function. More...

#include <export_acado_function.hpp>

Inheritance diagram for ExportAcadoFunction:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual ExportStatementclone () const
 ExportAcadoFunction ()
 ExportAcadoFunction (const Function &_f, const std::string &_name="acadoFcn")
 ExportAcadoFunction (const std::string &_name)
virtual returnValue exportCode (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual returnValue exportDataDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
virtual returnValue exportForwardDeclaration (std::ostream &stream, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const
unsigned getFunctionDim (void)
ExportVariable getGlobalExportVariable () const
returnValue init (const Function &_f, const std::string &_name="acadoFcn", const uint _numX=0, const uint _numXA=0, const uint _numU=0, const uint _numP=0, const uint _numDX=0, const uint _numOD=0)
virtual bool isDefined () const
bool isExternal () const
returnValue setGlobalExportVariable (const ExportVariable &var)
virtual ~ExportAcadoFunction ()

Protected Attributes

bool external
std::tr1::shared_ptr< Functionf
ExportVariable globalVar
unsigned numDX
unsigned numOD
unsigned numP
unsigned numU
unsigned numX
unsigned numXA

Detailed Description

Allows to export code of an ACADO function.

The class ExportAcadoFunction allows to export code of an ACADO function.

Author:
Hans Joachim Ferreau, Boris Houska, Milan Vukov

Definition at line 50 of file export_acado_function.hpp.


Constructor & Destructor Documentation

Default constructor.

Definition at line 45 of file export_acado_function.cpp.

ExportAcadoFunction::ExportAcadoFunction ( const Function _f,
const std::string &  _name = "acadoFcn" 
)

Constructor which takes the differential equation to be exported as well as the name of the exported ODE.

Parameters:
[in]_fDifferential equation to be exported.
[in]_nameName of exported ODE function.

Definition at line 60 of file export_acado_function.cpp.

ExportAcadoFunction::ExportAcadoFunction ( const std::string &  _name)

Constructor which takes name of a function only.

This way, we can define an "external symbolic function" with the following prototype:

	 *  void (const real_t* in, real_t* out);
	 *  
Parameters:
[in]_nameName of exported ODE function.

Definition at line 67 of file export_acado_function.cpp.

Destructor.

Definition at line 74 of file export_acado_function.cpp.


Member Function Documentation

Clone constructor (deep copy).

Returns:
Pointer to cloned object.

Reimplemented from ExportFunction.

Definition at line 78 of file export_acado_function.cpp.

returnValue ExportAcadoFunction::exportCode ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [virtual]

Exports source code of the ODE function into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]stringName of file to be used to export function.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportFunction.

Definition at line 148 of file export_acado_function.cpp.

returnValue ExportAcadoFunction::exportDataDeclaration ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [virtual]

Exports data declaration of the ODE function into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]streamName of file to be used to export function.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportFunction.

Definition at line 111 of file export_acado_function.cpp.

returnValue ExportAcadoFunction::exportForwardDeclaration ( std::ostream &  stream,
const std::string &  _realString = "real_t",
const std::string &  _intString = "int",
int  _precision = 16 
) const [virtual]

Exports forward declaration of the ODE function into given file. Its appearance can can be adjusted by various options.

Parameters:
[in]fileName of file to be used to export statement.
[in]_realStringstd::string to be used to declare real variables.
[in]_intStringstd::string to be used to declare integer variables.
[in]_precisionNumber of digits to be used for exporting real values.
Returns:
SUCCESSFUL_RETURN

Reimplemented from ExportFunction.

Definition at line 126 of file export_acado_function.cpp.

Get output dimension of the ACADO function.

Definition at line 173 of file export_acado_function.cpp.

Set global export variable - a variable that holds intermediate values.

Definition at line 180 of file export_acado_function.cpp.

returnValue ExportAcadoFunction::init ( const Function _f,
const std::string &  _name = "acadoFcn",
const uint  _numX = 0,
const uint  _numXA = 0,
const uint  _numU = 0,
const uint  _numP = 0,
const uint  _numDX = 0,
const uint  _numOD = 0 
)

Initializes ODE function export by taking the differential equation to be exported as well as the name of the exported ODE.

Parameters:
[in]_fDifferential equation to be exported.
[in]_nameName of exported ODE function.
[in]_numXThe number of states that are needed to evaluate the system of differential equations (needed when the number of equations is not equal to the number of given states).
[in]_numXAThe number of algebraic states in the input for the evaluation of the system of equations.
[in]_numUThe number of control inputs given for the evaluation of the system of equations.
[in]_numPThe number of parameters given for the evaluation of the system of equations.
[in]_numDXThe number of differential state derivatives given for the evaluation of the system of equations.

Definition at line 83 of file export_acado_function.cpp.

bool ExportAcadoFunction::isDefined ( ) const [virtual]

Returns whether function has been defined.

Returns:
true iff function has been defined,
false otherwise

Reimplemented from ExportFunction.

Definition at line 164 of file export_acado_function.cpp.

A helper function to check whether a function is external.

Definition at line 203 of file export_acado_function.cpp.

Get global export variable - a variable that holds intermediate values.

Definition at line 185 of file export_acado_function.cpp.


Member Data Documentation

Flag indicating whether the symbolic function is external or not.

Definition at line 200 of file export_acado_function.hpp.

std::tr1::shared_ptr< Function > ExportAcadoFunction::f [protected]

ACADO function to be exported.

Definition at line 196 of file export_acado_function.hpp.

A variable that holds intermediate values.

Definition at line 198 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numDX [protected]

The number of differential state derivatives given for the evaluation of the system of equations.

Definition at line 192 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numOD [protected]

The number of "online data" objects.

Definition at line 194 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numP [protected]

The number of parameters given for the evaluation of the system of equations.

Definition at line 189 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numU [protected]

The number of control inputs given for the evaluation of the system of equations (similar to numX).

Definition at line 187 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numX [protected]

The number of states that are needed to evaluate the system of differential equations. If this number isn't specified, then it will be set to the number of equations (minus the number of algebraic states).

Definition at line 181 of file export_acado_function.hpp.

unsigned ExportAcadoFunction::numXA [protected]

The number of algebraic states in the input for the evaluation of the system of equations (similar to numX).

Definition at line 184 of file export_acado_function.hpp.


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


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:40:23