smooth_operator.hpp
Go to the documentation of this file.
00001 /*
00002  *    This file is part of ACADO Toolkit.
00003  *
00004  *    ACADO Toolkit -- A Toolkit for Automatic Control and Dynamic Optimization.
00005  *    Copyright (C) 2008-2014 by Boris Houska, Hans Joachim Ferreau,
00006  *    Milan Vukov, Rien Quirynen, KU Leuven.
00007  *    Developed within the Optimization in Engineering Center (OPTEC)
00008  *    under supervision of Moritz Diehl. All rights reserved.
00009  *
00010  *    ACADO Toolkit is free software; you can redistribute it and/or
00011  *    modify it under the terms of the GNU Lesser General Public
00012  *    License as published by the Free Software Foundation; either
00013  *    version 3 of the License, or (at your option) any later version.
00014  *
00015  *    ACADO Toolkit is distributed in the hope that it will be useful,
00016  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00017  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00018  *    Lesser General Public License for more details.
00019  *
00020  *    You should have received a copy of the GNU Lesser General Public
00021  *    License along with ACADO Toolkit; if not, write to the Free Software
00022  *    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00023  *
00024  */
00025 
00026 
00027 
00034 #ifndef ACADO_TOOLKIT_SMOOTH_OPERATOR_HPP
00035 #define ACADO_TOOLKIT_SMOOTH_OPERATOR_HPP
00036 
00037 
00038 #include <acado/symbolic_operator/symbolic_operator_fwd.hpp>
00039 
00040 
00041 BEGIN_NAMESPACE_ACADO
00042 
00043 
00044 
00056 class SmoothOperator : public Operator{
00057 
00058 public:
00059 
00060 
00062            SmoothOperator();
00063 
00064     virtual ~SmoothOperator();
00065 
00066 
00069     virtual Operator& operator=( const double      & arg );
00070     virtual Operator& operator=( const DVector      & arg );
00071     virtual Operator& operator=( const DMatrix      & arg );
00072     virtual Operator& operator=( const Expression  & arg );
00073     virtual Operator& operator=( const Operator    & arg );
00074 
00075 
00076     Operator& operator+=( const double      & arg );
00077     Operator& operator+=( const DVector      & arg );
00078     Operator& operator+=( const DMatrix      & arg );
00079     Operator& operator+=( const Expression  & arg );
00080 
00081     Operator& operator-=( const double      & arg );
00082     Operator& operator-=( const DVector      & arg );
00083     Operator& operator-=( const DMatrix      & arg );
00084     Operator& operator-=( const Expression  & arg );
00085 
00086     Operator& operator*=( const double      & arg );
00087     Operator& operator*=( const DVector      & arg );
00088     Operator& operator*=( const DMatrix      & arg );
00089     Operator& operator*=( const Expression  & arg );
00090 
00091     Operator& operator/=( const double      & arg );
00092     Operator& operator/=( const Expression  & arg );
00093 
00094 
00095     Expression operator+( const double        & arg ) const;
00096     Expression operator+( const DVector        & arg ) const;
00097     Expression operator+( const DMatrix        & arg ) const;
00098     Expression operator+( const Operator& arg ) const;
00099     Expression operator+( const Expression    & arg ) const;
00100 
00101     Expression operator-( const double          & arg ) const;
00102     Expression operator-( const DVector          & arg ) const;
00103     Expression operator-( const DMatrix          & arg ) const;
00104     Expression operator-( const Operator  & arg ) const;
00105     Expression operator-( const Expression      & arg ) const;
00106 
00107     Expression operator-( ) const;
00108 
00109     Expression operator*( const double         & arg ) const;
00110     Expression operator*( const DVector         & arg ) const;
00111     Expression operator*( const DMatrix         & arg ) const;
00112     Expression operator*( const Operator & arg ) const;
00113     Expression operator*( const Expression     & arg ) const;
00114 
00115     Expression operator/( const double         & arg ) const;
00116     Expression operator/( const Operator & arg ) const;
00117     Expression operator/( const Expression     & arg ) const;
00118 
00119 
00120     ConstraintComponent operator<=( const double& ub ) const;
00121     ConstraintComponent operator>=( const double& lb ) const;
00122     ConstraintComponent operator==( const double&  b ) const;
00123 
00124     ConstraintComponent operator<=( const DVector& ub ) const;
00125     ConstraintComponent operator>=( const DVector& lb ) const;
00126     ConstraintComponent operator==( const DVector&  b ) const;
00127 
00128     ConstraintComponent operator<=( const VariablesGrid& ub ) const;
00129     ConstraintComponent operator>=( const VariablesGrid& lb ) const;
00130     ConstraintComponent operator==( const VariablesGrid&  b ) const;
00131 
00132 
00139     virtual returnValue evaluate( int     number    ,
00140                                   double *x         ,
00141                                   double *result      ) = 0;
00142 
00143 
00145     virtual returnValue evaluate( EvaluationBase *x ) = 0;
00146         
00147         
00153      virtual Operator* differentiate( int index      ) = 0;
00154 
00155 
00156 
00162      virtual Operator* AD_forward( int                dim      , 
00163                                      VariableType      *varType  , 
00164                                      int               *component, 
00165                                      Operator       **seed     , 
00166                                      int                &nNewIS  , 
00167                                      TreeProjection ***newIS     ) = 0;
00168 
00169 
00170 
00176     virtual returnValue AD_backward( int           dim      , 
00177                                      VariableType *varType  , 
00178                                      int          *component, 
00179                                      Operator     *seed     , 
00180                                      Operator    **df       , 
00181                                      int           &nNewIS  , 
00182                                      TreeProjection ***newIS   ) = 0;
00183 
00184 
00190      virtual returnValue AD_symmetric( int            dim       , 
00191                                       VariableType  *varType   , 
00192                                       int           *component , 
00193                                       Operator      *l         , 
00194                                       Operator     **S         , 
00195                                       int            dimS      , 
00196                                       Operator     **dfS       , 
00197                                       Operator     **ldf       , 
00198                                       Operator     **H         , 
00199                                       int            &nNewLIS  , 
00200                                       TreeProjection ***newLIS , 
00201                                       int            &nNewSIS  , 
00202                                       TreeProjection ***newSIS , 
00203                                       int            &nNewHIS  , 
00204                                       TreeProjection ***newHIS    ) = 0;
00205      
00206      
00211      virtual Operator* substitute( int   index            ,
00212                                      const Operator *sub  ) = 0;
00213 
00214 
00215 
00222      virtual NeutralElement isOneOrZero() const = 0;
00223 
00224 
00225 
00231      virtual BooleanType isDependingOn( VariableType var ) const = 0;
00232 
00233 
00234 
00240      virtual BooleanType isDependingOn( int           dim      ,    
00241                                           VariableType *varType  ,    
00242                                           int          *component,    
00243                                           BooleanType   *implicit_dep  ) = 0;
00244 
00245 
00246 
00247 
00255      virtual BooleanType isLinearIn( int           dim      ,    
00256                                        VariableType *varType  ,    
00257                                        int          *component,    
00258                                        BooleanType  *implicit_dep   ) = 0;
00259 
00260 
00261 
00268      virtual BooleanType isPolynomialIn( int           dim      ,    
00269                                            VariableType *varType  ,    
00270                                            int          *component,    
00271                                            BooleanType  *implicit_dep   ) = 0;
00272 
00273 
00274 
00281      virtual BooleanType isRationalIn( int           dim      ,    
00282                                          VariableType *varType  ,    
00283                                          int          *component,    
00284                                          BooleanType  *implicit_dep   ) = 0;
00285 
00291      virtual BooleanType isSmooth( ) const;
00292          
00293 
00300      virtual MonotonicityType getMonotonicity( ) = 0;
00301 
00302 
00303 
00311      virtual CurvatureType getCurvature( ) = 0;
00312 
00313 
00314 
00320      virtual returnValue setMonotonicity( MonotonicityType monotonicity_ ) = 0;
00321 
00322 
00323 
00324 
00330      virtual returnValue setCurvature( CurvatureType curvature_  ) = 0;
00331 
00332 
00333 
00341      virtual returnValue AD_forward( int     number  ,
00342                                      double *x       ,
00344                                      double *seed    ,
00345                                      double *f       ,
00347                                      double *df        ) = 0;
00349 
00350 
00351 
00358      virtual returnValue AD_forward( int     number  ,
00359                                      double *seed    ,
00360                                      double *df        ) = 0;
00362 
00363 
00364 
00365     // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
00366     //                                   the point x and to compute f.
00367 
00373      virtual returnValue AD_backward( int    number ,
00375                                       double seed   ,
00376                                       double  *df   ) = 0;
00378 
00379 
00380 
00388      virtual returnValue AD_forward2( int    number  ,
00390                                       double *seed1  ,
00391                                       double *seed2  ,
00393                                       double *df     ,
00395                                       double *ddf    ) = 0;
00397 
00398 
00399 
00400     // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
00401     //                                    the point x and to compute f and df.
00402 
00408      virtual returnValue AD_backward2( int    number ,
00410                                        double seed1  ,
00411                                        double seed2  ,
00412                                        double   *df  ,
00414                                        double  *ddf     ) = 0;
00416 
00420      virtual std::ostream& print( std::ostream &stream ) const = 0;
00421 
00425      virtual Operator* clone() const = 0;
00426 
00427 
00433      virtual TreeProjection* cloneTreeProjection() const;
00434 
00435 
00436 
00441      virtual returnValue clearBuffer() = 0;
00442 
00443 
00444 
00449      virtual returnValue enumerateVariables( SymbolicIndexList *indexList ) = 0;
00450 
00451 
00452 
00456      virtual OperatorName getName() = 0;
00457 
00458 
00461      //virtual int getVariableIndex( ) const;
00462 
00463 
00466      virtual int getGlobalIndex( ) const;
00467 
00468 
00472      virtual BooleanType isVariable( VariableType &varType,
00473                                      int &component          ) const = 0;
00474 
00475 
00494      virtual returnValue loadIndices( SymbolicIndexList *indexList  ) = 0;
00496 
00497 
00498 
00500      virtual double getValue() const;
00501 
00502 
00503 
00505      virtual Operator* passArgument() const;
00506 
00507 
00513     virtual BooleanType isSymbolic() const = 0;
00514 
00515 
00516     int nCount;
00517 
00518 //
00519 //  PROTECTED FUNCTIONS:
00520 //
00521 
00522 protected:
00523 
00524 
00525 };
00526 
00527 
00528 CLOSE_NAMESPACE_ACADO
00529 
00530 
00531 
00532 #endif
00533 
00534 
00535 


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 12:00:17