Allows to export automatically generated algorithms for fast model predictive control. More...
#include <export_algorithm.hpp>
Public Member Functions | |
ExportAlgorithm (UserInteraction *_userInteraction=0, const std::string &_commonHeaderName=std::string()) | |
virtual returnValue | getCode (ExportStatementBlock &code)=0 |
virtual returnValue | getDataDeclarations (ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const =0 |
virtual returnValue | getFunctionDeclarations (ExportStatementBlock &declarations) const =0 |
uint | getN () const |
uint | getNDX () const |
uint | getNOD () const |
uint | getNP () const |
uint | getNU () const |
uint | getNX () const |
uint | getNXA () const |
uint | getNY () const |
uint | getNYN () const |
returnValue | setDimensions (uint _NX=0, uint _NU=0, uint _NP=0, uint _NI=0, uint _NOD=0) |
returnValue | setDimensions (uint _NX, uint _NDX, uint _NXA, uint _NU, uint _NP, uint _NI, uint _NOD) |
void | setNY (uint NY_) |
void | setNYN (uint NYN_) |
virtual returnValue | setup () |
virtual | ~ExportAlgorithm () |
Protected Attributes | |
std::string | commonHeaderName |
uint | N |
uint | NDX |
uint | NOD |
uint | NP |
uint | NU |
uint | NX |
uint | NXA |
uint | NY |
uint | NYN |
Allows to export automatically generated algorithms for fast model predictive control.
The class ExportAlgorithm allows to export automatically generated algorithms for fast model predictive control.
Definition at line 61 of file export_algorithm.hpp.
BEGIN_NAMESPACE_ACADO ExportAlgorithm::ExportAlgorithm | ( | UserInteraction * | _userInteraction = 0 , |
const std::string & | _commonHeaderName = std::string() |
||
) |
Default constructor.
[in] | _userInteraction | Pointer to corresponding user interface. |
[in] | _commonHeaderName | Name of common header file to be included. |
Definition at line 45 of file export_algorithm.cpp.
ExportAlgorithm::~ExportAlgorithm | ( | ) | [virtual] |
Destructor.
Definition at line 54 of file export_algorithm.cpp.
virtual returnValue ExportAlgorithm::getCode | ( | ExportStatementBlock & | code | ) | [pure virtual] |
Exports source code of the auto-generated algorithm into the given directory.
[in] | code | Code block containing the auto-generated algorithm. |
Implemented in IntegratorExport, ImplicitRungeKuttaExport, DiscreteTimeExport, ExportLinearSolver, ExplicitRungeKuttaExport, RungeKuttaExport, ExportNLPSolver, ForwardIRKExport, ExportCholeskySolver, ThreeSweepsERKExport, AdjointERKExport, ExportGaussElim, ExportHouseholderQR, ExportCholeskyDecomposition, ExportGaussNewtonForces, ExportGaussNewtonQpDunes, ExportGaussNewtonCondensed, ExportGaussNewtonQpDunes2, ExportGaussNewtonHpmpc, ExportGaussNewtonCn2Factorization, ExportGaussNewtonCN2, and ExportExactHessianQpDunes.
virtual returnValue ExportAlgorithm::getDataDeclarations | ( | ExportStatementBlock & | declarations, |
ExportStruct | dataStruct = ACADO_ANY |
||
) | const [pure virtual] |
Adds all data declarations of the auto-generated algorithm to given list of declarations.
[in] | declarations | List of declarations. |
Implemented in IntegratorExport, ImplicitRungeKuttaExport, DiscreteTimeExport, ExportLinearSolver, ExplicitRungeKuttaExport, RungeKuttaExport, NARXExport, ExportNLPSolver, ThreeSweepsERKExport, AdjointERKExport, ForwardIRKExport, ExportCholeskySolver, ExportCholeskyDecomposition, ExportGaussElim, ExportHouseholderQR, ExportGaussNewtonForces, ExportGaussNewtonQpDunes, ExportGaussNewtonCondensed, ExportGaussNewtonQpDunes2, ExportGaussNewtonHpmpc, ExportGaussNewtonCn2Factorization, and ExportGaussNewtonCN2.
virtual returnValue ExportAlgorithm::getFunctionDeclarations | ( | ExportStatementBlock & | declarations | ) | const [pure virtual] |
Adds all function (forward) declarations of the auto-generated algorithm to given list of declarations.
[in] | declarations | List of declarations. |
Implemented in IntegratorExport, ImplicitRungeKuttaExport, DiscreteTimeExport, ExportLinearSolver, ExplicitRungeKuttaExport, RungeKuttaExport, ExportNLPSolver, ForwardIRKExport, ExportCholeskySolver, ExportCholeskyDecomposition, ExportGaussElim, ExportHouseholderQR, ExportGaussNewtonForces, ExportGaussNewtonQpDunes, ExportGaussNewtonCondensed, ExportGaussNewtonQpDunes2, ExportGaussNewtonHpmpc, ExportGaussNewtonCn2Factorization, ExportGaussNewtonCN2, ExportExactHessianQpDunes, and ExportExactHessianCN2.
uint ExportAlgorithm::getN | ( | ) | const |
Returns number of control intervals.
Definition at line 128 of file export_algorithm.cpp.
uint ExportAlgorithm::getNDX | ( | ) | const |
Returns the number of differential states derivatives.
uint ExportAlgorithm::getNOD | ( | ) | const |
Returns number of parameters.
Definition at line 122 of file export_algorithm.cpp.
uint ExportAlgorithm::getNP | ( | ) | const |
Returns number of parameters.
Definition at line 117 of file export_algorithm.cpp.
uint ExportAlgorithm::getNU | ( | ) | const |
Returns number of control inputs.
Definition at line 111 of file export_algorithm.cpp.
uint ExportAlgorithm::getNX | ( | ) | const |
Returns number of differential states.
Definition at line 99 of file export_algorithm.cpp.
uint ExportAlgorithm::getNXA | ( | ) | const |
Returns number of algebraic states.
Definition at line 105 of file export_algorithm.cpp.
uint ExportAlgorithm::getNY | ( | ) | const |
Definition at line 138 of file export_algorithm.cpp.
uint ExportAlgorithm::getNYN | ( | ) | const |
Definition at line 148 of file export_algorithm.cpp.
returnValue ExportAlgorithm::setDimensions | ( | uint | _NX = 0 , |
uint | _NU = 0 , |
||
uint | _NP = 0 , |
||
uint | _NI = 0 , |
||
uint | _NOD = 0 |
||
) |
Sets the variables dimensions (ODE).
[in] | _NX | New number of differential states. |
[in] | _NU | New number of control inputs. |
[in] | _NP | New number of parameters. |
[in] | _NI | New number of control intervals. (using _N resulted in a strange error when compiling with cygwin!) |
Definition at line 65 of file export_algorithm.cpp.
returnValue ExportAlgorithm::setDimensions | ( | uint | _NX, |
uint | _NDX, | ||
uint | _NXA, | ||
uint | _NU, | ||
uint | _NP, | ||
uint | _NI, | ||
uint | _NOD | ||
) |
Sets the variables dimensions (DAE).
[in] | _NX | New number of differential states. |
[in] | _NDX | New number of differential states derivatives. |
[in] | _NXA | New number of algebraic states. |
[in] | _NU | New number of control inputs. |
[in] | _NP | New number of parameters. |
[in] | _NI | New number of control intervals. |
Definition at line 77 of file export_algorithm.cpp.
void ExportAlgorithm::setNY | ( | uint | NY_ | ) |
Definition at line 133 of file export_algorithm.cpp.
void ExportAlgorithm::setNYN | ( | uint | NYN_ | ) |
Definition at line 143 of file export_algorithm.cpp.
returnValue ExportAlgorithm::setup | ( | ) | [virtual] |
Initializes code export into given file.
Reimplemented in DiagonallyImplicitRKExport, ThreeSweepsERKExport, AdjointERKExport, ForwardOverBackwardERKExport, IntegratorExport, ImplicitRungeKuttaExport, ForwardIRKExport, DiscreteTimeExport, RungeKuttaExport, ExportCholeskySolver, ExplicitRungeKuttaExport, NARXExport, ExportLinearSolver, ExportNLPSolver, ExportCholeskyDecomposition, ExportGaussElim, ExportHouseholderQR, ExportGaussNewtonForces, ExportGaussNewtonQpDunes, ExportExactHessianQpDunes, ExportGaussNewtonCondensed, ExportGaussNewtonQpDunes2, ExportGaussNewtonHpmpc, ExportExactHessianCN2, ExportGaussNewtonCn2Factorization, and ExportGaussNewtonCN2.
Definition at line 58 of file export_algorithm.cpp.
std::string ExportAlgorithm::commonHeaderName [protected] |
Name of common header file.
Definition at line 217 of file export_algorithm.hpp.
uint ExportAlgorithm::N [protected] |
Number of control intervals.
Definition at line 212 of file export_algorithm.hpp.
uint ExportAlgorithm::NDX [protected] |
Number of differential states derivatives.
Definition at line 207 of file export_algorithm.hpp.
uint ExportAlgorithm::NOD [protected] |
Number of "online data" values.
Definition at line 211 of file export_algorithm.hpp.
uint ExportAlgorithm::NP [protected] |
Number of parameters.
Definition at line 210 of file export_algorithm.hpp.
uint ExportAlgorithm::NU [protected] |
Number of control inputs.
Definition at line 209 of file export_algorithm.hpp.
uint ExportAlgorithm::NX [protected] |
Number of differential states.
Definition at line 206 of file export_algorithm.hpp.
uint ExportAlgorithm::NXA [protected] |
Number of algebraic states.
Definition at line 208 of file export_algorithm.hpp.
uint ExportAlgorithm::NY [protected] |
Number of references/measurements, nodes 0,..., N - 1.
Definition at line 214 of file export_algorithm.hpp.
uint ExportAlgorithm::NYN [protected] |
Number of references/measurements, node N.
Definition at line 215 of file export_algorithm.hpp.