export_nlp_solver.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of ACADO Toolkit.
3  *
4  * ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
5  * Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
6  * Milan Vukov, Rien Quirynen, KU Leuven.
7  * Developed within the Optimization in Engineering Center (OPTEC)
8  * under supervision of Moritz Diehl. All rights reserved.
9  *
10  * ACADO Toolkit is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU Lesser General Public
12  * License as published by the Free Software Foundation; either
13  * version 3 of the License, or (at your option) any later version.
14  *
15  * ACADO Toolkit is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18  * Lesser General Public License for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public
21  * License along with ACADO Toolkit; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23  *
24  */
25 
32 #ifndef ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP
33 #define ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP
34 
37 
40 
43 
45 
46 class OCP;
47 class Objective;
48 
63 {
64 public:
65 
71  ExportNLPSolver( UserInteraction* _userInteraction = 0,
72  const std::string& _commonHeaderName = ""
73  );
74 
76  virtual ~ExportNLPSolver( )
77  {}
78 
83  virtual returnValue setup( ) = 0;
84 
85 
93  );
94 
101  returnValue setLevenbergMarquardt( double _levenbergMarquardt
102  );
103 
104 
113  ExportStruct dataStruct = ACADO_ANY
114  ) const;
115 
124  ) const = 0;
125 
126 
135  ) = 0;
136 
137 
142  virtual unsigned getNumQPvars( ) const = 0;
143 
149  bool performsSingleShooting( ) const;
150 
157  returnValue setObjective(const Objective& _objective);
158  returnValue setLSQObjective(const Objective& _objective);
159  returnValue setGeneralObjective(const Objective& _objective);
160 
164  returnValue setConstraints(const OCP& _ocp);
165 
169  unsigned getNumComplexConstraints( void );
170 
174  unsigned getNumPathConstraints( void );
175 
178  unsigned weightingMatricesType( void ) const;
179 
181  bool initialStateFixed( ) const;
182 
184  bool usingLinearTerms() const;
185 
186 protected:
187 
194  virtual returnValue setupSimulation( void );
195 
200  virtual returnValue setupVariables( ) = 0;
201 
207 
209  virtual returnValue setupEvaluation( ) = 0;
210 
213 
216 
218  virtual returnValue setupGetObjective();
219 
222 
225 
228 
231 
232 protected:
233 
239 
241 
248 
249  ExportVariable evGx; // stack of sensitivities w.r.t. x
250  ExportVariable evGu; // stack of sensitivities w.r.t. u
251 
259 
261 
262  // lagrange multipliers
264 
268 
272 
277 
279 
281 
292  unsigned dimPacH;
297 
299 
307  unsigned dimPocH;
308  std::vector< std::shared_ptr< ExportAcadoFunction > > evaluatePointConstraints;
310 
311  std::vector< DVector > pocLbStack, pocUbStack;
312 
322 
332 
335 
337 
339  // acWL and acVL are assumed to be upper triangular matrices
341 
342  // Older stuff; TODO make this more unique
344 
349 private:
352 };
353 
356 {
368 };
369 
372 
374 typedef std::shared_ptr< ExportNLPSolver > ExportNLPSolverPtr;
375 
377 
378 #endif // ACADO_TOOLKIT_EXPORT_NLP_SOLVER_HPP
ExportVariable acHTilde
ExportVariable acTmp
ExportVariable objEvFx
virtual returnValue setupMultiplicationRoutines()=0
ExportVariable conValueOut
virtual returnValue setup()=0
ExportVariable acXu
ExportVariable objS
virtual returnValue getDataDeclarations(ExportStatementBlock &declarations, ExportStruct dataStruct=ACADO_ANY) const
ExportVariable objSlu
IntegratorExportPtr integrator
ExportVariable DxAC
ExportFunction shiftStates
ExportVariable pacEvHx
std::shared_ptr< IntegratorExport > IntegratorExportPtr
Factory for creation of exported algorithms.
returnValue setupArrivalCostCalculation()
virtual returnValue setupVariables()=0
ExportVariable pocEvH
bool initialStateFixed() const
VariablesGrid xBounds
ExportVariable pocEvHx
returnValue setLevenbergMarquardt(double _levenbergMarquardt)
Allows to export code of an ACADO function.
virtual returnValue setupGetLSQObjective()
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
ExportVariable conValueIn
ExportVariable objEvFxx
ExportVariable pacEvHu
std::vector< DVector > pocLbStack
returnValue setLSQObjective(const Objective &_objective)
returnValue setConstraints(const OCP &_ocp)
ExportVariable objEvFxEnd
ExportVariable acP
ExportVariable xAC
VariablesGrid uBounds
A class for exporting a function for calculation of the Cholesky decomposition.
ExportVariable objSlx
#define CLOSE_NAMESPACE_ACADO
ExportVariable acWL
ExportVariable objg
ExportVariable DyN
ExportVariable state
ExportVariable evGx
ExportVariable acA
unsigned weightingMatricesType(void) const
std::shared_ptr< ExportNLPSolver > ExportNLPSolverPtr
Base class for export of NLP/OCP solvers.
ExportAcadoFunction evaluateStageCost
ExportAlgorithmFactory< ExportNLPSolver, ExportNLPType > NLPSolverFactory
ExportVariable acXTilde
ExportVariable acb
Allows to export automatically generated algorithms for fast model predictive control.
virtual returnValue getFunctionDeclarations(ExportStatementBlock &declarations) const =0
ExportAcadoFunction evaluateTerminalCost
bool usingLinearTerms() const
ExportFunction regularization
virtual returnValue setupEvaluation()=0
virtual returnValue setupInitialization()
virtual returnValue setupGetObjective()
ExportFunction updateArrivalCost
ExportStruct
ExportFunction modelSimulation
ExportVariable acVL
ExportVariable objEvFxxEnd
unsigned getNumPathConstraints(void)
ExportCholeskyDecomposition cholSAC
ExportFunction getObjective
virtual returnValue setupGetGeneralObjective()
ExportVariable objValueIn
ExportFunction initializeNodes
ExportVariable acHx
ExportVariable pacEvHxd
bool performsSingleShooting() const
ExportVariable QN2
virtual returnValue setupSimulation(void)
ExportVariable QN1
std::vector< std::shared_ptr< ExportAcadoFunction > > evaluatePointConstraints
Encapsulates all user interaction for setting options, logging data and plotting results.
Data class for defining optimal control problems.
Definition: ocp.hpp:89
Allows to export code of an arbitrary function.
ExportFunction shiftControls
ExportVariable SAC
returnValue setGeneralObjective(const Objective &_objective)
virtual returnValue getCode(ExportStatementBlock &code)=0
ExportAcadoFunction evaluatePathConstraints
returnValue setupObjectiveLinearTerms(const Objective &_objective)
returnValue setIntegratorExport(IntegratorExportPtr const _integrator)
ExportVariable acHu
ExportVariable conAuxVar
ExportVariable objEvFuu
ExportVariable objAuxVar
ExportNLPSolver(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
ExportVariable objEvFxu
ExportHouseholderQR acSolver
ExportVariable evGu
ExportVariable objSEndTerm
returnValue setupAuxiliaryFunctions()
virtual ~ExportNLPSolver()
unsigned getNumComplexConstraints(void)
#define BEGIN_NAMESPACE_ACADO
Allows to export Householder QR Factorization for solving linear systems of specific dimensions...
ExportVariable pocEvHxd
std::vector< DVector > pocUbStack
returnValue setObjective(const Objective &_objective)
ExportVariable objEvFu
returnValue setupResidualVariables()
virtual returnValue setupConstraintsEvaluation()=0
virtual unsigned getNumQPvars() const =0
ExportVariable pacEvH
ExportCholeskyDecomposition cholObjS
ExportVariable pocEvHu
ExportVariable pacEvDDH
Allows to export code for a block of statements.
ExportFunction initialize
ExportVariable objValueOut
ExportVariable acXx
Stores and evaluates the objective function of optimal control problems.
Definition: objective.hpp:123
ExportFunction regularizeHessian
Defines a matrix-valued variable to be used for exporting code.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Mon Jun 10 2019 12:34:34