evaluation_point.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 
34 #ifndef ACADO_TOOLKIT_EVALUATION_POINT_HPP
35 #define ACADO_TOOLKIT_EVALUATION_POINT_HPP
36 
39 
40 
42 
43 
44 class Function;
45 
59 
60 friend class Function;
61 
62 //
63 // PUBLIC MEMBER FUNCTIONS:
64 //
65 
66 public:
67 
68 
71 
72 
74  EvaluationPoint( const Function &f,
75  uint nx_ = 0,
76  uint na_ = 0,
77  uint nu_ = 0,
78  uint np_ = 0,
79  uint nw_ = 0,
80  uint nd_ = 0,
81  uint N_ = 0 );
82 
83 
85  EvaluationPoint( const Function &f ,
86  const OCPiterate &iter );
87 
88 
91 
93  virtual ~EvaluationPoint( );
94 
97 
98 
111  returnValue init( const Function &f,
112  uint nx_ = 0,
113  uint na_ = 0,
114  uint np_ = 0,
115  uint nu_ = 0,
116  uint nw_ = 0,
117  uint nd_ = 0,
118  uint N_ = 0 );
119 
120 
121  returnValue init( const Function &f ,
122  const OCPiterate &iter );
123 
124 
125 
126  inline returnValue setT ( const double &t );
127  inline returnValue setX ( const DVector &x );
128  inline returnValue setXA( const DVector &xa );
129  inline returnValue setP ( const DVector &p );
130  inline returnValue setU ( const DVector &u );
131  inline returnValue setW ( const DVector &w );
132  inline returnValue setDX( const DVector &dx );
133 
134  inline returnValue setZ ( const uint &idx ,
135  const OCPiterate &iter );
136 
137  inline returnValue setZero( );
138 
139 
140  inline double getT () const;
141  inline DVector getX () const;
142  inline DVector getXA() const;
143  inline DVector getP () const;
144  inline DVector getU () const;
145  inline DVector getW () const;
146  inline DVector getDX() const;
147 
148 
156  returnValue print() const;
157 
158 
159 // PROTECTED MEMBER FUNCTIONS:
160 // ---------------------------
161 
162 protected:
163 
164  inline returnValue copy( const int *order, const DVector &rhs );
165 
166  void copy( const EvaluationPoint &rhs );
167  void deleteAll();
168 
169  void copyIdx( const uint &dim, const int *idx1, int **idx2 );
170 
171  inline DVector backCopy( const int *order, const uint &dim ) const;
172 
173  inline double* getEvaluationPointer() const;
174 
175 
176 
177 // PROTECTED MEMBERS:
178 // ------------------
179 
180 protected:
181 
182  double *z;
183  int **idx;
191  uint N ;
192 };
193 
194 
196 
197 
198 
199 #include <acado/function/evaluation_point.ipp>
200 
201 
202 #endif // ACADO_TOOLKIT_EVALUATION_POINT_HPP
203 
204 /*
205  * end of file
206  */
Data class for storing generic optimization variables.
Definition: ocp_iterate.hpp:57
Allows to setup and evaluate a general function based on SymbolicExpressions.
Definition: function_.hpp:59
void copyIdx(const uint &dim, const int *idx1, int **idx2)
double getT() const
returnValue setP(const DVector &p)
returnValue setDX(const DVector &dx)
returnValue setU(const DVector &u)
virtual ~EvaluationPoint()
Allows to pass back messages to the calling function.
returnValue print() const
DVector getP() const
returnValue setZ(const uint &idx, const OCPiterate &iter)
Allows to setup function evaluation points.
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
#define CLOSE_NAMESPACE_ACADO
returnValue setX(const DVector &x)
DVector getW() const
returnValue setW(const DVector &w)
returnValue init(const Function &f, uint nx_=0, uint na_=0, uint np_=0, uint nu_=0, uint nw_=0, uint nd_=0, uint N_=0)
DVector backCopy(const int *order, const uint &dim) const
double * getEvaluationPointer() const
EvaluationPoint & operator=(const EvaluationPoint &rhs)
returnValue copy(const int *order, const DVector &rhs)
DVector getX() const
returnValue setXA(const DVector &xa)
DVector getU() const
returnValue setT(const double &t)
returnValue setZero()
DVector getXA() const
void rhs(const real_t *x, real_t *f)
DVector getDX() const
#define BEGIN_NAMESPACE_ACADO


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