addition.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_ADDITION_HPP
35 #define ACADO_TOOLKIT_ADDITION_HPP
36 
37 
39 
40 
42 
43 
54 class Addition : public BinaryOperator{
55 
56 public:
57 
59  Addition();
60 
62  Addition( Operator *_argument1, Operator *_argument2 );
63 
65  Addition( const Addition &arg );
66 
68  ~Addition();
69 
71  Addition& operator=( const Addition &arg );
72 
73 
80  virtual returnValue evaluate( int number ,
81  double *x ,
82  double *result );
83 
84 
86  virtual returnValue evaluate( EvaluationBase *x );
87 
88 
94  virtual Operator* differentiate( int index );
95 
96 
97 
103  virtual Operator* AD_forward( int dim ,
104  VariableType *varType ,
105  int *component,
106  Operator **seed ,
107  int &nNewIS ,
108  TreeProjection ***newIS );
109 
110 
111 
117  virtual returnValue AD_backward( int dim ,
118  VariableType *varType ,
119  int *component,
120  Operator *seed ,
121  Operator **df ,
122  int &nNewIS ,
123  TreeProjection ***newIS );
124 
125 
126 
132  virtual returnValue AD_symmetric( int dim ,
133  VariableType *varType ,
134  int *component ,
135  Operator *l ,
136  Operator **S ,
137  int dimS ,
138  Operator **dfS ,
139  Operator **ldf ,
140  Operator **H ,
141  int &nNewLIS ,
142  TreeProjection ***newLIS ,
143  int &nNewSIS ,
144  TreeProjection ***newSIS ,
145  int &nNewHIS ,
146  TreeProjection ***newHIS );
147 
148 
149 
154  virtual Operator* substitute( int index ,
155  const Operator *sub );
156 
157 
158 
166  virtual BooleanType isLinearIn( int dim ,
167  VariableType *varType ,
168  int *component,
169  BooleanType *implicit_dep );
170 
171 
172 
179  virtual BooleanType isPolynomialIn( int dim ,
180  VariableType *varType ,
181  int *component,
182  BooleanType *implicit_dep );
183 
184 
185 
192  virtual BooleanType isRationalIn( int dim ,
193  VariableType *varType ,
194  int *component,
195  BooleanType *implicit_dep );
196 
197 
198 
199 
207 
208 
209 
217  virtual CurvatureType getCurvature( );
218 
219 
221  virtual double getValue() const;
222 
223 
230  virtual returnValue AD_forward( int number ,
231  double *seed ,
232  double *df );
234 
235 
236 
237 
245  virtual returnValue AD_forward( int number ,
246  double *x ,
248  double *seed ,
249  double *f ,
251  double *df );
253 
254 
255  // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
256  // the point x and to compute f.
257 
263  virtual returnValue AD_backward( int number ,
265  double seed ,
266  double *df );
268 
269 
270 
278  virtual returnValue AD_forward2( int number ,
280  double *seed1 ,
281  double *seed2 ,
283  double *df ,
285  double *ddf );
287 
288 
289 
290  // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
291  // the point x and to compute f and df.
292 
298  virtual returnValue AD_backward2( int number ,
300  double seed1 ,
301  double seed2 ,
302  double *df ,
304  double *ddf );
306 
307 
308 
312  virtual std::ostream& print( std::ostream &stream ) const;
313 
314 
315 
319  virtual Operator* clone() const;
320 
321 
325  virtual OperatorName getName();
326 
327 
328 //
329 // PROTECTED FUNCTIONS:
330 //
331 
332 protected:
333 
334 
335 
336 //
337 // PROTECTED MEMBERS:
338 //
339 
340 protected:
341 
342 };
343 
344 
346 
347 
348 
349 #endif
350 
OperatorName
Definition: acado_types.hpp:72
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Definition: addition.cpp:364
Abstract base class for all scalar-valued binary operators within the symbolic operators family...
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
virtual CurvatureType getCurvature()
Definition: addition.cpp:266
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: addition.cpp:214
Allows to pass back messages to the calling function.
virtual returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
Definition: addition.cpp:384
#define CLOSE_NAMESPACE_ACADO
VariableType
Definition: acado_types.hpp:95
virtual std::ostream & print(std::ostream &stream) const
Definition: addition.cpp:394
virtual returnValue AD_symmetric(int dim, VariableType *varType, int *component, Operator *l, Operator **S, int dimS, Operator **dfS, Operator **ldf, Operator **H, int &nNewLIS, TreeProjection ***newLIS, int &nNewSIS, TreeProjection ***newSIS, int &nNewHIS, TreeProjection ***newHIS)
Definition: addition.cpp:148
virtual returnValue evaluate(int number, double *x, double *result)
Definition: addition.cpp:70
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: addition.cpp:200
virtual Operator * differentiate(int index)
Definition: addition.cpp:96
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: addition.cpp:186
Implements the scalar addition operator within the symbolic expressions family.
Definition: addition.hpp:54
virtual OperatorName getName()
Definition: addition.cpp:419
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Definition: addition.cpp:107
MonotonicityType
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
Definition: addition.cpp:127
virtual Operator * substitute(int index, const Operator *sub)
Definition: addition.cpp:178
Implements the tree-projection operator within the family of SymbolicOperators.
CurvatureType
virtual Operator * clone() const
Definition: addition.cpp:408
#define BEGIN_NAMESPACE_ACADO
Abstract base class for templated evaluation of operators.
~Addition()
Definition: addition.cpp:57
Addition()
Definition: addition.cpp:45
Addition & operator=(const Addition &arg)
Definition: addition.cpp:60
virtual MonotonicityType getMonotonicity()
Definition: addition.cpp:228
virtual double getValue() const
Definition: addition.cpp:307


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