dirk_export.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 
26 
27 
35 #ifndef ACADO_TOOLKIT_DIRK_EXPORT_HPP
36 #define ACADO_TOOLKIT_DIRK_EXPORT_HPP
37 
39 
40 
42 
43 
55 {
56  //
57  // PUBLIC MEMBER FUNCTIONS:
58  //
59 
60  public:
61 
67  DiagonallyImplicitRKExport( UserInteraction* _userInteraction = 0,
68  const std::string& _commonHeaderName = ""
69  );
70 
76  );
77 
80  virtual ~DiagonallyImplicitRKExport( );
81 
82 
88  );
89 
90 
101  const ExportIndex& index1,
102  const ExportIndex& index2,
103  const ExportIndex& index3,
104  const ExportIndex& tmp_index,
105  const ExportVariable& Ah );
106 
107 
115 
116 
126  const ExportIndex& index1,
127  const ExportIndex& index2,
128  const ExportIndex& index3,
129  const ExportIndex& tmp_index,
130  const ExportVariable& Ah,
131  bool DERIVATIVES = false );
132 
133 
145  const ExportIndex& index1,
146  const ExportIndex& index2,
147  const ExportIndex& index3,
148  const ExportIndex& index4,
149  const ExportIndex& tmp_index1,
150  const ExportIndex& tmp_index2,
151  const ExportVariable& Ah,
152  const ExportVariable& Bh,
153  bool STATES,
154  uint number );
155 
156 
164 
165 
173  virtual DMatrix formMatrix( const DMatrix& mass, const DMatrix& jacobian );
174 
175 
185  const ExportIndex& index1,
186  const ExportIndex& index2,
187  const ExportIndex& index3,
188  const ExportIndex& tmp_index,
189  const ExportVariable& Ah,
190  const ExportVariable& C,
191  const ExportVariable& det,
192  bool DERIVATIVES = false );
193 
194 
207  const ExportIndex& index1,
208  const ExportIndex& index2,
209  const ExportIndex& index3,
210  const ExportIndex& tmp_index1,
211  const ExportIndex& tmp_index2,
212  const ExportVariable& Ah,
213  const ExportVariable& Bh,
214  const ExportVariable& det,
215  bool STATES,
216  uint number );
217 
218 
231  const ExportIndex& index1,
232  const ExportIndex& index2,
233  const ExportIndex& tmp_index,
234  const ExportVariable& _rk_A,
235  const ExportVariable& Ah,
236  const ExportVariable& C,
237  bool evaluateB,
238  bool DERIVATIVES );
239 
240 
250  const ExportVariable& Ah,
251  const ExportVariable& C,
252  const ExportIndex& stage,
253  const ExportIndex& i,
254  const ExportIndex& j );
255 
256 
265  const ExportIndex& stage );
266 
267 
272  virtual returnValue setup( );
273 
274 
275  protected:
276 
277 
278 
279  protected:
280 
281 
282 };
283 
284 
285 //
286 // Create the integrator
287 //
289  const std::string &_commonHeaderName )
290 {
291  int sensGen;
292  _userInteraction->get( DYNAMIC_SENSITIVITY, sensGen );
293  if ( (ExportSensitivityType)sensGen == FORWARD ) {
294  return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName);
295  }
296  else {
298  return new DiagonallyImplicitRKExport(_userInteraction, _commonHeaderName);
299  }
300 }
301 
302 
304 
305 
306 #endif // ACADO_TOOLKIT_DIRK_EXPORT_HPP
307 
308 // end of file.
virtual returnValue solveOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportVariable &Ah, bool DERIVATIVES=false)
DiagonallyImplicitRKExport * createDiagonallyImplicitRKExport(UserInteraction *_userInteraction, const std::string &_commonHeaderName)
virtual returnValue sensitivitiesOutputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &index4, const ExportIndex &tmp_index1, const ExportIndex &tmp_index2, const ExportVariable &Ah, const ExportVariable &Bh, bool STATES, uint number)
DiagonallyImplicitRKExport(UserInteraction *_userInteraction=0, const std::string &_commonHeaderName="")
Definition: dirk_export.cpp:48
virtual returnValue evaluateMatrix(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &tmp_index, const ExportVariable &_rk_A, const ExportVariable &Ah, const ExportVariable &C, bool evaluateB, bool DERIVATIVES)
returnValue get(OptionsName name, int &value) const
Definition: options.cpp:69
Allows to pass back messages to the calling function.
Block< Derived > block(Index startRow, Index startCol, Index blockRows, Index blockCols)
Definition: BlockMethods.h:56
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
virtual returnValue setup()
#define CLOSE_NAMESPACE_ACADO
DiagonallyImplicitRKExport & operator=(const DiagonallyImplicitRKExport &arg)
Definition: dirk_export.cpp:71
Defines a scalar-valued index variable to be used for exporting code.
virtual returnValue evaluateStatesImplicitSystem(ExportStatementBlock *block, const ExportVariable &Ah, const ExportVariable &C, const ExportIndex &stage, const ExportIndex &i, const ExportIndex &j)
virtual ~DiagonallyImplicitRKExport()
Definition: dirk_export.cpp:61
Expression jacobian(const Expression &arg1, const Expression &arg2)
virtual DMatrix formMatrix(const DMatrix &mass, const DMatrix &jacobian)
virtual returnValue solveInputSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportVariable &Ah)
Definition: dirk_export.cpp:81
virtual returnValue solveImplicitSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index, const ExportVariable &Ah, const ExportVariable &C, const ExportVariable &det, bool DERIVATIVES=false)
Encapsulates all user interaction for setting options, logging data and plotting results.
virtual returnValue evaluateRhsImplicitSystem(ExportStatementBlock *block, const ExportIndex &stage)
#define BEGIN_NAMESPACE_ACADO
virtual returnValue prepareInputSystem(ExportStatementBlock &code)
Allows to export a tailored implicit Runge-Kutta integrator with forward sensitivity generation for f...
virtual returnValue prepareOutputSystem(ExportStatementBlock &code)
Allows to export code for a block of statements.
virtual returnValue sensitivitiesImplicitSystem(ExportStatementBlock *block, const ExportIndex &index1, const ExportIndex &index2, const ExportIndex &index3, const ExportIndex &tmp_index1, const ExportIndex &tmp_index2, const ExportVariable &Ah, const ExportVariable &Bh, const ExportVariable &det, bool STATES, uint number)
#define ACADOERROR(retval)
Defines a matrix-valued variable to be used for exporting code.
Allows to export a tailored diagonally implicit Runge-Kutta integrator for fast model predictive cont...
Definition: dirk_export.hpp:54


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