product.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_PRODUCT_HPP
36 #define ACADO_TOOLKIT_PRODUCT_HPP
37 
38 
40 
41 
43 
44 
55 class Product : public BinaryOperator{
56 
57 public:
58 
60  Product();
61 
63  Product( Operator *_argument1, Operator *_argument2 );
64 
66  Product( const Product &arg );
67 
69  ~Product();
70 
72  Product& operator=( const Product &arg );
73 
74 
75 
82  virtual returnValue evaluate( int number ,
83  double *x ,
84  double *result );
85 
86 
88  virtual returnValue evaluate( EvaluationBase *x );
89 
90 
96  virtual Operator* differentiate( int index );
97 
98 
99 
105  virtual Operator* AD_forward( int dim ,
106  VariableType *varType ,
107  int *component,
108  Operator **seed ,
109  int &nNewIS ,
110  TreeProjection ***newIS );
111 
112 
113 
119  virtual returnValue AD_backward( int dim ,
120  VariableType *varType ,
121  int *component,
122  Operator *seed ,
123  Operator **df ,
124  int &nNewIS ,
125  TreeProjection ***newIS );
126 
127 
128 
134  virtual returnValue AD_symmetric( int dim ,
135  VariableType *varType ,
136  int *component ,
137  Operator *l ,
138  Operator **S ,
139  int dimS ,
140  Operator **dfS ,
141  Operator **ldf ,
142  Operator **H ,
143  int &nNewLIS ,
144  TreeProjection ***newLIS ,
145  int &nNewSIS ,
146  TreeProjection ***newSIS ,
147  int &nNewHIS ,
148  TreeProjection ***newHIS );
149 
150 
155  virtual Operator* substitute( int index ,
156  const Operator *sub );
157 
158 
159 
167  virtual BooleanType isLinearIn( int dim ,
168  VariableType *varType ,
169  int *component,
170  BooleanType *implicit_dep );
171 
172 
173 
180  virtual BooleanType isPolynomialIn( int dim ,
181  VariableType *varType ,
182  int *component,
183  BooleanType *implicit_dep );
184 
185 
186 
193  virtual BooleanType isRationalIn( int dim ,
194  VariableType *varType ,
195  int *component,
196  BooleanType *implicit_dep );
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 // PROTECTED MEMBERS:
337 //
338 
339 protected:
340 
341 };
342 
343 
345 
346 
347 
348 #endif
349 
OperatorName
Definition: acado_types.hpp:72
virtual MonotonicityType getMonotonicity()
Definition: product.cpp:264
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: product.cpp:217
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 returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
Definition: product.cpp:433
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: product.cpp:236
Allows to pass back messages to the calling function.
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Definition: product.cpp:116
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: product.cpp:178
virtual CurvatureType getCurvature()
Definition: product.cpp:305
#define CLOSE_NAMESPACE_ACADO
VariableType
Definition: acado_types.hpp:95
virtual Operator * clone() const
Definition: product.cpp:467
virtual Operator * substitute(int index, const Operator *sub)
Definition: product.cpp:209
Product & operator=(const Product &arg)
Definition: product.cpp:62
Product()
Definition: product.cpp:45
virtual returnValue evaluate(int number, double *x, double *result)
Definition: product.cpp:74
virtual Operator * differentiate(int index)
Definition: product.cpp:100
virtual std::ostream & print(std::ostream &stream) const
Definition: product.cpp:453
MonotonicityType
Implements the tree-projection operator within the family of SymbolicOperators.
CurvatureType
~Product()
Definition: product.cpp:58
#define BEGIN_NAMESPACE_ACADO
virtual OperatorName getName()
Definition: product.cpp:478
Abstract base class for templated evaluation of operators.
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
Definition: product.cpp:143
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: product.cpp:250
virtual double getValue() const
Definition: product.cpp:350
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Definition: product.cpp:409
Implements the scalar product operator within the symbolic operators family.
Definition: product.hpp:55


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