A dense matrix of values of type T
.
More...
#include <shark/LinAlg/BLAS/matrix.hpp>
Public Types | |
typedef array_type::const_reference | const_reference |
typedef array_type::reference | reference |
typedef const T * | const_pointer |
typedef T * | pointer |
typedef index_type const * | const_index_pointer |
typedef index_type | index_pointer |
typedef dense_tag | storage_category |
typedef elementwise_tag | evaluation_category |
typedef L | orientation |
typedef dense_storage_iterator< value_type > | row_iterator |
typedef dense_storage_iterator< value_type > | column_iterator |
typedef dense_storage_iterator< value_type const > | const_row_iterator |
typedef dense_storage_iterator< value_type const > | const_column_iterator |
typedef blas::major_iterator< self_type >::type | major_iterator |
Public Member Functions | |
matrix () | |
Default dense matrix constructor. Make a dense matrix of size (0,0) More... | |
matrix (size_type size1, size_type size2) | |
matrix (size_type size1, size_type size2, const value_type &init) | |
matrix (size_type size1, size_type size2, const array_type &data) | |
matrix (const matrix &m) | |
template<class E > | |
matrix (matrix_expression< E > const &e) | |
size_type | size1 () const |
Returns the number of rows of the matrix. More... | |
size_type | size2 () const |
Returns the number of columns of the matrix. More... | |
difference_type | stride1 () const |
Returns the stride in memory between two rows. More... | |
difference_type | stride2 () const |
Returns the stride in memory between two columns. More... | |
const_pointer | storage () const |
Returns the pointer to the beginning of the matrix storage. More... | |
pointer | storage () |
Returns the pointer to the beginning of the matrix storage. More... | |
void | resize (size_type size1, size_type size2) |
void | clear () |
const_reference | operator() (index_type i, index_type j) const |
reference | operator() (index_type i, index_type j) |
void | set_element (size_type i, size_type j, value_type t) |
matrix & | operator= (matrix m) |
template<class C > | |
matrix & | operator= (matrix_container< C > const &m) |
template<class E > | |
matrix & | operator= (matrix_expression< E > const &e) |
void | swap (matrix &m) |
const_row_iterator | row_begin (index_type i) const |
const_row_iterator | row_end (index_type i) const |
row_iterator | row_begin (index_type i) |
row_iterator | row_end (index_type i) |
const_row_iterator | column_begin (std::size_t j) const |
const_column_iterator | column_end (std::size_t j) const |
column_iterator | column_begin (std::size_t j) |
column_iterator | column_end (std::size_t j) |
major_iterator | set_element (major_iterator pos, index_type index, value_type value) |
major_iterator | clear_element (major_iterator elem) |
major_iterator | clear_range (major_iterator start, major_iterator end) |
void | reserve (size_type non_zeros) |
void | reserve_row (std::size_t, std::size_t) |
void | reserve_column (std::size_t, std::size_t) |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int) |
![]() | |
const container_type & | operator() () const |
container_type & | operator() () |
![]() | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (matrix &m1, matrix &m2) |
void | swap_rows (matrix &a, index_type i, matrix &b, index_type j) |
void | swap_rows (matrix &a, index_type i, index_type j) |
void | swap_columns (matrix &a, index_type i, matrix &b, index_type j) |
void | swap_columns (matrix &a, index_type i, index_type j) |
A dense matrix of values of type T
.
For a \((m \times n)\)-dimensional matrix and \( 0 \leq i < m, 0 \leq j < n\), every element \( m_{i,j} \) is mapped to the \((i.n + j)\)-th element of the container for row major orientation or the \( (i + j.m) \)-th element of the container for column major orientation. In a dense matrix all elements are represented in memory in a contiguous chunk of memory by definition.
Orientation can also be specified, otherwise a row_major
is used.
T | the type of object stored in the matrix (like double, float, complex, etc...) |
L | the storage organization. It can be either row_major or column_major . Default is row_major |
Definition at line 56 of file matrix.hpp.
typedef dense_storage_iterator<value_type> shark::blas::matrix< T, L >::column_iterator |
Definition at line 251 of file matrix.hpp.
typedef dense_storage_iterator<value_type const> shark::blas::matrix< T, L >::const_column_iterator |
Definition at line 253 of file matrix.hpp.
typedef index_type const* shark::blas::matrix< T, L >::const_index_pointer |
Definition at line 70 of file matrix.hpp.
typedef const T* shark::blas::matrix< T, L >::const_pointer |
Definition at line 66 of file matrix.hpp.
typedef array_type::const_reference shark::blas::matrix< T, L >::const_reference |
Definition at line 64 of file matrix.hpp.
typedef dense_storage_iterator<value_type const> shark::blas::matrix< T, L >::const_row_iterator |
Definition at line 252 of file matrix.hpp.
typedef elementwise_tag shark::blas::matrix< T, L >::evaluation_category |
Definition at line 76 of file matrix.hpp.
typedef index_type shark::blas::matrix< T, L >::index_pointer |
Definition at line 71 of file matrix.hpp.
typedef blas::major_iterator<self_type>::type shark::blas::matrix< T, L >::major_iterator |
Definition at line 281 of file matrix.hpp.
typedef L shark::blas::matrix< T, L >::orientation |
Definition at line 77 of file matrix.hpp.
typedef T* shark::blas::matrix< T, L >::pointer |
Definition at line 67 of file matrix.hpp.
typedef array_type::reference shark::blas::matrix< T, L >::reference |
Definition at line 65 of file matrix.hpp.
typedef dense_storage_iterator<value_type> shark::blas::matrix< T, L >::row_iterator |
Definition at line 250 of file matrix.hpp.
typedef dense_tag shark::blas::matrix< T, L >::storage_category |
Definition at line 75 of file matrix.hpp.
|
inline |
Default dense matrix constructor. Make a dense matrix of size (0,0)
Definition at line 82 of file matrix.hpp.
Referenced by shark::PrecomputedMatrix< Matrix >::PrecomputedMatrix().
|
inline |
Dense matrix constructor with defined size
size1 | number of rows |
size2 | number of columns |
Definition at line 88 of file matrix.hpp.
|
inline |
Dense matrix constructor with defined size a initial value for all the matrix elements
size1 | number of rows |
size2 | number of columns |
init | initial value assigned to all elements |
Definition at line 96 of file matrix.hpp.
|
inline |
Dense matrix constructor with defined size and an initial data array
size1 | number of rows |
size2 | number of columns |
data | array to copy into the matrix. Must have the same dimension as the matrix |
Definition at line 104 of file matrix.hpp.
|
inline |
Copy-constructor of a dense matrix
m | is a dense matrix |
Definition at line 110 of file matrix.hpp.
|
inline |
Copy-constructor of a dense matrix from a matrix expression
e | is a matrix expression |
Definition at line 117 of file matrix.hpp.
|
inline |
Definition at line 175 of file matrix.hpp.
|
inline |
Definition at line 290 of file matrix.hpp.
|
inline |
Definition at line 295 of file matrix.hpp.
|
inline |
Definition at line 268 of file matrix.hpp.
|
inline |
Definition at line 274 of file matrix.hpp.
|
inline |
Definition at line 271 of file matrix.hpp.
|
inline |
Definition at line 277 of file matrix.hpp.
|
inline |
Definition at line 180 of file matrix.hpp.
|
inline |
Definition at line 183 of file matrix.hpp.
|
inline |
Definition at line 193 of file matrix.hpp.
|
inline |
Definition at line 198 of file matrix.hpp.
|
inline |
Definition at line 204 of file matrix.hpp.
|
inline |
Definition at line 300 of file matrix.hpp.
|
inline |
Definition at line 302 of file matrix.hpp.
|
inline |
Definition at line 301 of file matrix.hpp.
|
inline |
Resize a matrix to new dimensions. If resizing is performed, the data is not preserved.
size1 | the new number of rows |
size2 | the new number of colums |
Definition at line 169 of file matrix.hpp.
Referenced by shark::blas::matrix< double, blas::column_major >::operator=(), and shark::PartlyPrecomputedMatrix< Matrix >::PartlyPrecomputedMatrix().
|
inline |
Definition at line 255 of file matrix.hpp.
|
inline |
Definition at line 261 of file matrix.hpp.
|
inline |
Definition at line 258 of file matrix.hpp.
|
inline |
Definition at line 264 of file matrix.hpp.
|
inline |
Definition at line 306 of file matrix.hpp.
|
inline |
Definition at line 187 of file matrix.hpp.
|
inline |
Definition at line 284 of file matrix.hpp.
|
inline |
Returns the number of rows of the matrix.
Definition at line 127 of file matrix.hpp.
Referenced by shark::blas::matrix< double, blas::column_major >::column_end(), shark::PrecomputedMatrix< Matrix >::getMaxCacheSize(), shark::PartlyPrecomputedMatrix< Matrix >::isCached(), shark::blas::matrix< double, blas::column_major >::operator=(), shark::PartlyPrecomputedMatrix< Matrix >::PartlyPrecomputedMatrix(), and shark::blas::matrix< double, blas::column_major >::resize().
|
inline |
Returns the number of columns of the matrix.
Definition at line 131 of file matrix.hpp.
Referenced by shark::PrecomputedMatrix< Matrix >::getCacheRowSize(), shark::PartlyPrecomputedMatrix< Matrix >::getCacheRowSize(), shark::PrecomputedMatrix< Matrix >::getMaxCacheSize(), shark::PartlyPrecomputedMatrix< Matrix >::getMaxCacheSize(), shark::blas::matrix< double, blas::column_major >::operator=(), shark::blas::matrix< double, blas::column_major >::resize(), shark::blas::matrix< double, blas::column_major >::row_end(), and shark::PrecomputedMatrix< Matrix >::size().
|
inline |
Returns the pointer to the beginning of the matrix storage.
Grants low-level access to the matrix internals. Element order depends on whether the matrix is row_major or column_major. to access element (i,j) use storage()[i*stride1()+j*stride2()].
Definition at line 148 of file matrix.hpp.
|
inline |
Returns the pointer to the beginning of the matrix storage.
Grants low-level access to the matrix internals. Element order depends on whether the matrix is row_major or column_major. to access element (i,j) use storage()[i*stride1()+j*stride2()].
Definition at line 156 of file matrix.hpp.
|
inline |
Returns the stride in memory between two rows.
Definition at line 136 of file matrix.hpp.
Referenced by shark::blas::matrix< double, blas::column_major >::column_begin(), shark::blas::matrix< double, blas::column_major >::column_end(), shark::blas::matrix< double, blas::column_major >::row_begin(), and shark::blas::matrix< double, blas::column_major >::row_end().
|
inline |
Returns the stride in memory between two columns.
Definition at line 140 of file matrix.hpp.
Referenced by shark::blas::matrix< double, blas::column_major >::column_begin(), shark::blas::matrix< double, blas::column_major >::column_end(), shark::blas::matrix< double, blas::column_major >::row_begin(), and shark::blas::matrix< double, blas::column_major >::row_end().
|
inline |
Definition at line 211 of file matrix.hpp.
Referenced by shark::blas::matrix< double, blas::column_major >::operator=(), and shark::blas::diagonal_matrix< scalar_vector< T > >::swap().
|
friend |
Definition at line 216 of file matrix.hpp.
|
friend |
Definition at line 235 of file matrix.hpp.
|
friend |
Definition at line 244 of file matrix.hpp.
|
friend |
Definition at line 220 of file matrix.hpp.
|
friend |
Definition at line 229 of file matrix.hpp.