nonsmooth_operator.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 
34 #ifndef ACADO_TOOLKIT_NONSMOOTH_OPERATOR_HPP
35 #define ACADO_TOOLKIT_NONSMOOTH_OPERATOR_HPP
36 
37 
39 
40 
42 
43 
44 
56 class NonsmoothOperator : public Operator{
57 
58 public:
59 
60 
63 
64  virtual ~NonsmoothOperator();
65 
66 
69  virtual Operator& operator=( const double & arg );
70  virtual Operator& operator=( const DVector & arg );
71  virtual Operator& operator=( const DMatrix & arg );
72  virtual Operator& operator=( const Expression & arg );
73  virtual Operator& operator=( const Operator & arg );
74 
75 
76  Operator& operator+=( const double & arg );
77  Operator& operator+=( const DVector & arg );
78  Operator& operator+=( const DMatrix & arg );
79  Operator& operator+=( const Expression & arg );
80 
81  Operator& operator-=( const double & arg );
82  Operator& operator-=( const DVector & arg );
83  Operator& operator-=( const DMatrix & arg );
84  Operator& operator-=( const Expression & arg );
85 
86  Operator& operator*=( const double & arg );
87  Operator& operator*=( const DVector & arg );
88  Operator& operator*=( const DMatrix & arg );
89  Operator& operator*=( const Expression & arg );
90 
91  Operator& operator/=( const double & arg );
92  Operator& operator/=( const Expression & arg );
93 
94 
95  Expression operator+( const double & arg ) const;
96  Expression operator+( const DVector & arg ) const;
97  Expression operator+( const DMatrix & arg ) const;
98  Expression operator+( const Operator& arg ) const;
99  Expression operator+( const Expression & arg ) const;
100 
101  Expression operator-( const double & arg ) const;
102  Expression operator-( const DVector & arg ) const;
103  Expression operator-( const DMatrix & arg ) const;
104  Expression operator-( const Operator & arg ) const;
105  Expression operator-( const Expression & arg ) const;
106 
107  Expression operator-( ) const;
108 
109  Expression operator*( const double & arg ) const;
110  Expression operator*( const DVector & arg ) const;
111  Expression operator*( const DMatrix & arg ) const;
112  Expression operator*( const Operator & arg ) const;
113  Expression operator*( const Expression & arg ) const;
114 
115  Expression operator/( const double & arg ) const;
116  Expression operator/( const Operator & arg ) const;
117  Expression operator/( const Expression & arg ) const;
118 
119 
120  ConstraintComponent operator<=( const double& ub ) const;
121  ConstraintComponent operator>=( const double& lb ) const;
122  ConstraintComponent operator==( const double& b ) const;
123 
124  ConstraintComponent operator<=( const DVector& ub ) const;
125  ConstraintComponent operator>=( const DVector& lb ) const;
126  ConstraintComponent operator==( const DVector& b ) const;
127 
128  ConstraintComponent operator<=( const VariablesGrid& ub ) const;
129  ConstraintComponent operator>=( const VariablesGrid& lb ) const;
130  ConstraintComponent operator==( const VariablesGrid& b ) const;
131 
132 
139  virtual returnValue evaluate( int number ,
140  double *x ,
141  double *result );
142 
143 
145  virtual returnValue evaluate( EvaluationBase *x );
146 
147 
153  virtual Operator* differentiate( int index );
154 
155 
156 
162  virtual Operator* AD_forward( int dim ,
163  VariableType *varType ,
164  int *component,
165  Operator **seed ,
166  int &nNewIS ,
167  TreeProjection ***newIS );
168 
169 
170 
176  virtual returnValue AD_backward( int dim ,
177  VariableType *varType ,
178  int *component,
179  Operator *seed ,
180  Operator **df ,
181  int &nNewIS ,
182  TreeProjection ***newIS );
183 
184 
185 
191  virtual returnValue AD_symmetric( int dim ,
192  VariableType *varType ,
193  int *component ,
194  Operator *l ,
195  Operator **S ,
196  int dimS ,
197  Operator **dfS ,
198  Operator **ldf ,
199  Operator **H ,
200  int &nNewLIS ,
201  TreeProjection ***newLIS ,
202  int &nNewSIS ,
203  TreeProjection ***newSIS ,
204  int &nNewHIS ,
205  TreeProjection ***newHIS );
206 
207 
208 
213  virtual Operator* substitute( int index ,
214  const Operator *sub );
215 
216 
217 
224  virtual NeutralElement isOneOrZero() const;
225 
226 
227 
233  virtual BooleanType isDependingOn( VariableType var ) const;
234 
235 
236 
242  virtual BooleanType isDependingOn( int dim ,
243  VariableType *varType ,
244  int *component,
245  BooleanType *implicit_dep );
246 
247 
248 
249 
257  virtual BooleanType isLinearIn( int dim ,
258  VariableType *varType ,
259  int *component,
260  BooleanType *implicit_dep );
261 
262 
263 
270  virtual BooleanType isPolynomialIn( int dim ,
271  VariableType *varType ,
272  int *component,
273  BooleanType *implicit_dep );
274 
275 
276 
283  virtual BooleanType isRationalIn( int dim ,
284  VariableType *varType ,
285  int *component,
286  BooleanType *implicit_dep );
287 
293  virtual BooleanType isSmooth( ) const;
294 
302 
303 
304 
312  virtual CurvatureType getCurvature( );
313 
314 
315 
321  virtual returnValue setMonotonicity( MonotonicityType monotonicity_ );
322 
323 
324 
325 
331  virtual returnValue setCurvature( CurvatureType curvature_ );
332 
333 
334 
342  virtual returnValue AD_forward( int number ,
343  double *x ,
345  double *seed ,
346  double *f ,
348  double *df );
350 
351 
352 
359  virtual returnValue AD_forward( int number ,
360  double *seed ,
361  double *df );
363 
364 
365 
366  // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
367  // the point x and to compute f.
368 
374  virtual returnValue AD_backward( int number ,
376  double seed ,
377  double *df );
379 
380 
381 
389  virtual returnValue AD_forward2( int number ,
391  double *seed1 ,
392  double *seed2 ,
394  double *df ,
396  double *ddf );
398 
399 
400 
401  // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
402  // the point x and to compute f and df.
403 
409  virtual returnValue AD_backward2( int number ,
411  double seed1 ,
412  double seed2 ,
413  double *df ,
415  double *ddf );
417 
418 
419 
420 
424  virtual std::ostream& print( std::ostream &stream ) const;
425 
429  virtual Operator* clone() const;
430 
431 
437  virtual TreeProjection* cloneTreeProjection() const;
438 
439 
440 
445  virtual returnValue clearBuffer();
446 
447 
448 
453  virtual returnValue enumerateVariables( SymbolicIndexList *indexList );
454 
455 
456 
460  virtual OperatorName getName();
461 
462 
465  //virtual int getVariableIndex( ) const;
466 
467 
470  virtual int getGlobalIndex( ) const;
471 
472 
476  virtual BooleanType isVariable( VariableType &varType,
477  int &component ) const;
478 
479 
498  virtual returnValue loadIndices( SymbolicIndexList *indexList );
500 
501 
502 
504  virtual double getValue() const;
505 
506 
507 
509  virtual Operator* passArgument() const;
510 
511 
517  virtual BooleanType isSymbolic() const;
518 
519 
520  int nCount;
521 
522 
523 //
524 // PROTECTED FUNCTIONS:
525 //
526 
527 protected:
528 
529 
530 };
531 
532 
534 
535 
536 
537 #endif
538 
539 
540 
OperatorName
Definition: acado_types.hpp:72
virtual returnValue enumerateVariables(SymbolicIndexList *indexList)
ConstraintComponent operator==(const double &b) const
ConstraintComponent operator<=(const double &ub) const
Expression operator*(const double &arg) const
virtual returnValue AD_forward2(int number, double *seed1, double *seed2, double *df, double *ddf)
virtual std::ostream & print(std::ostream &stream) const
virtual BooleanType isSmooth() const
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
Operator & operator/=(const double &arg)
virtual returnValue setMonotonicity(MonotonicityType monotonicity_)
virtual returnValue clearBuffer()
Expression operator/(const double &arg) const
virtual TreeProjection * cloneTreeProjection() const
ConstraintComponent operator>=(const double &lb) const
Provides a time grid consisting of vector-valued optimization variables at each grid point...
Allows to pass back messages to the calling function.
virtual OperatorName getName()
virtual Operator * passArgument() const
virtual Operator * AD_forward(int dim, VariableType *varType, int *component, Operator **seed, int &nNewIS, TreeProjection ***newIS)
Expression operator-() const
virtual returnValue AD_backward(int dim, VariableType *varType, int *component, Operator *seed, Operator **df, int &nNewIS, TreeProjection ***newIS)
virtual returnValue evaluate(int number, double *x, double *result)
virtual BooleanType isDependingOn(VariableType var) const
virtual returnValue loadIndices(SymbolicIndexList *indexList)
virtual BooleanType isLinearIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Operator & operator+=(const double &arg)
virtual NeutralElement isOneOrZero() const
#define CLOSE_NAMESPACE_ACADO
Manages the indices of SymbolicVariables.
Data class for symbolically formulating constraints within optimal control problems.
VariableType
Definition: acado_types.hpp:95
virtual returnValue setCurvature(CurvatureType curvature_)
virtual BooleanType isVariable(VariableType &varType, int &component) const
Base class for all variables within the symbolic expressions family.
Definition: expression.hpp:56
Operator & operator*=(const double &arg)
virtual Operator * substitute(int index, const Operator *sub)
virtual BooleanType isRationalIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
virtual returnValue AD_backward2(int number, double seed1, double seed2, double *df, double *ddf)
virtual Operator * clone() const
virtual Operator * differentiate(int index)
Expression operator+(const double &arg) const
virtual MonotonicityType getMonotonicity()
Abstract base class for all scalar-valued symbolic operators.
virtual Operator & operator=(const double &arg)
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)
NeutralElement
Definition: acado_types.hpp:64
MonotonicityType
Implements the tree-projection operator within the family of SymbolicOperators.
virtual CurvatureType getCurvature()
CurvatureType
virtual BooleanType isSymbolic() const
#define BEGIN_NAMESPACE_ACADO
Abstract base class for templated evaluation of operators.
virtual double getValue() const
virtual BooleanType isPolynomialIn(int dim, VariableType *varType, int *component, BooleanType *implicit_dep)
Operator & operator-=(const double &arg)
virtual int getGlobalIndex() const


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