doubleconstant.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 
00035 #ifndef ACADO_TOOLKIT_DOUBLE_CONSTANT_HPP
00036 #define ACADO_TOOLKIT_DOUBLE_CONSTANT_HPP
00037 
00038 
00039 #include <acado/symbolic_operator/symbolic_operator_fwd.hpp>
00040 
00041 
00042 BEGIN_NAMESPACE_ACADO
00043 
00044 
00055 class DoubleConstant : public SmoothOperator{
00056 
00057 public:
00058 
00059 
00061     DoubleConstant( );
00062 
00064     DoubleConstant( double value_, NeutralElement neutralElement_ = NE_ZERO );
00065 
00067     DoubleConstant( const DoubleConstant &arg );
00068 
00070     ~DoubleConstant();
00071 
00073     DoubleConstant& operator=( const DoubleConstant &arg );
00074 
00075 
00076 
00083     virtual returnValue evaluate( int     number    ,
00084                                   double *x         ,
00085                                   double *result      );
00086 
00087 
00089         virtual returnValue evaluate( EvaluationBase *x );
00090         
00091         
00097      virtual Operator* differentiate( int index   );
00098 
00099 
00100 
00106      virtual Operator* AD_forward( int                dim      , 
00107                                      VariableType      *varType  , 
00108                                      int               *component, 
00109                                      Operator       **seed     , 
00110                                      int                &nNewIS  , 
00111                                      TreeProjection ***newIS     );
00112 
00113 
00114 
00120     virtual returnValue AD_backward( int           dim      , 
00121                                      VariableType *varType  , 
00122                                      int          *component, 
00123                                      Operator     *seed     , 
00124                                      Operator    **df       , 
00125                                      int           &nNewIS  , 
00126                                      TreeProjection ***newIS   );
00127 
00128     
00129     
00135      virtual returnValue AD_symmetric( int            dim       , 
00136                                       VariableType  *varType   , 
00137                                       int           *component , 
00138                                       Operator      *l         , 
00139                                       Operator     **S         , 
00140                                       int            dimS      , 
00141                                       Operator     **dfS       , 
00142                                       Operator     **ldf       , 
00143                                       Operator     **H         , 
00144                                       int            &nNewLIS  , 
00145                                       TreeProjection ***newLIS , 
00146                                       int            &nNewSIS  , 
00147                                       TreeProjection ***newSIS , 
00148                                       int            &nNewHIS  , 
00149                                       TreeProjection ***newHIS    );
00150 
00151 
00156      virtual Operator* substitute( int   index           ,
00157                                      const Operator *sub );
00158 
00159 
00160 
00167      virtual NeutralElement isOneOrZero() const;
00168 
00169 
00170 
00176      virtual BooleanType isDependingOn( VariableType var ) const;
00177 
00178 
00179 
00185      virtual BooleanType isDependingOn( int           dim      ,    
00186                                           VariableType *varType  ,    
00187                                           int          *component,    
00188                                           BooleanType   *implicit_dep  );
00189 
00190 
00191 
00192 
00200      virtual BooleanType isLinearIn( int           dim      ,    
00201                                        VariableType *varType  ,    
00202                                        int          *component,    
00203                                        BooleanType  *implicit_dep   );
00204 
00205 
00206 
00213      virtual BooleanType isPolynomialIn( int           dim      ,    
00214                                            VariableType *varType  ,    
00215                                            int          *component,    
00216                                            BooleanType  *implicit_dep   );
00217 
00218 
00219 
00226      virtual BooleanType isRationalIn( int           dim      ,    
00227                                          VariableType *varType  ,    
00228                                          int          *component,    
00229                                          BooleanType  *implicit_dep   );
00230 
00231 
00232 
00239      virtual MonotonicityType getMonotonicity( );
00240 
00241 
00242 
00250      virtual CurvatureType getCurvature( );
00251 
00252 
00253 
00259      virtual returnValue setMonotonicity( MonotonicityType monotonicity_ );
00260 
00261 
00262 
00263 
00269      virtual returnValue setCurvature( CurvatureType curvature_  );
00270 
00271 
00272 
00279      virtual returnValue AD_forward( int     number  ,
00280                                      double *seed    ,
00281                                      double *df        );
00283 
00284 
00285 
00293      virtual returnValue AD_forward( int     number  ,
00294                                      double *x       ,
00296                                      double *seed    ,
00297                                      double *f       ,
00299                                      double *df        );
00301 
00302 
00303     // IMPORTANT REMARK FOR AD_BACKWARD: run evaluate first to define
00304     //                                   the point x and to compute f.
00305 
00311      virtual returnValue AD_backward( int    number ,
00313                                       double seed   ,
00314                                       double  *df   );
00316 
00317 
00318 
00326      virtual returnValue AD_forward2( int    number  ,
00328                                       double *seed1  ,
00329                                       double *seed2  ,
00331                                       double *df     ,
00333                                       double *ddf    );
00335 
00336 
00337 
00338     // IMPORTANT REMARK FOR AD_BACKWARD2: run AD_forward first to define
00339     //                                    the point x and to compute f and df.
00340 
00346      virtual returnValue AD_backward2( int    number ,
00348                                        double seed1  ,
00349                                        double seed2  ,
00350                                        double   *df  ,
00352                                        double  *ddf     );
00354 
00355 
00359      virtual std::ostream& print( std::ostream &stream ) const;
00360 
00361 
00365      virtual Operator* clone() const;
00366 
00367 
00368 
00373      virtual returnValue clearBuffer();
00374 
00375 
00376 
00381      virtual returnValue enumerateVariables( SymbolicIndexList *indexList );
00382 
00383 
00384 
00388      virtual OperatorName getName();
00389 
00390 
00391 
00395      virtual BooleanType isVariable( VariableType &varType,
00396                                      int &component          ) const;
00397 
00398 
00399 
00418      virtual returnValue loadIndices( SymbolicIndexList *indexList );
00421 
00422 
00423 
00425      virtual double getValue() const;
00426 
00427 
00428 
00434     virtual BooleanType isSymbolic() const;
00435 
00436 
00437 
00438 //
00439 //  PROTECTED FUNCTIONS:
00440 //
00441 
00442 protected:
00443 
00444 
00445 //
00446 //  PROTECTED MEMBERS:
00447 //
00448 
00449 protected:
00450 
00451      double           value          ;   
00453      NeutralElement   neutralElement ;   
00458 };
00459 
00460 
00461 CLOSE_NAMESPACE_ACADO
00462 
00463 
00464 
00465 #endif


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Thu Aug 27 2015 11:58:07