constraint_component.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_CONSTRAINT_COMPONENT_HPP
00035 #define ACADO_TOOLKIT_CONSTRAINT_COMPONENT_HPP
00036 
00037 
00038 #include <acado/symbolic_expression/symbolic_expression.hpp>
00039 #include <acado/variables_grid/variables_grid.hpp>
00040 
00041 
00042 BEGIN_NAMESPACE_ACADO
00043 
00044 
00056 class ConstraintComponent{
00057 
00058 public:
00059 
00061     ConstraintComponent();
00062 
00063     // --------------------------------------------------------------------------------------------
00064 
00065 
00067     ConstraintComponent( const ConstraintComponent &arg );
00068 
00070     ~ConstraintComponent();
00071 
00073     ConstraintComponent& operator=( const ConstraintComponent &arg );
00074 
00075 
00077     ConstraintComponent operator()( const uint &index ) const;
00078 
00079 
00081     returnValue initialize( const DVector& lb, Expression arg, const DVector& ub );
00082 
00083 
00085     returnValue initialize( const VariablesGrid& lb, Expression arg, const VariablesGrid& ub );
00086 
00087 
00088     // --------------------------------------------------------------------------------------------
00089 
00090 
00091     // Friend Functions:
00092     // -----------------
00093     friend ConstraintComponent operator<=( double lb_, const ConstraintComponent &arg );
00094     friend ConstraintComponent operator>=( double ub_, const ConstraintComponent &arg );
00095 
00096     friend ConstraintComponent operator<=( DVector lb_, const ConstraintComponent &arg );
00097     friend ConstraintComponent operator>=( DVector ub_, const ConstraintComponent &arg );
00098 
00099     friend ConstraintComponent operator<=( VariablesGrid lb_, const ConstraintComponent &arg );
00100     friend ConstraintComponent operator>=( VariablesGrid ub_, const ConstraintComponent &arg );
00101 
00102 
00103     // --------------------------------------------------------------------------------------------
00104 
00105 
00106     // Operators:
00107     // ----------
00108     inline ConstraintComponent operator<=( const double& ub ) const;
00109     inline ConstraintComponent operator>=( const double& lb ) const;
00110     inline ConstraintComponent operator==( const double&  b ) const;
00111 
00112     inline ConstraintComponent operator<=( const DVector& ub ) const;
00113     inline ConstraintComponent operator>=( const DVector& lb ) const;
00114     inline ConstraintComponent operator==( const DVector&  b ) const;
00115 
00116     inline ConstraintComponent operator<=( const VariablesGrid& ub ) const;
00117     inline ConstraintComponent operator>=( const VariablesGrid& lb ) const;
00118     inline ConstraintComponent operator==( const VariablesGrid&  b ) const;
00119 
00120 
00121     // --------------------------------------------------------------------------------------------
00122 
00123     inline const DVector& getLB() const;
00124     inline const DVector& getUB() const;
00125 
00126     inline returnValue setLB( const double&        lb_ );
00127     inline returnValue setLB( const DVector&        lb_ );
00128     inline returnValue setLB( const VariablesGrid& lb_ );
00129 
00130     inline returnValue setUB( const double&        lb_ );
00131     inline returnValue setUB( const DVector&        lb_ );
00132     inline returnValue setUB( const VariablesGrid& lb_ );
00133 
00134     inline Expression getExpression( ) const;
00135 
00136     inline BooleanType hasUBgrid( ) const;
00137     inline BooleanType hasLBgrid( ) const;
00138 
00139     inline const VariablesGrid& getLBgrid() const;
00140     inline const VariablesGrid& getUBgrid() const;
00141 
00142     inline uint getDim( ) const;
00143 
00144 
00145 //
00146 //  PROTECTED MEMBERS:
00147 //
00148 
00149 protected:
00150 
00151     Expression     expression  ;
00152 
00153     DVector         lb          ;
00154     DVector         ub          ;
00155 
00156     VariablesGrid  lbGrid      ;
00157     VariablesGrid  ubGrid      ;
00158 };
00159 
00160 ConstraintComponent operator<=( const Expression& arg, const double& ub );
00161 ConstraintComponent operator>=( const Expression& arg, const double& lb );
00162 ConstraintComponent operator==( const Expression& arg, const double&  b );
00163 
00164 ConstraintComponent operator<=( const Expression& arg, const DVector& ub );
00165 ConstraintComponent operator>=( const Expression& arg, const DVector& lb );
00166 ConstraintComponent operator==( const Expression& arg, const DVector&  b );
00167 
00168 ConstraintComponent operator<=( const Expression& arg, const VariablesGrid& ub );
00169 ConstraintComponent operator>=( const Expression& arg, const VariablesGrid& lb );
00170 ConstraintComponent operator==( const Expression& arg, const VariablesGrid&  b );
00171 
00172 ConstraintComponent operator<=( double lb, const Expression &arg );
00173 ConstraintComponent operator==( double  b, const Expression &arg );
00174 ConstraintComponent operator>=( double ub, const Expression &arg );
00175 
00176 ConstraintComponent operator<=( DVector lb, const Expression &arg );
00177 ConstraintComponent operator==( DVector  b, const Expression &arg );
00178 ConstraintComponent operator>=( DVector ub, const Expression &arg );
00179 
00180 ConstraintComponent operator<=( VariablesGrid lb, const Expression &arg );
00181 ConstraintComponent operator==( VariablesGrid  b, const Expression &arg );
00182 ConstraintComponent operator>=( VariablesGrid ub, const Expression &arg );
00183 
00184 CLOSE_NAMESPACE_ACADO
00185 
00186 #include <acado/symbolic_expression/constraint_component.ipp>
00187 
00188 #endif


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