Provides matrix-valued optimization variables. More...
#include <matrix_variable.hpp>
Public Member Functions | |
MatrixVariable | getCols (uint startIdx, uint endIdx) const |
DMatrix | getMatrix () const |
MatrixVariable | getRows (uint startIdx, uint endIdx) const |
returnValue | init (uint _nRows, uint _nCols, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, DVector _scaling=emptyVector, DVector _lb=emptyVector, DVector _ub=emptyVector, BooleanType _autoInit=defaultAutoInit) |
MatrixVariable () | |
MatrixVariable (uint _nRows, uint _nCols, VariableType _type=VT_UNKNOWN, const char **const _names=0, const char **const _units=0, DVector _scaling=emptyVector, DVector _lb=emptyVector, DVector _ub=emptyVector, BooleanType _autoInit=defaultAutoInit) | |
MatrixVariable (const MatrixVariable &rhs) | |
MatrixVariable (const DMatrix &_matrix, VariableType _type=VT_UNKNOWN) | |
MatrixVariable & | operator= (const MatrixVariable &rhs) |
MatrixVariable & | operator= (const DMatrix &rhs) |
~MatrixVariable () |
Provides matrix-valued optimization variables.
The class MatrixVariable provides matrix-valued optimization variables by enhancing the DMatrix class with variable-specific settings.
Definition at line 55 of file matrix_variable.hpp.
Default constructor.
Definition at line 46 of file matrix_variable.cpp.
MatrixVariable::MatrixVariable | ( | uint | _nRows, |
uint | _nCols, | ||
VariableType | _type = VT_UNKNOWN , |
||
const char **const | _names = 0 , |
||
const char **const | _units = 0 , |
||
DVector | _scaling = emptyVector , |
||
DVector | _lb = emptyVector , |
||
DVector | _ub = emptyVector , |
||
BooleanType | _autoInit = defaultAutoInit |
||
) |
Constructor which takes dimensions of the matrix as well as all variable settings.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _type | Type of the 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 | Scaling for each component of the variable. |
[in] | _lb | Lower bounds for each component of the variable. |
[in] | _ub | Upper bounds for each component of the variable. |
[in] | _autoInit | Flag indicating whether variable is to be automatically initialized. |
Definition at line 51 of file matrix_variable.cpp.
MatrixVariable::MatrixVariable | ( | const MatrixVariable & | rhs | ) |
Copy constructor (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 65 of file matrix_variable.cpp.
MatrixVariable::MatrixVariable | ( | const DMatrix & | _matrix, |
VariableType | _type = VT_UNKNOWN |
||
) |
Copy constructor converting a matrix to a MatrixVariable (of given type).
[in] | _matrix | DMatrix to be converted. |
[in] | _type | Type of the variable. |
Definition at line 70 of file matrix_variable.cpp.
Destructor.
Definition at line 77 of file matrix_variable.cpp.
MatrixVariable MatrixVariable::getCols | ( | uint | startIdx, |
uint | endIdx | ||
) | const |
Returns a MatrixVariable containing only the columns between given indices while keeping all rows.
[in] | startIdx | Index of first column to be included. |
[in] | endIdx | Index of last column to be included. |
Definition at line 148 of file matrix_variable.cpp.
DMatrix MatrixVariable::getMatrix | ( | ) | const [inline] |
Returns matrix containing the numerical values of the MatrixVariable.
MatrixVariable MatrixVariable::getRows | ( | uint | startIdx, |
uint | endIdx | ||
) | const |
Returns a MatrixVariable containing only the rows between given indices while keeping all columns.
[in] | startIdx | Index of first row to be included. |
[in] | endIdx | Index of last row to be included. |
Definition at line 128 of file matrix_variable.cpp.
returnValue MatrixVariable::init | ( | uint | _nRows, |
uint | _nCols, | ||
VariableType | _type = VT_UNKNOWN , |
||
const char **const | _names = 0 , |
||
const char **const | _units = 0 , |
||
DVector | _scaling = emptyVector , |
||
DVector | _lb = emptyVector , |
||
DVector | _ub = emptyVector , |
||
BooleanType | _autoInit = defaultAutoInit |
||
) |
Initializes object with given dimensions of the matrix and given variable settings.
[in] | _nRows | Number of rows of each matrix. |
[in] | _nCols | Number of columns of each matrix. |
[in] | _type | Type of the 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 | Scaling for each component of the variable. |
[in] | _lb | Lower bounds for each component of the variable. |
[in] | _ub | Upper bounds for each component of the variable. |
[in] | _autoInit | Flag indicating whether variable is to be automatically initialized. |
Definition at line 107 of file matrix_variable.cpp.
MatrixVariable & MatrixVariable::operator= | ( | const MatrixVariable & | rhs | ) |
Assignment operator (deep copy).
[in] | rhs | Right-hand side object. |
Definition at line 82 of file matrix_variable.cpp.
MatrixVariable & MatrixVariable::operator= | ( | const DMatrix & | rhs | ) |
Assignment operator converting a matrix to a MatrixVariable.
[in] | rhs | Right-hand side object. |
Definition at line 94 of file matrix_variable.cpp.