Public Member Functions | Protected Member Functions | Protected Attributes

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]

List of all members.

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

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.

Parameters:
[in]_dimDimension of variable.
[in]_typeType of the variable.
[in]_namesArray containing name labels for each component of the variable.
[in]_unitsArray containing unit labels for each component of the variable.
[in]_scalingScaling for each component of the variable.
[in]_lbLower bounds for each component of the variable.
[in]_ubUpper bounds for each component of the variable.
[in]_autoInitFlag indicating whether variable is to be automatically initialized.

Definition at line 58 of file variable_settings.cpp.

Copy constructor (deep copy).

Parameters:
[in]rhsRight-hand side object.

Definition at line 75 of file variable_settings.cpp.

Destructor.

Definition at line 145 of file variable_settings.cpp.


Member Function Documentation

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.

Clears all settings.

Returns:
SUCCESSFUL_RETURN

Definition at line 539 of file variable_settings.cpp.

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.

Parameters:
[in]idxIndex of component.
Returns:
Current lower bound of given component

Returns current lower bounds.

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

Returns current name label of given component.

Parameters:
[in]idxIndex of component.
[out]_nameName 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.

Returns current scaling.

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

Returns current scaling of given component.

Parameters:
[in]idxIndex of component.
Returns:
Current scaling of given component

Returns current variable type.

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

Returns current unit label of given component.

Parameters:
[in]idxIndex of component.
[out]_unitUnit 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.

Parameters:
[in]idxIndex of component.
Returns:
Current upper bound of given component

Returns current upper bounds.

Returns:
Current upper bounds

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

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

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

Returns:
BT_TRUE iff scaling is set,
BT_FALSE otherwise

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

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

Initializes empty object.

Returns:
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.

Parameters:
[in]_dimDimension of variable.
[in]_typeType of the 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.
[in]_autoInitArray defining if each component of the variable is to be automatically initialized.
Returns:
SUCCESSFUL_RETURN

Definition at line 244 of file variable_settings.cpp.

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

Copy constructor (deep copy).

Parameters:
[in]rhsRight-hand side object.

Definition at line 151 of file variable_settings.cpp.

Assigns new auto initialization flag.

Parameters:
[in]_autoInitNew auto initialization flag.
Returns:
SUCCESSFUL_RETURN
returnValue VariableSettings::setLowerBound ( uint  idx,
double  _lb 
) [inline]

Assigns new lower bound to given component.

Parameters:
[in]idxIndex of component.
[in]_lbNew lower bound.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

Assigns new lower bounds.

Parameters:
[in]_lbNew 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.

Parameters:
[in]idxIndex of component.
[in]_nameNew 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.

Parameters:
[in]_scalingNew 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.

Parameters:
[in]idxIndex of component.
[in]_scalingNew scaling.
Note:
Scaling factor needs to be positive.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS,
RET_INVALID_ARGUMENTS

Assigns new variable type.

Parameters:
[in]_typeNew variable type.
Returns:
SUCCESSFUL_RETURN
returnValue VariableSettings::setUnit ( uint  idx,
const char *const  _unit 
)

Assigns new unit label to given component.

Parameters:
[in]idxIndex of component.
[in]_unitNew 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.

Parameters:
[in]idxIndex of component.
[in]_ubNew upper bound.
Returns:
SUCCESSFUL_RETURN,
RET_INDEX_OUT_OF_BOUNDS

Assigns new upper bounds.

Parameters:
[in]_ubNew upper bounds.
Returns:
SUCCESSFUL_RETURN,
RET_VECTOR_DIMENSION_MISMATCH

Member Data Documentation

Flag indicating whether variable is to be automatically initialized.

Definition at line 455 of file variable_settings.hpp.

Dimension of variable.

Definition at line 444 of file variable_settings.hpp.

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.

Scaling for each component of the variable.

Definition at line 450 of file variable_settings.hpp.

Type of the variable.

Definition at line 445 of file variable_settings.hpp.

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 Sat Jun 8 2019 19:40:26