power.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_POWER_HPP
36 #define ACADO_TOOLKIT_POWER_HPP
37 
38 
40 
41 
43 
44 
45 
56 class Power : public BinaryOperator{
57 
58 public:
59 
60 
62  Power();
63 
65  Power( Operator *_argument1, Operator *_argument2 );
66 
68  Power( const Power &arg );
69 
71  ~Power();
72 
74  Power& operator=( const Power &arg );
75 
76 
77 
84  virtual returnValue evaluate( int number ,
85  double *x ,
86  double *result );
87 
88 
90  virtual returnValue evaluate( EvaluationBase *x );
91 
92 
98  virtual Operator* differentiate( int index );
99 
100 
101 
107  virtual Operator* AD_forward( int dim ,
108  VariableType *varType ,
109  int *component,
110  Operator **seed ,
111  int &nNewIS ,
112  TreeProjection ***newIS );
113 
114 
115 
121  virtual returnValue AD_backward( int dim ,
122  VariableType *varType ,
123  int *component,
124  Operator *seed ,
125  Operator **df ,
126  int &nNewIS ,
127  TreeProjection ***newIS );
128 
129 
130 
136  virtual returnValue AD_symmetric( int dim ,
137  VariableType *varType ,
138  int *component ,
139  Operator *l ,
140  Operator **S ,
141  int dimS ,
142  Operator **dfS ,
143  Operator **ldf ,
144  Operator **H ,
145  int &nNewLIS ,
146  TreeProjection ***newLIS ,
147  int &nNewSIS ,
148  TreeProjection ***newSIS ,
149  int &nNewHIS ,
150  TreeProjection ***newHIS );
151 
152 
157  virtual Operator* substitute( int index ,
158  const Operator *sub );
159 
160 
161 
169  virtual BooleanType isLinearIn( int dim ,
170  VariableType *varType ,
171  int *component,
172  BooleanType *implicit_dep );
173 
174 
175 
182  virtual BooleanType isPolynomialIn( int dim ,
183  VariableType *varType ,
184  int *component,
185  BooleanType *implicit_dep );
186 
187 
188 
195  virtual BooleanType isRationalIn( int dim ,
196  VariableType *varType ,
197  int *component,
198  BooleanType *implicit_dep );
199 
200 
201 
209 
210 
211 
219  virtual CurvatureType getCurvature( );
220 
221 
222 
229  virtual returnValue AD_forward( int number ,
230  double *seed ,
231  double *df );
233 
234 
235 
243  virtual returnValue AD_forward( int number ,
244  double *x ,
246  double *seed ,
247  double *f ,
249  double *df );
251 
252 
253  // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
254  // the point x and to compute f.
255 
261  virtual returnValue AD_backward( int number ,
263  double seed ,
264  double *df );
266 
267 
268 
276  virtual returnValue AD_forward2( int number ,
278  double *seed1 ,
279  double *seed2 ,
281  double *df ,
283  double *ddf );
285 
286 
287 
288  // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
289  // the point x and to compute f and df.
290 
296  virtual returnValue AD_backward2( int number ,
298  double seed1 ,
299  double seed2 ,
300  double *df ,
302  double *ddf );
304 
305 
309  virtual std::ostream& print( std::ostream &stream ) const;
310 
311 
315  virtual Operator* clone() const;
316 
317 
321  virtual OperatorName getName();
322 
323 
324  virtual returnValue initDerivative();
325 
326 
327 
328 //
329 // PROTECTED FUNCTIONS:
330 //
331 
332 protected:
333 
344 //
345 // PROTECTED MEMBERS:
346 //
347 
348 protected:
349 
350 };
351 
352 
354 
355 
356 
357 #endif
OperatorName
Definition: acado_types.hpp:72
virtual returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
Definition: power.cpp:545
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: power.cpp:335
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Definition: power.cpp:170
Abstract base class for all scalar-valued binary operators within the symbolic operators family...
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: power.cpp:305
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
TreeProjection * derivative02
Definition: power.hpp:335
virtual CurvatureType getCurvature()
Definition: power.cpp:402
virtual Operator * substitute(int index, const Operator *sub)
Definition: power.cpp:297
virtual returnValue evaluate(int number, double *x, double *result)
Definition: power.cpp:124
TreeProjection * derivative22
Definition: power.hpp:340
Allows to pass back messages to the calling function.
Implements the scalar power operator within the symbolic operators family.
Definition: power.hpp:56
virtual MonotonicityType getMonotonicity()
Definition: power.cpp:363
#define CLOSE_NAMESPACE_ACADO
TreeProjection * derivative12
Definition: power.hpp:337
VariableType
Definition: acado_types.hpp:95
virtual returnValue initDerivative()
Definition: power.cpp:261
virtual std::ostream & print(std::ostream &stream) const
Definition: power.cpp:576
TreeProjection * derivative21
Definition: power.hpp:339
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
Definition: power.cpp:200
~Power()
Definition: power.cpp:85
virtual OperatorName getName()
Definition: power.cpp:602
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: power.cpp:349
Power()
Definition: power.cpp:45
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Definition: power.cpp:511
MonotonicityType
Implements the tree-projection operator within the family of SymbolicOperators.
virtual Operator * differentiate(int index)
Definition: power.cpp:150
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: power.cpp:232
CurvatureType
#define BEGIN_NAMESPACE_ACADO
TreeProjection * derivative01
Definition: power.hpp:334
Abstract base class for templated evaluation of operators.
Power & operator=(const Power &arg)
Definition: power.cpp:114
TreeProjection * derivative23
Definition: power.hpp:341
virtual Operator * clone() const
Definition: power.cpp:596


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