variable_settings.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 
00033 #ifndef ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
00034 #define ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
00035 
00036 
00037 #include <string.h>
00038 
00039 #include <acado/matrix_vector/matrix_vector.hpp>
00040 
00041 
00042 BEGIN_NAMESPACE_ACADO
00043 
00044 
00045 const char defaultName[] = "-";
00046 const char defaultUnit[] = "-";
00047 
00048 const double defaultScaling = 1.0;
00049 const double defaultUpperBound =  INFTY;
00050 const double defaultLowerBound = -INFTY;
00051 
00052 const BooleanType defaultAutoInit = BT_TRUE;
00053 
00054 
00066 class VariableSettings
00067 {
00068     //
00069     // PUBLIC MEMBER FUNCTIONS:
00070     //
00071     public:
00072 
00075         VariableSettings( );
00076 
00088         VariableSettings(       uint _dim,
00089                                                         VariableType _type = VT_UNKNOWN,
00090                                                         const char** const _names = 0,
00091                                                         const char** const _units = 0,
00092                                                         const DVector& _scaling = emptyConstVector,
00093                                                         const DVector& _lb = emptyConstVector,
00094                                                         const DVector& _ub = emptyConstVector,
00095                                                         BooleanType _autoInit = defaultAutoInit
00096                                                         );
00097 
00102                 VariableSettings(       const VariableSettings& rhs
00103                                                         );
00104 
00107                 ~VariableSettings( );
00108 
00113                 VariableSettings& operator=(    const VariableSettings& rhs
00114                                                                                 );
00115 
00116 
00121                 returnValue init( );
00122 
00136                 returnValue init(       uint _dim,
00137                                                         VariableType _type,
00138                                                         const char** const _names,
00139                                                         const char** const _units,
00140                                                         const DVector& _scaling = emptyConstVector,
00141                                                         const DVector& _lb = emptyConstVector,
00142                                                         const DVector& _ub = emptyConstVector,
00143                                                         BooleanType _autoInit = defaultAutoInit
00144                                                         );
00145 
00146 
00154                 returnValue appendSettings(     const VariableSettings& rhs
00155                                                                         );
00156 
00169                 returnValue appendSettings(     uint _dim,
00170                                                                         const char** const _names,
00171                                                                         const char** const _units,
00172                                                                         const DVector& _scaling = emptyConstVector,
00173                                                                         const DVector& _lb = emptyConstVector,
00174                                                                         const DVector& _ub = emptyConstVector
00175                                                                         );
00176 
00177 
00182         inline VariableType getType( ) const;
00183 
00190         inline returnValue setType(     VariableType _type
00191                                                                         );
00192 
00193 
00203                 returnValue getName(    uint idx,
00204                                                                 char* _name
00205                                                                 ) const;
00206 
00216                 returnValue setName(    uint idx,
00217                                                                 const char* const _name
00218                                                                 );
00219 
00220 
00230                 returnValue getUnit(    uint idx,
00231                                                                 char* _unit
00232                                                                 ) const;
00233 
00243                 returnValue setUnit(    uint idx,
00244                                                                 const char* const _unit
00245                                                                 );
00246 
00247 
00252                 inline DVector getScaling( ) const;
00253 
00264                 inline returnValue setScaling(  const DVector& _scaling
00265                                                                                 );
00266 
00273                 inline double getScaling(       uint idx
00274                                                                         ) const;
00275 
00287                 inline returnValue setScaling(  uint idx,
00288                                                                                 double _scaling
00289                                                                                 );
00290 
00291 
00296                 inline DVector getLowerBounds( ) const;
00297 
00305                 inline returnValue setLowerBounds(      const DVector& _lb
00306                                                                                         );
00307 
00314                 inline double getLowerBound(    uint idx
00315                                                                                 ) const;
00316 
00325                 inline returnValue setLowerBound(       uint idx,
00326                                                                                         double _lb
00327                                                                                         );
00328 
00329 
00334                 inline DVector getUpperBounds( ) const;
00335 
00343                 inline returnValue setUpperBounds(      const DVector& _ub
00344                                                                                         );
00345 
00352                 inline double getUpperBound(    uint idx
00353                                                                                 ) const;
00354 
00363                 inline returnValue setUpperBound(       uint idx,
00364                                                                                         double _ub
00365                                                                                         );
00366 
00367 
00373                 inline BooleanType getAutoInit( ) const;
00374 
00381                 inline returnValue setAutoInit( BooleanType _autoInit
00382                                                                                 );
00383 
00384 
00391                 inline BooleanType hasNames( ) const;
00392 
00399                 inline BooleanType hasUnits( ) const;
00400 
00406                 inline BooleanType hasScaling( ) const;
00407 
00414                 inline BooleanType hasLowerBounds( ) const;
00415 
00422                 inline BooleanType hasUpperBounds( ) const;
00423 
00424 
00425 
00426     //
00427     // PROTECTED MEMBER FUNCTIONS:
00428     //
00429     protected:
00430 
00435                 returnValue clear( );
00436 
00437 
00438 
00439     //
00440     // DATA MEMBERS:
00441     //
00442     protected:
00443 
00444                 uint dim;                                                       
00445                 VariableType type;                                      
00447                 char** names;                                           
00448                 char** units;                                           
00450                 DVector scaling;                        
00452                 DVector lb;                             
00453                 DVector ub;                             
00455         BooleanType autoInit;                           
00456 };
00457 
00458 
00459 CLOSE_NAMESPACE_ACADO
00460 
00461 
00462 #include <acado/variables_grid/variable_settings.ipp>
00463 
00464 
00465 #endif  // ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
00466 
00467 /*
00468  *      end of file
00469  */


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