exp.cpp
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 
37 
38 
39 
41 
42 
44  cName = "exp";
45 
46  fcn = &exp;
47  dfcn = &exp;
48  ddfcn = &exp;
49 
51 
52 }
53 
54 Exp::Exp( Operator *_argument ):UnaryOperator(_argument){
55  cName = "exp";
56 
57  fcn = &exp;
58  dfcn = &exp;
59  ddfcn = &exp;
60 
62 }
63 
64 
65 Exp::Exp( const Exp &arg ):UnaryOperator(arg){
66  cName = "exp";
67 
68  fcn = &exp;
69  dfcn = &exp;
70  ddfcn = &exp;
71 
73 }
74 
75 
77 
78 }
79 
80 
81 Exp& Exp::operator=( const Exp &arg ){
82 
84 
85  return *this;
86 }
87 
88 
90 
91  x->Exp(*argument);
92  return SUCCESSFUL_RETURN;
93 }
94 
95 
96 Operator* Exp::substitute( int index, const Operator *sub ){
97 
98  return new Exp( argument->substitute( index , sub ) );
99 
100 }
101 
103 
104  return new Exp(*this);
105 }
106 
108 
109  if( curvature != CT_UNKNOWN ) return curvature;
110 
111  const CurvatureType cc = argument->getCurvature();
112 
113  if( cc == CT_CONSTANT ) return CT_CONSTANT;
114  if( cc == CT_AFFINE ) return CT_CONVEX ;
115  if( cc == CT_CONVEX ) return CT_CONVEX ;
116 
118 }
119 
121 
122  if( initialized ) return SUCCESSFUL_RETURN;
124 
127 
128  return argument->initDerivative();
129 }
130 
132 
133 // end of file.
Operator * derivative2
Exp & operator=(const Exp &arg)
Definition: exp.cpp:81
Abstract base class for all scalar-valued symbolic operators.
Definition: operator.hpp:60
double(* ddfcn)(double)
Operator * derivative
Abstract base class for all scalar-valued unary operators within the symbolic operators family...
Allows to pass back messages to the calling function.
virtual Operator * clone() const =0
virtual Operator * substitute(int index, const Operator *sub)=0
#define CLOSE_NAMESPACE_ACADO
Operator * argument
BooleanType initialized
Definition: operator.hpp:642
double(* dfcn)(double)
UnaryOperator & operator=(const UnaryOperator &arg)
virtual returnValue initDerivative()
Definition: exp.cpp:120
Exp()
Definition: exp.cpp:43
virtual returnValue evaluate(EvaluationBase *x)
Definition: exp.cpp:89
~Exp()
Definition: exp.cpp:76
Implements the scalar exponential operator within the symbolic operators family.
Definition: exp.hpp:55
virtual returnValue initDerivative()
Definition: operator.cpp:519
virtual Operator * substitute(int index, const Operator *sub)
Definition: exp.cpp:96
CurvatureType curvature
#define BT_TRUE
Definition: acado_types.hpp:47
virtual void Exp(Operator &arg)=0
std::string cName
OperatorName operatorName
CurvatureType
virtual TreeProjection * convert2TreeProjection(Operator *a) const
Definition: operator.cpp:312
#define BEGIN_NAMESPACE_ACADO
Abstract base class for templated evaluation of operators.
virtual CurvatureType getCurvature()=0
IntermediateState exp(const Expression &arg)
virtual CurvatureType getCurvature()
Definition: exp.cpp:107
double(* fcn)(double)
virtual Operator * clone() const
Definition: exp.cpp:102


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