Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

Provides variable-specific settings for vector- or matrix-valued optimization variables (for internal use). More...

#include <variable_settings.hpp>

Inheritance diagram for VariableSettings:
Inheritance graph
[legend]

Public Member Functions

returnValue appendSettings (const VariableSettings &rhs)
 
returnValue appendSettings (uint _dim, const char **const _names, const char **const _units, const DVector &_scaling=emptyConstVector, const DVector &_lb=emptyConstVector, const DVector &_ub=emptyConstVector)
 
BooleanType getAutoInit () const
 
double getLowerBound (uint idx) const
 
DVector getLowerBounds () const
 
returnValue getName (uint idx, char *_name) const
 
DVector getScaling () const
 
double getScaling (uint idx) const
 
VariableType getType () const
 
returnValue getUnit (uint idx, char *_unit) const
 
double getUpperBound (uint idx) const
 
DVector getUpperBounds () const
 
BooleanType hasLowerBounds () const
 
BooleanType hasNames () const
 
BooleanType hasScaling () const
 
BooleanType hasUnits () const
 
BooleanType hasUpperBounds () const
 
returnValue init ()
 
returnValue init (uint _dim, VariableType _type, const char **const _names, const char **const _units, const DVector &_scaling=emptyConstVector, const DVector &_lb=emptyConstVector, const DVector &_ub=emptyConstVector, BooleanType _autoInit=defaultAutoInit)
 
VariableSettingsoperator= (const VariableSettings &rhs)
 
returnValue setAutoInit (BooleanType _autoInit)
 
returnValue setLowerBound (uint idx, double _lb)
 
returnValue setLowerBounds (const DVector &_lb)
 
returnValue setName (uint idx, const char *const _name)
 
returnValue setScaling (const DVector &_scaling)
 
returnValue setScaling (uint idx, double _scaling)
 
returnValue setType (VariableType _type)
 
returnValue setUnit (uint idx, const char *const _unit)
 
returnValue setUpperBound (uint idx, double _ub)
 
returnValue setUpperBounds (const DVector &_ub)
 
 VariableSettings ()
 
 VariableSettings (uint _dim, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, const DVector &_scaling=emptyConstVector, const DVector &_lb=emptyConstVector, const DVector &_ub=emptyConstVector, BooleanType _autoInit=defaultAutoInit)
 
 VariableSettings (const VariableSettings &rhs)
 
 ~VariableSettings ()
 

Protected Member Functions

returnValue clear ()
 

Protected Attributes

BooleanType autoInit
 
uint dim
 
DVector lb
 
char ** names
 
DVector scaling
 
VariableType type
 
DVector ub
 
char ** units
 

Detailed Description

Provides variable-specific settings for vector- or matrix-valued optimization variables (for internal use).

The class VariableSettings provides variable-specific settings for enhancing a DVector or a DMatrix to vector- or matrix-valued optimization variables. It is intended for internal use only.

Author
Hans Joachim Ferreau, Boris Houska

Definition at line 66 of file variable_settings.hpp.

Constructor & Destructor Documentation

BEGIN_NAMESPACE_ACADO VariableSettings::VariableSettings ( )

Default constructor.

Definition at line 46 of file variable_settings.cpp.

VariableSettings::VariableSettings ( uint  _dim,
VariableType  _type = VT_UNKNOWN,
const char **const  _names = 0,
const char **const  _units = 0,
const DVector _scaling = emptyConstVector,
const DVector _lb = emptyConstVector,
const DVector _ub = emptyConstVector,
BooleanType  _autoInit = defaultAutoInit 
)

Constructor which takes all settings.

@param[in] _dim                     Dimension of variable.
@param[in] _type            Type of the variable.
@param[in] _names           Array containing name labels for each component of the variable.
@param[in] _units           Array containing unit labels for each component of the variable.
@param[in] _scaling         Scaling for each component of the variable.
@param[in] _lb                      Lower bounds for each component of the variable.
@param[in] _ub                      Upper bounds for each component of the variable.
@param[in] _autoInit        Flag indicating whether variable is to be automatically initialized.

Definition at line 58 of file variable_settings.cpp.

VariableSettings::VariableSettings ( const VariableSettings rhs)

Copy constructor (deep copy).

@param[in] rhs      Right-hand side object.

Definition at line 75 of file variable_settings.cpp.

VariableSettings::~VariableSettings ( )

Destructor.

Definition at line 145 of file variable_settings.cpp.

Member Function Documentation

returnValue VariableSettings::appendSettings ( const VariableSettings rhs)

Appends given VariableSettings object as additional components to the current one.

Parameters
[in]rhsVariableSettings to be appended.
Returns
SUCCESSFUL_RETURN

Definition at line 264 of file variable_settings.cpp.

returnValue VariableSettings::appendSettings ( uint  _dim,
const char **const  _names,
const char **const  _units,
const DVector _scaling = emptyConstVector,
const DVector _lb = emptyConstVector,
const DVector _ub = emptyConstVector 
)

Appends given VariableSettings object as additional components to the current one.

Parameters
[in]_dimDimension of variable.
[in]_namesArray containing name labels for each component of the variable.
[in]_unitsArray containing unit labels for each component of the variable.
[in]_scalingArray containing the scaling for each component of the variable.
[in]_lbArray containing lower bounds for each component of the variable.
[in]_ubArray containing upper bounds for each component of the variable.
Returns
SUCCESSFUL_RETURN

Definition at line 271 of file variable_settings.cpp.

returnValue VariableSettings::clear ( )
protected

Clears all settings.

Returns
SUCCESSFUL_RETURN

Definition at line 539 of file variable_settings.cpp.

BooleanType VariableSettings::getAutoInit ( ) const
inline

Returns whether automatic initialization is enabled or not.

Returns
BT_TRUE iff automatic initialization is enabled,
BT_FALSE otherwise
double VariableSettings::getLowerBound ( uint  idx) const
inline

Returns current lower bound of given component.

@param[in] idx              Index of component.
Returns
Current lower bound of given component
DVector VariableSettings::getLowerBounds ( ) const
inline

Returns current lower bounds.

Returns
Current lower bounds
returnValue VariableSettings::getName ( uint  idx,
char *  _name 
) const

Returns current name label of given component.

@param[in]  idx                     Index of component.
@param[out] _name           Name label of given component.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

Definition at line 441 of file variable_settings.cpp.

DVector VariableSettings::getScaling ( ) const
inline

Returns current scaling.

Returns
Current scaling
double VariableSettings::getScaling ( uint  idx) const
inline

Returns current scaling of given component.

@param[in] idx              Index of component.
Returns
Current scaling of given component
VariableType VariableSettings::getType ( ) const
inline

Returns current variable type.

Returns
Current variable type
returnValue VariableSettings::getUnit ( uint  idx,
char *  _unit 
) const

Returns current unit label of given component.

@param[in]  idx                     Index of component.
@param[out] _unit           Unit label of given component.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

Definition at line 488 of file variable_settings.cpp.

double VariableSettings::getUpperBound ( uint  idx) const
inline

Returns current upper bound of given component.

@param[in] idx              Index of component.
Returns
Current upper bound of given component
DVector VariableSettings::getUpperBounds ( ) const
inline

Returns current upper bounds.

Returns
Current upper bounds
BooleanType VariableSettings::hasLowerBounds ( ) const
inline

Returns whether VariableSettings comprises lower bounds (at at least one of its grid points).

Returns
BT_TRUE iff VariableSettings comprises lower bounds,
BT_FALSE otherwise
BooleanType VariableSettings::hasNames ( ) const
inline

Returns whether VariableSettings comprises (non-empty) name labels (at at least one of its grid points).

Returns
BT_TRUE iff VariableSettings comprises name labels,
BT_FALSE otherwise
BooleanType VariableSettings::hasScaling ( ) const
inline

Returns whether scaling is set (at at least one grid point).

Returns
BT_TRUE iff scaling is set,
BT_FALSE otherwise
BooleanType VariableSettings::hasUnits ( ) const
inline

Returns whether VariableSettings comprises (non-empty) unit labels (at at least one of its grid points).

Returns
BT_TRUE iff VariableSettings comprises unit labels,
BT_FALSE otherwise
BooleanType VariableSettings::hasUpperBounds ( ) const
inline

Returns whether VariableSettings comprises upper bounds (at at least one of its grid points).

Returns
BT_TRUE iff VariableSettings comprises upper bounds,
BT_FALSE otherwise
returnValue VariableSettings::init ( )

Initializes empty object.

\return SUCCESSFUL_RETURN

Definition at line 228 of file variable_settings.cpp.

returnValue VariableSettings::init ( uint  _dim,
VariableType  _type,
const char **const  _names,
const char **const  _units,
const DVector _scaling = emptyConstVector,
const DVector _lb = emptyConstVector,
const DVector _ub = emptyConstVector,
BooleanType  _autoInit = defaultAutoInit 
)

Initializes object with given dimension and settings.

@param[in] _dim                     Dimension of variable.
@param[in] _type            Type of the variable.
@param[in] _names           Array containing name labels for each component of the variable.
@param[in] _units           Array containing unit labels for each component of the variable.
@param[in] _scaling         Array containing the scaling for each component of the variable.
@param[in] _lb                      Array containing lower bounds for each component of the variable.
@param[in] _ub                      Array containing upper bounds for each component of the variable.
@param[in] _autoInit        Array defining if each component of the variable is to be automatically initialized.

\return SUCCESSFUL_RETURN

Definition at line 244 of file variable_settings.cpp.

VariableSettings & VariableSettings::operator= ( const VariableSettings rhs)

Copy constructor (deep copy).

@param[in] rhs      Right-hand side object.

Definition at line 151 of file variable_settings.cpp.

returnValue VariableSettings::setAutoInit ( BooleanType  _autoInit)
inline

Assigns new auto initialization flag.

@param[in] _autoInit        New auto initialization flag.
Returns
SUCCESSFUL_RETURN
returnValue VariableSettings::setLowerBound ( uint  idx,
double  _lb 
)
inline

Assigns new lower bound to given component.

@param[in] idx              Index of component.
@param[in] _lb              New lower bound.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS
returnValue VariableSettings::setLowerBounds ( const DVector _lb)
inline

Assigns new lower bounds.

@param[in] _lb              New lower bounds.
Returns
SUCCESSFUL_RETURN,
RET_VECTOR_DIMENSION_MISMATCH
returnValue VariableSettings::setName ( uint  idx,
const char *const  _name 
)

Assigns new name label to given component.

@param[in]  idx                     Index of component.
@param[in]  _name           New name label.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

Definition at line 458 of file variable_settings.cpp.

returnValue VariableSettings::setScaling ( const DVector _scaling)
inline

Assigns new scaling.

@param[in] _scaling         New scaling.

\note Scaling factors need to be positive.
Returns
SUCCESSFUL_RETURN,
RET_VECTOR_DIMENSION_MISMATCH,
RET_INVALID_ARGUMENTS
returnValue VariableSettings::setScaling ( uint  idx,
double  _scaling 
)
inline

Assigns new scaling to given component.

@param[in] idx                      Index of component.
@param[in] _scaling         New scaling.

\note Scaling factor needs to be positive.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_INVALID_ARGUMENTS
returnValue VariableSettings::setType ( VariableType  _type)
inline

Assigns new variable type.

@param[in] _type            New variable type.
Returns
SUCCESSFUL_RETURN
returnValue VariableSettings::setUnit ( uint  idx,
const char *const  _unit 
)

Assigns new unit label to given component.

@param[in]  idx                     Index of component.
@param[in]  _unit           New unit label.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_MEMBER_NOT_INITIALISED

Definition at line 505 of file variable_settings.cpp.

returnValue VariableSettings::setUpperBound ( uint  idx,
double  _ub 
)
inline

Assigns new upper bound to given component.

@param[in] idx              Index of component.
@param[in] _ub              New upper bound.
Returns
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS
returnValue VariableSettings::setUpperBounds ( const DVector _ub)
inline

Assigns new upper bounds.

@param[in] _ub              New upper bounds.
Returns
SUCCESSFUL_RETURN,
RET_VECTOR_DIMENSION_MISMATCH

Member Data Documentation

BooleanType VariableSettings::autoInit
protected

Flag indicating whether variable is to be automatically initialized.

Definition at line 455 of file variable_settings.hpp.

uint VariableSettings::dim
protected

Dimension of variable.

Definition at line 444 of file variable_settings.hpp.

DVector VariableSettings::lb
protected

Lower bounds for each component of the variable.

Definition at line 452 of file variable_settings.hpp.

char** VariableSettings::names
protected

Array containing name labels for each component of the variable..

Definition at line 447 of file variable_settings.hpp.

DVector VariableSettings::scaling
protected

Scaling for each component of the variable.

Definition at line 450 of file variable_settings.hpp.

VariableType VariableSettings::type
protected

Type of the variable.

Definition at line 445 of file variable_settings.hpp.

DVector VariableSettings::ub
protected

Upper bounds for each component of the variable.

Definition at line 453 of file variable_settings.hpp.

char** VariableSettings::units
protected

Array containing unit labels for each component of the variable..

Definition at line 448 of file variable_settings.hpp.


The documentation for this class was generated from the following files:


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