Allows to export code of an ACADO function. More...
#include <export_acado_function.hpp>
Protected Attributes | |
bool | external |
std::shared_ptr< Function > | f |
ExportVariable | globalVar |
unsigned | numDX |
unsigned | numOD |
unsigned | numP |
unsigned | numU |
unsigned | numX |
unsigned | numXA |
Protected Attributes inherited from ExportFunction | |
std::string | description |
bool | flagPrivate |
ExportArgumentList | functionArguments |
std::vector< ExportVariable > | localVariables |
MemoryAllocatorPtr | memAllocator |
std::string | name |
bool | returnAsPointer |
ExportVariable | retVal |
Protected Attributes inherited from ExportStatementBlock | |
StatementPtrArray | statements |
Additional Inherited Members | |
Public Types inherited from ExportStatement | |
typedef std::shared_ptr< MemoryAllocator > | MemoryAllocatorPtr |
typedef std::shared_ptr< ExportStatement > | StatementPtr |
typedef std::vector< StatementPtr > | StatementPtrArray |
Static Public Attributes inherited from ExportStatement | |
static std::string | fcnPrefix = "acado" |
static std::string | varPrefix = "ACADO" |
Protected Member Functions inherited from ExportFunction | |
returnValue | clear () |
Allows to export code of an ACADO function.
The class ExportAcadoFunction allows to export code of an ACADO function.
Definition at line 50 of file export_acado_function.hpp.
BEGIN_NAMESPACE_ACADO ExportAcadoFunction::ExportAcadoFunction | ( | ) |
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.
[in] | _f | Differential equation to be exported. |
[in] | _name | Name 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); *
[in] | _name | Name of exported ODE function. |
Definition at line 67 of file export_acado_function.cpp.
|
virtual |
Destructor.
Definition at line 74 of file export_acado_function.cpp.
|
virtual |
Clone constructor (deep copy).
\return Pointer to cloned object.
Reimplemented from ExportFunction.
Definition at line 78 of file export_acado_function.cpp.
|
virtual |
Exports source code of the ODE function into given file. Its appearance can can be adjusted by various options.
@param[in] string Name of file to be used to export function. @param[in] _realString std::string to be used to declare real variables. @param[in] _intString std::string to be used to declare integer variables. @param[in] _precision Number of digits to be used for exporting real values. \return SUCCESSFUL_RETURN
Reimplemented from ExportFunction.
Definition at line 148 of file export_acado_function.cpp.
|
virtual |
Exports data declaration of the ODE function into given file. Its appearance can can be adjusted by various options.
@param[in] stream Name of file to be used to export function. @param[in] _realString std::string to be used to declare real variables. @param[in] _intString std::string to be used to declare integer variables. @param[in] _precision Number of digits to be used for exporting real values. \return SUCCESSFUL_RETURN
Reimplemented from ExportFunction.
Definition at line 111 of file export_acado_function.cpp.
|
virtual |
Exports forward declaration of the ODE function into given file. Its appearance can can be adjusted by various options.
@param[in] file Name of file to be used to export statement. @param[in] _realString std::string to be used to declare real variables. @param[in] _intString std::string to be used to declare integer variables. @param[in] _precision Number of digits to be used for exporting real values. \return SUCCESSFUL_RETURN
Reimplemented from ExportFunction.
Definition at line 126 of file export_acado_function.cpp.
unsigned ExportAcadoFunction::getFunctionDim | ( | void | ) |
Get output dimension of the ACADO function.
Definition at line 173 of file export_acado_function.cpp.
ExportVariable ExportAcadoFunction::getGlobalExportVariable | ( | ) | const |
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.
[in] | _f | Differential equation to be exported. |
[in] | _name | Name of exported ODE function. |
[in] | _numX | The 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] | _numXA | The number of algebraic states in the input for the evaluation of the system of equations. |
[in] | _numU | The number of control inputs given for the evaluation of the system of equations. |
[in] | _numP | The number of parameters given for the evaluation of the system of equations. |
[in] | _numDX | The number of differential state derivatives given for the evaluation of the system of equations. |
Definition at line 83 of file export_acado_function.cpp.
|
virtual |
Returns whether function has been defined.
\return true iff function has been defined, \n false otherwise
Reimplemented from ExportFunction.
Definition at line 164 of file export_acado_function.cpp.
bool ExportAcadoFunction::isExternal | ( | ) | const |
A helper function to check whether a function is external.
Definition at line 203 of file export_acado_function.cpp.
returnValue ExportAcadoFunction::setGlobalExportVariable | ( | const ExportVariable & | var | ) |
Get global export variable - a variable that holds intermediate values.
Definition at line 185 of file export_acado_function.cpp.
|
protected |
Flag indicating whether the symbolic function is external or not.
Definition at line 200 of file export_acado_function.hpp.
|
protected |
ACADO function to be exported.
Definition at line 196 of file export_acado_function.hpp.
|
protected |
A variable that holds intermediate values.
Definition at line 198 of file export_acado_function.hpp.
|
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.
|
protected |
The number of "online data" objects.
Definition at line 194 of file export_acado_function.hpp.
|
protected |
The number of parameters given for the evaluation of the system of equations.
Definition at line 189 of file export_acado_function.hpp.
|
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.
|
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.
|
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.