A user class for auto-generation of OCP solvers. More...
#include <ocp_export.hpp>
Public Member Functions | |
virtual returnValue | exportCode (const std::string &dirName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) |
OCPexport () | |
OCPexport (const OCP &_ocp) | |
returnValue | printDimensionsQP () |
virtual | ~OCPexport () |
Protected Member Functions | |
returnValue | checkConsistency () const |
returnValue | collectDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const |
returnValue | collectFunctionDeclarations (ExportStatementBlock &declarations) const |
returnValue | exportAcadoHeader (const std::string &_dirName, const std::string &_fileName, const std::string &_realString="real_t", const std::string &_intString="int", int _precision=16) const |
returnValue | setup () |
Protected Attributes | |
std::tr1::shared_ptr < IntegratorExport > | integrator |
OCP | ocp |
std::tr1::shared_ptr < ExportNLPSolver > | solver |
A user class for auto-generation of OCP solvers.
The class OCPexport is a user-interface to automatically generate tailored algorithms for fast model predictive control and moving horizon estimation. It takes an optimal control problem (OCP) formulation and generates code based on given user options, e.g specifying the number of integrator steps or the online QP solver.
Definition at line 57 of file ocp_export.hpp.
Default constructor.
Definition at line 48 of file ocp_export.cpp.
OCPexport::OCPexport | ( | const OCP & | _ocp | ) |
Constructor which takes OCP formulation.
[in] | _ocp | OCP formulation for code export. |
Definition at line 54 of file ocp_export.cpp.
virtual OCPexport::~OCPexport | ( | ) | [inline, virtual] |
Destructor.
Definition at line 72 of file ocp_export.hpp.
returnValue OCPexport::checkConsistency | ( | ) | const [protected] |
Checks whether OCP formulation is compatible with code export capabilities.
Definition at line 480 of file ocp_export.cpp.
returnValue OCPexport::collectDataDeclarations | ( | ExportStatementBlock & | declarations, |
ExportStruct | dataStruct = ACADO_ANY |
||
) | const [protected, virtual] |
Collects all data declarations of the auto-generated sub-modules to given list of declarations.
[in] | declarations | List of declarations. |
Implements ExportModule.
Definition at line 529 of file ocp_export.cpp.
returnValue OCPexport::collectFunctionDeclarations | ( | ExportStatementBlock & | declarations | ) | const [protected, virtual] |
Collects all function (forward) declarations of the auto-generated sub-modules to given list of declarations.
[in] | declarations | List of declarations. |
Implements ExportModule.
Definition at line 543 of file ocp_export.cpp.
returnValue OCPexport::exportAcadoHeader | ( | const std::string & | _dirName, |
const std::string & | _fileName, | ||
const std::string & | _realString = "real_t" , |
||
const std::string & | _intString = "int" , |
||
int | _precision = 16 |
||
) | const [protected, virtual] |
Exports main header file for using the exported MHE algorithm.
[in] | _dirName | Name of directory to be used to export file. |
[in] | _fileName | Name of file to be exported. |
[in] | _realString | std::string to be used to declare real variables. |
[in] | _intString | std::string to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Implements ExportModule.
Definition at line 555 of file ocp_export.cpp.
returnValue OCPexport::exportCode | ( | const std::string & | dirName, |
const std::string & | _realString = "real_t" , |
||
const std::string & | _intString = "int" , |
||
int | _precision = 16 |
||
) | [virtual] |
Exports all files of the auto-generated code into the given directory.
[in] | dirName | Name of directory to be used to export files. |
[in] | _realString | std::string to be used to declare real variables. |
[in] | _intString | std::string to be used to declare integer variables. |
[in] | _precision | Number of digits to be used for exporting real values. |
Implements ExportModule.
Definition at line 62 of file ocp_export.cpp.
Prints dimensions (i.e. number of variables and constraints) of underlying QP.
Definition at line 315 of file ocp_export.cpp.
returnValue OCPexport::setup | ( | ) | [protected] |
Sets-up code export and initializes underlying export modules.
Definition at line 327 of file ocp_export.cpp.
std::tr1::shared_ptr< IntegratorExport > OCPexport::integrator [protected] |
Shared pointer to a tailored integrator.
Definition at line 162 of file ocp_export.hpp.
OCP OCPexport::ocp [protected] |
Internal copy of the OCP object.
Definition at line 168 of file ocp_export.hpp.
std::tr1::shared_ptr< ExportNLPSolver > OCPexport::solver [protected] |
Shared pointer to an NLP solver.
Definition at line 165 of file ocp_export.hpp.