variable_settings.hpp
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 
33 #ifndef ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
34 #define ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
35 
36 
37 #include <string.h>
38 
40 
41 
43 
44 
45 const char defaultName[] = "-";
46 const char defaultUnit[] = "-";
47 
48 const double defaultScaling = 1.0;
49 const double defaultUpperBound = INFTY;
50 const double defaultLowerBound = -INFTY;
51 
53 
54 
67 {
68  //
69  // PUBLIC MEMBER FUNCTIONS:
70  //
71  public:
72 
76 
88  VariableSettings( uint _dim,
89  VariableType _type = VT_UNKNOWN,
90  const char** const _names = 0,
91  const char** const _units = 0,
92  const DVector& _scaling = emptyConstVector,
93  const DVector& _lb = emptyConstVector,
94  const DVector& _ub = emptyConstVector,
95  BooleanType _autoInit = defaultAutoInit
96  );
97 
103  );
104 
108 
114  );
115 
116 
121  returnValue init( );
122 
136  returnValue init( uint _dim,
137  VariableType _type,
138  const char** const _names,
139  const char** const _units,
140  const DVector& _scaling = emptyConstVector,
141  const DVector& _lb = emptyConstVector,
142  const DVector& _ub = emptyConstVector,
143  BooleanType _autoInit = defaultAutoInit
144  );
145 
146 
155  );
156 
170  const char** const _names,
171  const char** const _units,
172  const DVector& _scaling = emptyConstVector,
173  const DVector& _lb = emptyConstVector,
174  const DVector& _ub = emptyConstVector
175  );
176 
177 
182  inline VariableType getType( ) const;
183 
190  inline returnValue setType( VariableType _type
191  );
192 
193 
203  returnValue getName( uint idx,
204  char* _name
205  ) const;
206 
216  returnValue setName( uint idx,
217  const char* const _name
218  );
219 
220 
230  returnValue getUnit( uint idx,
231  char* _unit
232  ) const;
233 
243  returnValue setUnit( uint idx,
244  const char* const _unit
245  );
246 
247 
252  inline DVector getScaling( ) const;
253 
264  inline returnValue setScaling( const DVector& _scaling
265  );
266 
273  inline double getScaling( uint idx
274  ) const;
275 
287  inline returnValue setScaling( uint idx,
288  double _scaling
289  );
290 
291 
296  inline DVector getLowerBounds( ) const;
297 
305  inline returnValue setLowerBounds( const DVector& _lb
306  );
307 
314  inline double getLowerBound( uint idx
315  ) const;
316 
325  inline returnValue setLowerBound( uint idx,
326  double _lb
327  );
328 
329 
334  inline DVector getUpperBounds( ) const;
335 
343  inline returnValue setUpperBounds( const DVector& _ub
344  );
345 
352  inline double getUpperBound( uint idx
353  ) const;
354 
363  inline returnValue setUpperBound( uint idx,
364  double _ub
365  );
366 
367 
373  inline BooleanType getAutoInit( ) const;
374 
381  inline returnValue setAutoInit( BooleanType _autoInit
382  );
383 
384 
391  inline BooleanType hasNames( ) const;
392 
399  inline BooleanType hasUnits( ) const;
400 
406  inline BooleanType hasScaling( ) const;
407 
414  inline BooleanType hasLowerBounds( ) const;
415 
422  inline BooleanType hasUpperBounds( ) const;
423 
424 
425 
426  //
427  // PROTECTED MEMBER FUNCTIONS:
428  //
429  protected:
430 
435  returnValue clear( );
436 
437 
438 
439  //
440  // DATA MEMBERS:
441  //
442  protected:
443 
447  char** names;
448  char** units;
456 };
457 
458 
460 
461 
462 #include <acado/variables_grid/variable_settings.ipp>
463 
464 
465 #endif // ACADO_TOOLKIT_VARIABLE_SETTINGS_HPP
466 
467 /*
468  * end of file
469  */
double getLowerBound(uint idx) const
returnValue appendSettings(const VariableSettings &rhs)
returnValue setUnit(uint idx, const char *const _unit)
const double INFTY
const double defaultLowerBound
BooleanType hasScaling() const
returnValue getUnit(uint idx, char *_unit) const
returnValue setName(uint idx, const char *const _name)
double getUpperBound(uint idx) const
Allows to pass back messages to the calling function.
returnValue getName(uint idx, char *_name) const
BEGIN_NAMESPACE_ACADO typedef unsigned int uint
Definition: acado_types.hpp:42
returnValue setScaling(const DVector &_scaling)
BooleanType hasUpperBounds() const
DVector getLowerBounds() const
#define CLOSE_NAMESPACE_ACADO
VariableType
Definition: acado_types.hpp:95
DVector getScaling() const
BooleanType getAutoInit() const
returnValue setUpperBound(uint idx, double _ub)
VariableSettings & operator=(const VariableSettings &rhs)
BEGIN_NAMESPACE_ACADO const char defaultName[]
VariableType getType() const
returnValue setAutoInit(BooleanType _autoInit)
static const DVector emptyConstVector
Definition: vector.hpp:336
BooleanType hasLowerBounds() const
const BooleanType defaultAutoInit
returnValue setLowerBounds(const DVector &_lb)
BooleanType hasNames() const
Provides variable-specific settings for vector- or matrix-valued optimization variables (for internal...
void rhs(const real_t *x, real_t *f)
DVector getUpperBounds() const
returnValue setLowerBound(uint idx, double _lb)
#define BT_TRUE
Definition: acado_types.hpp:47
returnValue setType(VariableType _type)
#define BEGIN_NAMESPACE_ACADO
const double defaultScaling
const char defaultUnit[]
returnValue setUpperBounds(const DVector &_ub)
const double defaultUpperBound
BooleanType hasUnits() const


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