doubleconstant.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_DOUBLE_CONSTANT_HPP
36 #define ACADO_TOOLKIT_DOUBLE_CONSTANT_HPP
37 
38 
40 
41 
43 
44 
56 
57 public:
58 
59 
61  DoubleConstant( );
62 
64  DoubleConstant( double value_, NeutralElement neutralElement_ = NE_ZERO );
65 
67  DoubleConstant( const DoubleConstant &arg );
68 
71 
74 
75 
76 
83  virtual returnValue evaluate( int number ,
84  double *x ,
85  double *result );
86 
87 
89  virtual returnValue evaluate( EvaluationBase *x );
90 
91 
97  virtual Operator* differentiate( int index );
98 
99 
100 
106  virtual Operator* AD_forward( int dim ,
107  VariableType *varType ,
108  int *component,
109  Operator **seed ,
110  int &nNewIS ,
111  TreeProjection ***newIS );
112 
113 
114 
120  virtual returnValue AD_backward( int dim ,
121  VariableType *varType ,
122  int *component,
123  Operator *seed ,
124  Operator **df ,
125  int &nNewIS ,
126  TreeProjection ***newIS );
127 
128 
129 
135  virtual returnValue AD_symmetric( int dim ,
136  VariableType *varType ,
137  int *component ,
138  Operator *l ,
139  Operator **S ,
140  int dimS ,
141  Operator **dfS ,
142  Operator **ldf ,
143  Operator **H ,
144  int &nNewLIS ,
145  TreeProjection ***newLIS ,
146  int &nNewSIS ,
147  TreeProjection ***newSIS ,
148  int &nNewHIS ,
149  TreeProjection ***newHIS );
150 
151 
156  virtual Operator* substitute( int index ,
157  const Operator *sub );
158 
159 
160 
167  virtual NeutralElement isOneOrZero() const;
168 
169 
170 
176  virtual BooleanType isDependingOn( VariableType var ) const;
177 
178 
179 
185  virtual BooleanType isDependingOn( int dim ,
186  VariableType *varType ,
187  int *component,
188  BooleanType *implicit_dep );
189 
190 
191 
192 
200  virtual BooleanType isLinearIn( int dim ,
201  VariableType *varType ,
202  int *component,
203  BooleanType *implicit_dep );
204 
205 
206 
213  virtual BooleanType isPolynomialIn( int dim ,
214  VariableType *varType ,
215  int *component,
216  BooleanType *implicit_dep );
217 
218 
219 
226  virtual BooleanType isRationalIn( int dim ,
227  VariableType *varType ,
228  int *component,
229  BooleanType *implicit_dep );
230 
231 
232 
240 
241 
242 
250  virtual CurvatureType getCurvature( );
251 
252 
253 
259  virtual returnValue setMonotonicity( MonotonicityType monotonicity_ );
260 
261 
262 
263 
269  virtual returnValue setCurvature( CurvatureType curvature_ );
270 
271 
272 
279  virtual returnValue AD_forward( int number ,
280  double *seed ,
281  double *df );
283 
284 
285 
293  virtual returnValue AD_forward( int number ,
294  double *x ,
296  double *seed ,
297  double *f ,
299  double *df );
301 
302 
303  // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
304  // the point x and to compute f.
305 
311  virtual returnValue AD_backward( int number ,
313  double seed ,
314  double *df );
316 
317 
318 
326  virtual returnValue AD_forward2( int number ,
328  double *seed1 ,
329  double *seed2 ,
331  double *df ,
333  double *ddf );
335 
336 
337 
338  // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
339  // the point x and to compute f and df.
340 
346  virtual returnValue AD_backward2( int number ,
348  double seed1 ,
349  double seed2 ,
350  double *df ,
352  double *ddf );
354 
355 
359  virtual std::ostream& print( std::ostream &stream ) const;
360 
361 
365  virtual Operator* clone() const;
366 
367 
368 
373  virtual returnValue clearBuffer();
374 
375 
376 
381  virtual returnValue enumerateVariables( SymbolicIndexList *indexList );
382 
383 
384 
388  virtual OperatorName getName();
389 
390 
391 
395  virtual BooleanType isVariable( VariableType &varType,
396  int &component ) const;
397 
398 
399 
418  virtual returnValue loadIndices( SymbolicIndexList *indexList );
421 
422 
423 
425  virtual double getValue() const;
426 
427 
428 
434  virtual BooleanType isSymbolic() const;
435 
436 
437 
438 //
439 // PROTECTED FUNCTIONS:
440 //
441 
442 protected:
443 
444 
445 //
446 // PROTECTED MEMBERS:
447 //
448 
449 protected:
450 
451  double value ;
458 };
459 
460 
462 
463 
464 
465 #endif
OperatorName
Definition: acado_types.hpp:72
virtual BooleanType isSymbolic() const
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
virtual returnValue loadIndices(SymbolicIndexList *indexList)
virtual returnValue setMonotonicity(MonotonicityType monotonicity_)
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
virtual BooleanType isDependingOn(VariableType var) const
DoubleConstant & operator=(const DoubleConstant &arg)
virtual NeutralElement isOneOrZero() const
virtual double getValue() const
Allows to pass back messages to the calling function.
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual Operator * differentiate(int index)
virtual returnValue clearBuffer()
#define CLOSE_NAMESPACE_ACADO
Manages the indices of SymbolicVariables.
VariableType
Definition: acado_types.hpp:95
virtual returnValue evaluate(int number, double *x, double *result)
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 BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual BooleanType isVariable(VariableType &varType, int &component) 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 Operator * clone() const
virtual returnValue setCurvature(CurvatureType curvature_)
virtual std::ostream & print(std::ostream &stream) const
virtual OperatorName getName()
NeutralElement
Definition: acado_types.hpp:64
Abstract base class for all scalar-valued symbolic operators.
MonotonicityType
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
NeutralElement neutralElement
Implements the tree-projection operator within the family of SymbolicOperators.
CurvatureType
#define BEGIN_NAMESPACE_ACADO
Abstract base class for templated evaluation of operators.
virtual Operator * substitute(int index, const Operator *sub)
virtual MonotonicityType getMonotonicity()
Implements a scalar constant within the symbolic operators family.
virtual CurvatureType getCurvature()
virtual returnValue enumerateVariables(SymbolicIndexList *indexList)


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