|
geomc 1.0
A c++ linear algebra template library
|
A matrix with nonzero elements only along the main diagonal. More...
#include <geomc/linalg/mtxtypes/DiagMatrix.h>
Public Types | |
| typedef MtxColIterator< const DiagMatrix< T, M, N >, const elem_t > | const_col_iterator |
| Read-only iterator over the elements of a column. | |
| typedef MtxSubsetIterator< const DiagMatrix< T, M, N >, const elem_t > | const_iterator |
| Read-only row-major iterator over matrix elements. | |
| typedef const_iterator | const_region_iterator |
| Read-only row-major iterator over the matrix elements in a rectangular region. | |
| typedef MtxRowIterator< const DiagMatrix< T, M, N >, const elem_t > | const_row_iterator |
| Read-only iterator over the elments of a row. | |
| typedef T | elem_t |
| Element type. | |
| typedef DiagMatrix< T, M, N > | recurring_t |
| typedef detail::_ImplMtxReftype< DiagMatrix< T, M, N >, T >::reference | reference |
| typedef Storage< storage_token_t, _ImplStorageObjCount< DiagMatrix< T, M, N > >::count > | storagebuffer_t |
Public Member Functions | |
| DiagMatrix (const T src[], index_t n) | |
| DiagMatrix (index_t nrows, index_t ncols) | |
| const_iterator | begin () const |
| const_col_iterator | col (index_t i) const |
| index_t | cols () const |
| T & | diagonal (index_t i) |
| const T & | diagonal (index_t i) const |
| T * | diagonal_begin () |
| const T * | diagonal_begin () const |
| T * | diagonal_end () |
| const T * | diagonal_end () const |
| const_iterator | end () const |
| storagebuffer_t | get_storage_token_buffer () const |
| void | get_storage_tokens (storage_token_t *buf) const |
| T | operator() (index_t r, index_t c) const |
| derived_const_row_iterator | operator[] (index_t i) const |
| const_region_iterator | region_begin (const MatrixRegion &r) const |
| const_region_iterator | region_end (const MatrixRegion &r) const |
| const_row_iterator | row (index_t i) const |
| index_t | rows () const |
| void | set_identity () |
| void | set_zero () |
| constexpr index_t | storage_token_count () const |
Static Public Attributes | |
| static constexpr index_t | COLDIM |
| Column dimension template parameter. | |
| static constexpr index_t | ROWDIM |
| Row dimension template parameter. | |
A matrix with nonzero elements only along the main diagonal.
| T | Element type. |
| M | Row dimension. |
| N | Column dimension. |
Storage for DiagMatrixes is O(n), and operations with diagonal matrices usually benefit from the O(n) algorithmic improvement associated with their lower dimension.
|
inlineexplicit |
Construct a new diagonal matrix.
| nrows | Number of rows (ignored / not required if statically sized). |
| ncols | Number of columns (ignored / not required if statically sized). |
|
inline |
Construct a new n x n diagonal matrix, with diagonal elements copied from src.
| src | Array containing diagonal elements. |
| n | Number of elements in src. Ignored / not required if statically sized. |
|
inlineinherited |
|
inlineinherited |
| i | Index of column (zero-indexed) |
i
|
inline |
Return a reference to the ith diagonal element.
|
inline |
Return the ith diagonal element.
|
inline |
(0, 0).
|
inline |
(0, 0).
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
| i | Index of row (zero-indexed) |
i
|
inlineinherited |
| r | The zero-indexed region to iterate over. The upper extreme coordinates represent the index just beyond the last element to be iterated over. |
r, pointing at the first element in the region (upper left corner).
|
inlineinherited |
| r | The zero-indexed region to iterate over. The upper extreme coordinates represent the index just beyond the last element to be iterated over. |
r, pointing at the element just beyond the last element in the region.
|
inlineinherited |
| i | Index of row (zero-indexed) |
i