![]() |
Modules | |
Dense Matrices | |
Sparse Matrices | |
Classes | |
struct | blaze::Matrix< MT, SO > |
Base class for matrices.The Matrix class is a base class for all dense and sparse matrix classes within the Blaze library. It provides an abstraction from the actual type of the matrix, but enables a conversion back to this type via the 'Curiously Recurring Template Pattern' (CRTP). More... | |
Functions | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE void | blaze::ctranspose (Matrix< MT, SO > &matrix) |
In-place conjugate transpose of the given matrix. More... | |
Matrix global functions | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::Iterator | blaze::begin (Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator to the first element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::ConstIterator | blaze::begin (const Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator to the first element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::ConstIterator | blaze::cbegin (const Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator to the first element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::Iterator | blaze::end (Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator just past the last element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::ConstIterator | blaze::end (const Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator just past the last element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE MT::ConstIterator | blaze::cend (const Matrix< MT, SO > &matrix, size_t i) |
Returns an iterator just past the last element of row/column i. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::rows (const Matrix< MT, SO > &matrix) noexcept |
Returns the current number of rows of the matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::columns (const Matrix< MT, SO > &matrix) noexcept |
Returns the current number of columns of the matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::capacity (const Matrix< MT, SO > &matrix) noexcept |
Returns the maximum capacity of the matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::capacity (const Matrix< MT, SO > &matrix, size_t i) noexcept |
Returns the current capacity of the specified row/column. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::nonZeros (const Matrix< MT, SO > &matrix) |
Returns the total number of non-zero elements in the matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE size_t | blaze::nonZeros (const Matrix< MT, SO > &matrix, size_t i) |
Returns the number of non-zero elements in the specified row/column. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE void | blaze::resize (Matrix< MT, SO > &matrix, size_t m, size_t n, bool preserve) |
Changing the size of the matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE void | blaze::transpose (Matrix< MT, SO > &matrix) |
In-place transpose of the given matrix. More... | |
template<typename MT , bool SO> | |
BLAZE_ALWAYS_INLINE bool | blaze::isSquare (const Matrix< MT, SO > &matrix) noexcept |
Checks if the given matrix is a square matrix. More... | |
template<typename MT1 , bool SO1, typename MT2 , bool SO2> | |
BLAZE_ALWAYS_INLINE bool | blaze::isSame (const Matrix< MT1, SO1 > &a, const Matrix< MT2, SO2 > &b) noexcept |
Returns whether the two given matrices represent the same observable state. More... | |
Matrix operators | |
template<typename MT , bool SO> | |
std::ostream & | blaze::operator<< (std::ostream &os, const Matrix< MT, SO > &m) |
Global output operator for dense and sparse matrices. More... | |
BLAZE_ALWAYS_INLINE MT::Iterator blaze::begin | ( | Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator to the first element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator to the first element of row i, in case it is a column-major matrix the function returns an iterator to the first element of column i.
BLAZE_ALWAYS_INLINE MT::ConstIterator blaze::begin | ( | const Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator to the first element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator to the first element of row i, in case it is a column-major matrix the function returns an iterator to the first element of column i.
|
noexcept |
Returns the maximum capacity of the matrix.
matrix | The given matrix. |
|
noexcept |
Returns the current capacity of the specified row/column.
matrix | The given matrix. |
i | The index of the row/column. |
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.
BLAZE_ALWAYS_INLINE MT::ConstIterator blaze::cbegin | ( | const Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator to the first element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns a row/column iterator to the first element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator to the first element of row i, in case it is a column-major matrix the function returns an iterator to the first element of column i.
BLAZE_ALWAYS_INLINE MT::ConstIterator blaze::cend | ( | const Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator just past the last element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator just past the last element of row i, in case it is a column-major matrix the function returns an iterator just past the last element of column i.
|
noexcept |
Returns the current number of columns of the matrix.
matrix | The given matrix. |
BLAZE_ALWAYS_INLINE void blaze::ctranspose | ( | Matrix< MT, SO > & | matrix | ) |
In-place conjugate transpose of the given matrix.
matrix | The given matrix to be transposed. |
std::logic_error | Matrix cannot be transposed. |
This function transposes the given matrix in-place. The function fails if ...
In all failure cases a std::logic_error exception is thrown.
BLAZE_ALWAYS_INLINE MT::Iterator blaze::end | ( | Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator just past the last element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator just past the last element of row i, in case it is a column-major matrix the function returns an iterator just past the last element of column i.
BLAZE_ALWAYS_INLINE MT::ConstIterator blaze::end | ( | const Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns an iterator just past the last element of row/column i.
matrix | The given dense or sparse matrix. |
i | The row/column index. |
This function returns an row/column iterator just past the last element of row/column i. In case the given matrix is a row-major matrix the function returns an iterator just past the last element of row i, in case it is a column-major matrix the function returns an iterator just past the last element of column i.
|
noexcept |
Returns whether the two given matrices represent the same observable state.
a | The first matrix to be tested for its state. |
b | The second matrix to be tested for its state. |
The isSame function provides an abstract interface for testing if the two given matrices represent the same observable state. This happens for instance in case a
and b
refer to the same matrix or in case a
and b
are aliases for the same matrix. In case both matrices represent the same observable state, the function returns true, other it returns false.
|
noexcept |
Checks if the given matrix is a square matrix.
matrix | The matrix to be checked. |
This function checks if the number of rows and columns of the given matrix are equal. If they are, the function returns true, otherwise it returns false.
BLAZE_ALWAYS_INLINE size_t blaze::nonZeros | ( | const Matrix< MT, SO > & | matrix | ) |
Returns the total number of non-zero elements in the matrix.
matrix | The given matrix. |
BLAZE_ALWAYS_INLINE size_t blaze::nonZeros | ( | const Matrix< MT, SO > & | matrix, |
size_t | i | ||
) |
Returns the number of non-zero elements in the specified row/column.
matrix | The given matrix. |
i | The index of the row/column. |
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.
|
inline |
Global output operator for dense and sparse matrices.
os | Reference to the output stream. |
m | Reference to a constant matrix object. |
BLAZE_ALWAYS_INLINE void blaze::resize | ( | Matrix< MT, SO > & | matrix, |
size_t | m, | ||
size_t | n, | ||
bool | preserve | ||
) |
Changing the size of the matrix.
matrix | The given matrix to be resized. |
m | The new number of rows of the matrix. |
n | The new number of columns of the matrix. |
preserve | true if the old values of the matrix should be preserved, false if not. |
std::invalid_argument | Invalid resize arguments for square matrix. |
std::invalid_argument | Matrix cannot be resized. |
This function provides a unified interface to resize dense and sparse matrices. In contrast to the resize()
member function, which is only available on resizable matrix types, this function can be used on both resizable and non-resizable matrices. In case the given matrix of type MT is resizable (i.e. provides a resize
function) the type-specific resize()
member function is called. Depending on the type MT, this may result in the allocation of new dynamic memory and the invalidation of existing views (submatrices, rows, columns, ...). Note that in case the matrix is a compile time square matrix (as for instance the blaze::SymmetricMatrix adaptor, ...) the specified number of rows must be identical to the number of columns. Otherwise a std::invalid_argument exception is thrown. If the matrix type MT is non-resizable (i.e. does not provide a resize()
function) and if the specified number of rows and columns is not identical to the current number of rows and columns of the matrix, a std::invalid_argument exception is thrown.
|
noexcept |
Returns the current number of rows of the matrix.
matrix | The given matrix. |
BLAZE_ALWAYS_INLINE void blaze::transpose | ( | Matrix< MT, SO > & | matrix | ) |
In-place transpose of the given matrix.
matrix | The given matrix to be transposed. |
std::logic_error | Matrix cannot be transposed. |
This function transposes the given matrix in-place. The function fails if ...
In all failure cases a std::logic_error exception is thrown.