objective_element.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_OBJECTIVE_ELEMENT_HPP
36 #define ACADO_TOOLKIT_OBJECTIVE_ELEMENT_HPP
37 
38 
41 
43 
44 
56 
57 
58  //
59  // PUBLIC MEMBER FUNCTIONS:
60  //
61  public:
62 
65 
67  ObjectiveElement( const Grid &grid_ );
68 
71 
73  virtual ~ObjectiveElement( );
74 
77 
78 
79 
80 
81 
82 // ==========================================================================
83 //
84 // INITIALIZATION
85 //
86 // ==========================================================================
87 
88 
93  inline returnValue setGrid( const Grid &grid_ );
94 
95 
96 
101  returnValue init( const OCPiterate &x );
102 
103 
104 
105 // =======================================================================================
106 //
107 // DEFINITION OF SEEDS:
108 //
109 // =======================================================================================
110 
111 
112 
118  virtual returnValue setForwardSeed( BlockMatrix *xSeed_ ,
119  BlockMatrix *xaSeed_,
120  BlockMatrix *pSeed_ ,
121  BlockMatrix *uSeed_ ,
122  BlockMatrix *wSeed_ ,
123  int order );
124 
125 
126 
132  virtual returnValue setBackwardSeed( BlockMatrix *seed,
133  int order );
134 
135 
136 
137 
138 // =======================================================================================
139 //
140 // RESULTS OF THE EVALUATION
141 //
142 // =======================================================================================
143 
144 
149  virtual returnValue getObjectiveValue( double &objectiveValue );
150 
151 
152 
161  int order );
162 
163 
164 
173  int order );
174 
175 
176 
177 
178 // =======================================================================================
179 //
180 // DIMENSIONS
181 //
182 // =======================================================================================
183 
184 
188  inline int getNX () const;
189 
193  inline int getNXA () const;
194 
198  inline int getNP () const;
199 
203  inline int getNU () const;
204 
208  inline int getNW () const;
209 
213  returnValue getFunction( Function& _function );
214 
215 
216 
217 // ==========================================================================
218 //
219 // PROTECTED MEMBER FUNCTIONS:
220 //
221 // ==========================================================================
222 
223  protected:
224 
225 
227  inline Grid getGrid() const;
228 
229 
230  //
231  // DATA MEMBERS:
232  //
233  protected:
234 
240 
241  int *y_index;
242  int t_index;
244  int nx ;
245  int na ;
246  int nu ;
247  int np ;
248  int nw ;
249  int ny ;
252  // INPUT STORAGE:
253  // ------------------------
271  // RESULTS:
272  // ------------------------
273  double obj;
278 };
279 
280 
282 
283 
284 
285 #include <acado/objective/objective_element.ipp>
286 
287 
288 #endif // ACADO_TOOLKIT_OBJECTIVE_ELEMENT_HPP
289 
290 /*
291  * end of file
292  */
Data class for storing generic optimization variables.
Definition: ocp_iterate.hpp:57
returnValue init(const OCPiterate &x)
Implements a very rudimentary block sparse matrix class.
Base class for all kind of objective function terms within optimal control problems.
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
EvaluationPoint JJ
virtual returnValue getBackwardSensitivities(BlockMatrix *D, int order)
int getNX() const
Allows to pass back messages to the calling function.
Allows to setup function evaluation points.
Allows to conveniently handle (one-dimensional) grids consisting of time points.
Definition: grid.hpp:58
#define CLOSE_NAMESPACE_ACADO
int getNW() const
Grid getGrid() const
void rhs(const real_t *x, real_t *f)
int getNXA() const
virtual returnValue getObjectiveValue(double &objectiveValue)
int getNU() const
returnValue setGrid(const Grid &grid_)
#define BEGIN_NAMESPACE_ACADO
virtual returnValue setForwardSeed(BlockMatrix *xSeed_, BlockMatrix *xaSeed_, BlockMatrix *pSeed_, BlockMatrix *uSeed_, BlockMatrix *wSeed_, int order)
virtual returnValue setBackwardSeed(BlockMatrix *seed, int order)
int getNP() const
returnValue getFunction(Function &_function)
virtual returnValue getForwardSensitivities(BlockMatrix *D, int order)
ObjectiveElement & operator=(const ObjectiveElement &rhs)


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