smooth_operator.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 #include <acado/symbolic_expression/symbolic_expression.hpp>
00038 #include <acado/symbolic_expression/constraint_component.hpp>
00039 
00040 
00041 BEGIN_NAMESPACE_ACADO
00042 
00043 
00044 SmoothOperator::SmoothOperator() : Operator( )
00045 {
00046 }
00047 
00048 SmoothOperator::~SmoothOperator()
00049 {
00050 }
00051 
00052 
00053 Operator& SmoothOperator::operator=( const double &arg ){
00054 
00055     ACADOERROR( RET_UNKNOWN_BUG );
00056     ASSERT( 1 == 0 );
00057     return emptyTreeProjection;
00058 }
00059 
00060 Operator& SmoothOperator::operator=( const DVector &arg ){
00061 
00062     ACADOERROR( RET_UNKNOWN_BUG );
00063     ASSERT( 1 == 0 );
00064     return emptyTreeProjection;
00065 }
00066 
00067 Operator& SmoothOperator::operator=( const DMatrix &arg ){
00068 
00069     ACADOERROR( RET_UNKNOWN_BUG );
00070     ASSERT( 1 == 0 );
00071     return emptyTreeProjection;
00072 }
00073 
00074 Operator& SmoothOperator::operator=( const Expression &arg ){
00075 
00076     ACADOERROR( RET_UNKNOWN_BUG );
00077     ASSERT( 1 == 0 );
00078     return emptyTreeProjection;
00079 }
00080 
00081 Operator& SmoothOperator::operator=( const Operator &arg ){
00082 
00083     ACADOERROR( RET_UNKNOWN_BUG );
00084     ASSERT( 1 == 0 );
00085     return emptyTreeProjection;
00086 }
00087 
00088 
00089 TreeProjection* SmoothOperator::cloneTreeProjection() const{
00090 
00091     // if this routine is ever called something went
00092     // really wrong ....
00093 
00094     ACADOERROR( RET_UNKNOWN_BUG );
00095     ASSERT( 1 == 0 );
00096     return new TreeProjection();
00097 }
00098 
00099 
00100 
00101 
00102 Operator& SmoothOperator::operator+=( const double    & arg ){ return operator=( this->operator+(arg) ); }
00103 Operator& SmoothOperator::operator+=( const DVector    & arg ){ return operator=( this->operator+(arg) ); }
00104 Operator& SmoothOperator::operator+=( const DMatrix    & arg ){ return operator=( this->operator+(arg) ); }
00105 Operator& SmoothOperator::operator+=( const Expression& arg ){ return operator=( this->operator+(arg) ); }
00106 
00107 Operator& SmoothOperator::operator-=( const double      & arg ){ return operator=( this->operator-(arg) ); }
00108 Operator& SmoothOperator::operator-=( const DVector      & arg ){ return operator=( this->operator-(arg) ); }
00109 Operator& SmoothOperator::operator-=( const DMatrix      & arg ){ return operator=( this->operator-(arg) ); }
00110 Operator& SmoothOperator::operator-=( const Expression  & arg ){ return operator=( this->operator-(arg) ); }
00111 
00112 Operator& SmoothOperator::operator*=( const double      & arg ){ return operator=( this->operator*(arg) ); }
00113 Operator& SmoothOperator::operator*=( const DVector      & arg ){ return operator=( this->operator*(arg) ); }
00114 Operator& SmoothOperator::operator*=( const DMatrix      & arg ){ return operator=( this->operator*(arg) ); }
00115 Operator& SmoothOperator::operator*=( const Expression  & arg ){ return operator=( this->operator*(arg) ); }
00116 
00117 Operator& SmoothOperator::operator/=( const double      & arg ){ return operator=( this->operator/(arg) ); }
00118 Operator& SmoothOperator::operator/=( const Expression  & arg ){ return operator=( this->operator/(arg) ); }
00119 
00120 
00121 
00122 
00123 Expression SmoothOperator::operator+( const double        & arg ) const{ return Expression(*this)+arg; }
00124 Expression SmoothOperator::operator+( const DVector        & arg ) const{ return Expression(*this)+arg; }
00125 Expression SmoothOperator::operator+( const DMatrix        & arg ) const{ return Expression(*this)+arg; }
00126 Expression SmoothOperator::operator+( const Operator& arg ) const{ return Expression(*this)+arg; }
00127 Expression SmoothOperator::operator+( const Expression    & arg ) const{ return Expression(*this)+arg; }
00128 
00129 Expression SmoothOperator::operator-( const double        & arg ) const{ return Expression(*this)-arg; }
00130 Expression SmoothOperator::operator-( const DVector        & arg ) const{ return Expression(*this)-arg; }
00131 Expression SmoothOperator::operator-( const DMatrix        & arg ) const{ return Expression(*this)-arg; }
00132 Expression SmoothOperator::operator-( const Operator& arg ) const{ return Expression(*this)-arg; }
00133 Expression SmoothOperator::operator-( const Expression    & arg ) const{ return Expression(*this)-arg; }
00134 
00135 Expression SmoothOperator::operator-( ) const{ return -Expression(*this); }
00136 
00137 Expression SmoothOperator::operator*( const double        & arg ) const{ return Expression(*this)*arg; }
00138 Expression SmoothOperator::operator*( const DVector        & arg ) const{ return Expression(*this)*arg; }
00139 Expression SmoothOperator::operator*( const DMatrix        & arg ) const{ return Expression(*this)*arg; }
00140 
00141 
00142 Expression SmoothOperator::operator*( const Operator& arg ) const{
00143 
00144     Expression tmp2(arg);
00145 
00146 
00147     Expression tmp1(*this);
00148 
00149 
00150     return tmp1*tmp2;
00151 }
00152 
00153 
00154 Expression SmoothOperator::operator*( const Expression    & arg ) const{ return Expression(*this)*arg; }
00155 
00156 Expression SmoothOperator::operator/( const double        & arg ) const{ return Expression(*this)/arg; }
00157 Expression SmoothOperator::operator/( const Operator& arg ) const{ return Expression(*this)/arg; }
00158 Expression SmoothOperator::operator/( const Expression    & arg ) const{ return Expression(*this)/arg; }
00159 
00160 ConstraintComponent SmoothOperator::operator<=( const double& ub ) const{ return Expression(*this) <= ub; }
00161 ConstraintComponent SmoothOperator::operator>=( const double& lb ) const{ return Expression(*this) >= lb; }
00162 ConstraintComponent SmoothOperator::operator==( const double&  b ) const{ return Expression(*this) ==  b; }
00163 
00164 ConstraintComponent SmoothOperator::operator<=( const DVector& ub ) const{ return Expression(*this) <= ub; }
00165 ConstraintComponent SmoothOperator::operator>=( const DVector& lb ) const{ return Expression(*this) >= lb; }
00166 ConstraintComponent SmoothOperator::operator==( const DVector&  b ) const{ return Expression(*this) ==  b; }
00167 
00168 ConstraintComponent SmoothOperator::operator<=( const VariablesGrid& ub ) const{ return Expression(*this) <= ub; }
00169 ConstraintComponent SmoothOperator::operator>=( const VariablesGrid& lb ) const{ return Expression(*this) >= lb; }
00170 ConstraintComponent SmoothOperator::operator==( const VariablesGrid&  b ) const{ return Expression(*this) ==  b; }
00171 
00172 
00173 BooleanType SmoothOperator::isSmooth( ) const
00174 {
00175     return BT_TRUE;
00176 }
00177 
00178 
00179 double SmoothOperator::getValue() const{ return INFTY; }
00180 
00181 int SmoothOperator::getGlobalIndex( ) const{
00182 
00183         ACADOERROR( RET_UNKNOWN_BUG );
00184     return -1;
00185 }
00186 
00187 
00188 Operator* SmoothOperator::passArgument() const{
00189 
00190     return 0;
00191 }
00192 
00193 CLOSE_NAMESPACE_ACADO
00194 
00195 
00196 // end of file.


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