quotient.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_QUOTIENT_HPP
36 #define ACADO_TOOLKIT_QUOTIENT_HPP
37 
38 
40 
41 
43 
44 
55 class Quotient : public BinaryOperator{
56 
57 public:
58 
60  Quotient();
61 
63  Quotient( Operator *_argument1, Operator *_argument2 );
64 
66  Quotient( const Quotient &arg );
67 
69  ~Quotient();
70 
72  Quotient& operator=( const Quotient &arg );
73 
74 
81  virtual returnValue evaluate( int number ,
82  double *x ,
83  double *result );
84 
85 
87  virtual returnValue evaluate( EvaluationBase *x );
88 
89 
95  virtual Operator* differentiate( int index );
96 
97 
98 
104  virtual Operator* AD_forward( int dim ,
105  VariableType *varType ,
106  int *component,
107  Operator **seed ,
108  int &nNewIS ,
109  TreeProjection ***newIS );
110 
111 
112 
118  virtual returnValue AD_backward( int dim ,
119  VariableType *varType ,
120  int *component,
121  Operator *seed ,
122  Operator **df ,
123  int &nNewIS ,
124  TreeProjection ***newIS );
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 
153  virtual Operator* substitute( int index ,
154  const Operator *sub );
155 
156 
157 
165  virtual BooleanType isLinearIn( int dim ,
166  VariableType *varType ,
167  int *component,
168  BooleanType *implicit_dep );
169 
170 
171 
178  virtual BooleanType isPolynomialIn( int dim ,
179  VariableType *varType ,
180  int *component,
181  BooleanType *implicit_dep );
182 
183 
184 
191  virtual BooleanType isRationalIn( int dim ,
192  VariableType *varType ,
193  int *component,
194  BooleanType *implicit_dep );
195 
196 
197 
205 
206 
207 
215  virtual CurvatureType getCurvature( );
216 
217 
219  virtual double getValue() const;
220 
221 
228  virtual returnValue AD_forward( int number ,
229  double *seed ,
230  double *df );
232 
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 
312 
316  virtual Operator* clone() const;
317 
318 
322  virtual OperatorName getName();
323 
324 
325  virtual returnValue initDerivative();
326 
327 
328 //
329 // PROTECTED FUNCTIONS:
330 //
331 
332 protected:
333 
334 
335 //
336 // PROTECTED MEMBERS:
337 //
338 
339 protected:
340 
345 };
346 
347 
349 
350 
351 
352 #endif
OperatorName
Definition: acado_types.hpp:72
TreeProjection * derivative1
Definition: quotient.hpp:342
virtual returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
Definition: quotient.cpp:456
Abstract base class for all scalar-valued binary operators within the symbolic operators family...
Quotient()
Definition: quotient.cpp:45
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
virtual Operator * clone() const
Definition: quotient.cpp:483
virtual returnValue evaluate(int number, double *x, double *result)
Definition: quotient.cpp:100
Allows to pass back messages to the calling function.
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: quotient.cpp:291
virtual std::ostream & print(std::ostream &stream) const
Definition: quotient.cpp:477
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
Definition: quotient.cpp:175
#define CLOSE_NAMESPACE_ACADO
VariableType
Definition: acado_types.hpp:95
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: quotient.cpp:277
virtual returnValue initDerivative()
Definition: quotient.cpp:241
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Definition: quotient.cpp:146
TreeProjection * derivative0
Definition: quotient.hpp:341
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
Definition: quotient.cpp:426
virtual Operator * substitute(int index, const Operator *sub)
Definition: quotient.cpp:255
TreeProjection * derivative2
Definition: quotient.hpp:343
virtual MonotonicityType getMonotonicity()
Definition: quotient.cpp:305
virtual OperatorName getName()
Definition: quotient.cpp:489
Implements the scalar quotient operator within the symbolic operators family.
Definition: quotient.hpp:55
MonotonicityType
Implements the tree-projection operator within the family of SymbolicOperators.
CurvatureType
#define BEGIN_NAMESPACE_ACADO
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: quotient.cpp:211
Abstract base class for templated evaluation of operators.
virtual double getValue() const
Definition: quotient.cpp:362
virtual CurvatureType getCurvature()
Definition: quotient.cpp:333
Quotient & operator=(const Quotient &arg)
Definition: quotient.cpp:89
~Quotient()
Definition: quotient.cpp:73
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Definition: quotient.cpp:263
virtual Operator * differentiate(int index)
Definition: quotient.cpp:126


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