exp.cpp
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 #include <acado/utils/acado_utils.hpp>
00036 #include <acado/symbolic_operator/symbolic_operator.hpp>
00037 
00038 
00039 
00040 BEGIN_NAMESPACE_ACADO
00041 
00042 
00043 Exp::Exp():UnaryOperator(){
00044   cName = "exp";
00045 
00046   fcn = &exp;
00047   dfcn = &exp;
00048   ddfcn = &exp;
00049 
00050   operatorName = ON_EXP;
00051 
00052 }
00053 
00054 Exp::Exp( Operator *_argument ):UnaryOperator(_argument){
00055   cName = "exp";
00056 
00057   fcn = &exp;
00058   dfcn = &exp;
00059   ddfcn = &exp;
00060 
00061   operatorName = ON_EXP;
00062 }
00063 
00064 
00065 Exp::Exp( const Exp &arg ):UnaryOperator(arg){
00066   cName = "exp";
00067 
00068   fcn = &exp;
00069   dfcn = &exp;
00070   ddfcn = &exp;
00071 
00072   operatorName = ON_EXP;
00073 }
00074 
00075 
00076 Exp::~Exp(){
00077 
00078 }
00079 
00080 
00081 Exp& Exp::operator=( const Exp &arg ){
00082 
00083   UnaryOperator::operator=(arg);
00084 
00085   return *this;
00086 }
00087 
00088 
00089 returnValue Exp::evaluate( EvaluationBase *x ){
00090  
00091     x->Exp(*argument);
00092     return SUCCESSFUL_RETURN;
00093 }
00094 
00095 
00096 Operator* Exp::substitute( int index, const Operator *sub ){
00097 
00098     return new Exp( argument->substitute( index , sub ) );
00099 
00100 }
00101 
00102 Operator* Exp::clone() const{
00103 
00104     return new Exp(*this);
00105 }
00106 
00107 CurvatureType Exp::getCurvature( ){
00108 
00109     if( curvature != CT_UNKNOWN )  return curvature;
00110 
00111     const CurvatureType cc = argument->getCurvature();
00112 
00113     if( cc == CT_CONSTANT )  return CT_CONSTANT;
00114     if( cc == CT_AFFINE   )  return CT_CONVEX  ;
00115     if( cc == CT_CONVEX   )  return CT_CONVEX  ;
00116 
00117     return CT_NEITHER_CONVEX_NOR_CONCAVE;
00118 }
00119 
00120 returnValue Exp::initDerivative() {
00121 
00122         if( initialized ) return SUCCESSFUL_RETURN;
00123         initialized = BT_TRUE;
00124 
00125         derivative = convert2TreeProjection(new Exp(argument->clone()));
00126         derivative2 = derivative;
00127 
00128         return argument->initDerivative();
00129 }
00130 
00131 CLOSE_NAMESPACE_ACADO
00132 
00133 // end of file.


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:37:01