The DenseMatrixProxy class serves as a backend for the Proxy class. It is used in case the data type represented by the proxy is a dense matrix and augments the Proxy interface by the complete interface required of dense matrices.
This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.
Returns the current capacity of the specified row/column of the represented matrix.
Parameters
i
The index of the row/column.
Returns
The current capacity of row/column i.
This function returns the current capacity of the specified row/column. In case the storage order is set to rowMajor the function returns the capacity of row i, in case the storage flag is set to columnMajor the function returns the capacity of column i.
This function returns a row/column iterator to the first element of row/column i. In case the storage order is set to rowMajor the function returns an iterator to the first element of row i, in case the storage flag is set to columnMajor the function returns an iterator to the first element of column i.
Returns an iterator just past the last element of row/column i of the represented matrix.
Parameters
i
The row/column index.
Returns
Iterator just past the last element of row/column i.
This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.
This function returns a pointer to the internal storage of the dense matrix. Note that you can NOT assume that all matrix elements lie adjacent to each other! The matrix may use techniques such as padding to improve the alignment of the data. Whereas the number of elements within a row/column are given by the rows() and columns() member functions, respectively, the total number of elements including padding is given by the spacing() member function.
Returns an iterator just past the last element of row/column i of the represented matrix.
Parameters
i
The row/column index.
Returns
Iterator just past the last element of row/column i.
Exceptions
std::invalid_argument
Invalid access to restricted element.
This function returns an row/column iterator just past the last element of row/column i. In case the storage order is set to rowMajor the function returns an iterator just past the last element of row i, in case the storage flag is set to columnMajor the function returns an iterator just past the last element of column i.
true if the old values of the matrix should be preserved, false if not.
Returns
void
Exceptions
std::invalid_argument
Invalid access to restricted element.
This function increases the matrix size by m rows and n columns. Depending on the type of the matrix, during this operation new dynamic memory may be allocated in case the capacity of the matrix is too small. Therefore this function potentially changes all matrix elements. In order to preserve the old matrix values, the preserve flag can be set to true. However, note that depending on the type of the matrix new matrix elements may not initialized!
Returns the number of non-zero elements in the specified row/column of the represented matrix.
Parameters
i
The index of the row/column.
Returns
The number of non-zero elements of row/column i.
This function returns the current number of non-zero elements in the specified row/column. In case the storage order is set to rowMajor the function returns the number of non-zero elements in row i, in case the storage flag is set to columnMajor the function returns the number of non-zero elements in column i.
CRTP-based conversion operation for constant matrices.
Returns
Constant reference of the actual type of the matrix.
This operator performs the CRTP-based type-safe downcast to the actual type MT of the matrix. It will return a constant reference to the actual type MT.
CRTP-based conversion operation for non-constant matrices.
Returns
Mutable reference of the actual type of the matrix.
This operator performs the CRTP-based type-safe downcast to the actual type MT of the matrix. It will return a mutable reference to the actual type MT.
Constant reference of the actual type of the matrix.
This operator performs the CRTP-based type-safe downcast to the actual type MT of the matrix. It will return a constant reference to the actual type MT.
Mutable reference of the actual type of the matrix.
This operator performs the CRTP-based type-safe downcast to the actual type MT of the matrix. It will return a mutable reference to the actual type MT.
Reset the specified row/column to the default initial values.
Parameters
i
The index of the row/column.
Returns
void
This function resets the values in the specified row/column to their default value. In case the storage order is set to rowMajor the function resets the values in row i, in case the storage order is set to columnMajor the function resets the values in column i. Note that the capacity of the row/column remains unchanged.
true if the old values of the matrix should be preserved, false if not.
Returns
void
Exceptions
std::invalid_argument
Invalid access to restricted element.
This function resizes the matrix using the given size to . Depending on the type of the matrix, during this operation new dynamic memory may be allocated in case the capacity of the matrix is too small. Note that this function may invalidate all existing views (submatrices, rows, columns, ...) on the matrix if it is used to shrink the matrix. Additionally, the resize operation potentially changes all matrix elements. In order to preserve the old matrix values, the preserve flag can be set to true. However, note that depending on the type of the matrix new matrix elements may not initialized!
Scaling of the matrix by the scalar value scalar ( ).
Parameters
scalar
The scalar value for the matrix scaling.
Returns
void
Exceptions
std::invalid_argument
Invalid access to restricted element.
This function scales the matrix by applying the given scalar value scalar to each element of the matrix. For built-in and complex data types it has the same effect as using the multiplication assignment operator.
Returns the spacing between the beginning of two rows/columns of the represented matrix.
Returns
The spacing between the beginning of two rows/columns.
This function returns the spacing between the beginning of two rows/columns, i.e. the total number of elements of a row/column. In case the storage order is set to rowMajor the function returns the spacing between two rows, in case the storage flag is set to columnMajor the function returns the spacing between two columns.