subtraction.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 
34 #ifndef ACADO_TOOLKIT_SUBTRACTION_HPP
35 #define ACADO_TOOLKIT_SUBTRACTION_HPP
36 
37 
39 
40 
42 
43 
54 class Subtraction : public BinaryOperator{
55 
56 public:
57 
58 
60  Subtraction();
61 
63  Subtraction( Operator *_argument1, Operator *_argument2 );
64 
66  Subtraction( const Subtraction &arg );
67 
69  ~Subtraction();
70 
72  Subtraction& operator=( const Subtraction &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 
127 
133  virtual returnValue AD_symmetric( int dim ,
134  VariableType *varType ,
135  int *component ,
136  Operator *l ,
137  Operator **S ,
138  int dimS ,
139  Operator **dfS ,
140  Operator **ldf ,
141  Operator **H ,
142  int &nNewLIS ,
143  TreeProjection ***newLIS ,
144  int &nNewSIS ,
145  TreeProjection ***newSIS ,
146  int &nNewHIS ,
147  TreeProjection ***newHIS );
148 
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 
244  virtual returnValue AD_forward( int number ,
245  double *x ,
247  double *seed ,
248  double *f ,
250  double *df );
252 
253 
254  // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
255  // the point x and to compute f.
256 
262  virtual returnValue AD_backward( int number ,
264  double seed ,
265  double *df );
267 
268 
269 
277  virtual returnValue AD_forward2( int number ,
279  double *seed1 ,
280  double *seed2 ,
282  double *df ,
284  double *ddf );
286 
287 
288 
289  // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
290  // the point x and to compute f and df.
291 
297  virtual returnValue AD_backward2( int number ,
299  double seed1 ,
300  double seed2 ,
301  double *df ,
303  double *ddf );
305 
306 
307 
311  virtual std::ostream& print( std::ostream &stream ) const;
312 
313 
317  virtual Operator* clone() const;
318 
319 
323  virtual OperatorName getName();
324 
325 
326 //
327 // PROTECTED FUNCTIONS:
328 //
329 
330 protected:
331 
332 
333 
334 //
335 // PROTECTED MEMBERS:
336 //
337 
338 protected:
339 
340 };
341 
342 
344 
345 
346 
347 #endif
OperatorName
Definition: acado_types.hpp:72
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_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
Allows to pass back messages to the calling function.
virtual Operator * clone() const
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
#define CLOSE_NAMESPACE_ACADO
VariableType
Definition: acado_types.hpp:95
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual double getValue() const
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)
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
virtual returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
virtual std::ostream & print(std::ostream &stream) const
virtual Operator * substitute(int index, const Operator *sub)
virtual CurvatureType getCurvature()
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual OperatorName getName()
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Implements the scalar subtraction operator within the symbolic operators family.
Definition: subtraction.hpp:54
Subtraction & operator=(const Subtraction &arg)
Definition: subtraction.cpp:57
MonotonicityType
Implements the tree-projection operator within the family of SymbolicOperators.
CurvatureType
#define BEGIN_NAMESPACE_ACADO
Abstract base class for templated evaluation of operators.
virtual returnValue evaluate(int number, double *x, double *result)
Definition: subtraction.cpp:67
virtual Operator * differentiate(int index)
Definition: subtraction.cpp:93
virtual MonotonicityType getMonotonicity()


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