Provides variable-specific settings for vector- or matrix-valued optimization variables (for internal use). More...
#include <variable_settings.hpp>
Protected Member Functions | |
returnValue | clear () |
Protected Attributes | |
BooleanType | autoInit |
uint | dim |
DVector | lb |
char ** | names |
DVector | scaling |
VariableType | type |
DVector | ub |
char ** | units |
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.
Definition at line 66 of file variable_settings.hpp.
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.
returnValue VariableSettings::appendSettings | ( | const VariableSettings & | rhs | ) |
Appends given VariableSettings object as additional components to the current one.
[in] | rhs | VariableSettings to be appended. |
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.
[in] | _dim | Dimension of variable. |
[in] | _names | Array containing name labels for each component of the variable. |
[in] | _units | Array containing unit labels for each component of the variable. |
[in] | _scaling | Array containing the scaling for each component of the variable. |
[in] | _lb | Array containing lower bounds for each component of the variable. |
[in] | _ub | Array containing upper bounds for each component of the variable. |
Definition at line 271 of file variable_settings.cpp.
|
protected |
|
inline |
Returns whether automatic initialization is enabled or not.
|
inline |
Returns current lower bound of given component.
@param[in] idx Index of component.
|
inline |
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.
Definition at line 441 of file variable_settings.cpp.
|
inline |
Returns current scaling.
|
inline |
Returns current scaling of given component.
@param[in] idx Index of component.
|
inline |
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.
Definition at line 488 of file variable_settings.cpp.
|
inline |
Returns current upper bound of given component.
@param[in] idx Index of component.
|
inline |
Returns current upper bounds.
|
inline |
Returns whether VariableSettings comprises lower bounds (at at least one of its grid points).
|
inline |
Returns whether VariableSettings comprises (non-empty) name labels (at at least one of its grid points).
|
inline |
Returns whether scaling is set (at at least one grid point).
|
inline |
Returns whether VariableSettings comprises (non-empty) unit labels (at at least one of its grid points).
|
inline |
Returns whether VariableSettings comprises upper bounds (at at least one of its grid points).
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.
|
inline |
Assigns new auto initialization flag.
@param[in] _autoInit New auto initialization flag.
|
inline |
Assigns new lower bound to given component.
@param[in] idx Index of component. @param[in] _lb New lower bound.
|
inline |
Assigns new lower bounds.
@param[in] _lb New lower bounds.
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.
Definition at line 458 of file variable_settings.cpp.
|
inline |
Assigns new scaling.
@param[in] _scaling New scaling. \note Scaling factors need to be positive.
|
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.
|
inline |
Assigns new variable type.
@param[in] _type New variable type.
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.
Definition at line 505 of file variable_settings.cpp.
|
inline |
Assigns new upper bound to given component.
@param[in] idx Index of component. @param[in] _ub New upper bound.
|
inline |
Assigns new upper bounds.
@param[in] _ub New upper bounds.
|
protected |
Flag indicating whether variable is to be automatically initialized.
Definition at line 455 of file variable_settings.hpp.
|
protected |
Dimension of variable.
Definition at line 444 of file variable_settings.hpp.
|
protected |
Lower bounds for each component of the variable.
Definition at line 452 of file variable_settings.hpp.
|
protected |
Array containing name labels for each component of the variable..
Definition at line 447 of file variable_settings.hpp.
|
protected |
Scaling for each component of the variable.
Definition at line 450 of file variable_settings.hpp.
|
protected |
Type of the variable.
Definition at line 445 of file variable_settings.hpp.
|
protected |
Upper bounds for each component of the variable.
Definition at line 453 of file variable_settings.hpp.
|
protected |
Array containing unit labels for each component of the variable..
Definition at line 448 of file variable_settings.hpp.