Wraps another expression as a reference. More...
#include <shark/LinAlg/BLAS/fwd.hpp>
Public Types | |
typedef M::const_reference | const_reference |
typedef reference< M >::type | reference |
typedef M::const_pointer | const_pointer |
typedef pointer< M >::type | pointer |
typedef M::const_index_pointer | const_index_pointer |
typedef index_pointer< M >::type | index_pointer |
typedef M::orientation | orientation |
typedef M::storage_category | storage_category |
typedef elementwise_tag | evaluation_category |
typedef row_iterator< M >::type | row_iterator |
typedef row_iterator | const_row_iterator |
typedef column_iterator< M >::type | column_iterator |
typedef column_iterator | const_column_iterator |
Public Member Functions | |
matrix_reference (M &m) | |
template<class E > | |
matrix_reference (matrix_reference< E > const &other) | |
M & | expression () const |
M & | expression () |
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... | |
pointer | storage () const |
Returns the pointer to the beginning of the matrix storage. More... | |
size_type | nnz () const |
Number of nonzero elements of the matrix. More... | |
const_pointer | values () const |
Array of values of the nonzero elements. More... | |
index_pointer | inner_indices () const |
Array of indices of the nonzero elements. More... | |
index_pointer | outer_indices () const |
Returns an array containing the start of the rows. More... | |
index_pointer | outer_indices_end () const |
Returns an array containing the end of the rows. More... | |
size_type | inner_nnz (index_type i) const |
Returns the number of nonzero elements in the i-th row/column. More... | |
reference | operator() (index_type i, index_type j) const |
void | set_element (size_type i, size_type j, value_type t) |
template<class E > | |
matrix_reference & | operator= (matrix_expression< E > const &e) |
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_column_iterator | column_begin (index_type j) const |
const_column_iterator | column_end (index_type j) const |
column_iterator | column_begin (index_type j) |
column_iterator | column_end (index_type j) |
row_iterator | set_element (row_iterator pos, index_type index, value_type value) |
row_iterator | clear_range (row_iterator start, row_iterator end) |
row_iterator | clear_element (row_iterator elem) |
void | clear () |
void | reserve (size_type non_zeros) |
void | reserve_row (size_type row, size_type non_zeros) |
void | reserve_column (size_type column, size_type non_zeros) |
void | swap (matrix_reference &m) |
void | swap_rows (index_type i, index_type j) |
void | swap_columns (index_type i, index_type j) |
![]() | |
const expression_type & | operator() () const |
expression_type & | operator() () |
Friends | |
void | swap (matrix_reference &m1, matrix_reference &m2) |
Wraps another expression as a reference.
typedef column_iterator<M>::type shark::blas::matrix_reference< M >::column_iterator |
Definition at line 178 of file matrix_proxy.hpp.
typedef column_iterator shark::blas::matrix_reference< M >::const_column_iterator |
Definition at line 179 of file matrix_proxy.hpp.
typedef M::const_index_pointer shark::blas::matrix_reference< M >::const_index_pointer |
Definition at line 55 of file matrix_proxy.hpp.
typedef M::const_pointer shark::blas::matrix_reference< M >::const_pointer |
Definition at line 51 of file matrix_proxy.hpp.
typedef M::const_reference shark::blas::matrix_reference< M >::const_reference |
Definition at line 49 of file matrix_proxy.hpp.
typedef row_iterator shark::blas::matrix_reference< M >::const_row_iterator |
Definition at line 177 of file matrix_proxy.hpp.
typedef elementwise_tag shark::blas::matrix_reference< M >::evaluation_category |
Definition at line 62 of file matrix_proxy.hpp.
typedef index_pointer<M>::type shark::blas::matrix_reference< M >::index_pointer |
Definition at line 56 of file matrix_proxy.hpp.
typedef M::orientation shark::blas::matrix_reference< M >::orientation |
Definition at line 60 of file matrix_proxy.hpp.
typedef pointer<M>::type shark::blas::matrix_reference< M >::pointer |
Definition at line 52 of file matrix_proxy.hpp.
typedef reference<M>::type shark::blas::matrix_reference< M >::reference |
Definition at line 50 of file matrix_proxy.hpp.
typedef row_iterator<M>::type shark::blas::matrix_reference< M >::row_iterator |
Definition at line 176 of file matrix_proxy.hpp.
typedef M::storage_category shark::blas::matrix_reference< M >::storage_category |
Definition at line 61 of file matrix_proxy.hpp.
|
inline |
Definition at line 66 of file matrix_proxy.hpp.
|
inline |
Definition at line 68 of file matrix_proxy.hpp.
|
inline |
Definition at line 220 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 216 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_column< M >::clear(), shark::blas::matrix_row< Matrix >::clear_element(), shark::blas::matrix_column< M >::clear_element(), shark::blas::matrix_range< Matrix >::clear_element(), and shark::blas::matrix_row< Matrix >::reserve().
|
inline |
Definition at line 212 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_row< Matrix >::clear(), shark::blas::matrix_column< M >::clear(), shark::blas::matrix_range< Matrix >::clear(), shark::blas::matrix_row< Matrix >::clear_range(), shark::blas::matrix_column< M >::clear_range(), shark::blas::matrix_range< Matrix >::clear_range(), and shark::blas::matrix_row< Matrix >::reserve().
|
inline |
Definition at line 195 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_range< Matrix >::column_begin(), and shark::blas::matrix_range< Matrix >::column_end().
|
inline |
Definition at line 201 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 198 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_range< Matrix >::column_begin(), and shark::blas::matrix_range< Matrix >::column_end().
|
inline |
Definition at line 204 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 73 of file matrix_proxy.hpp.
Referenced by shark::blas::matrix_row< Matrix >::begin(), shark::blas::matrix_column< M >::begin(), shark::blas::matrix_reference< M >::clear(), shark::blas::matrix_transpose< M >::clear(), shark::blas::matrix_column< M >::clear(), shark::blas::matrix_reference< M >::clear_element(), shark::blas::matrix_transpose< M >::clear_element(), shark::blas::matrix_range< Matrix >::clear_element(), shark::blas::matrix_reference< M >::clear_range(), shark::blas::matrix_transpose< M >::clear_range(), shark::blas::matrix_range< Matrix >::clear_range(), shark::blas::column(), shark::blas::matrix_reference< M >::column_begin(), shark::blas::matrix_transpose< M >::column_begin(), shark::blas::matrix_range< Matrix >::column_begin(), shark::blas::matrix_reference< M >::column_end(), shark::blas::matrix_transpose< M >::column_end(), shark::blas::matrix_range< Matrix >::column_end(), shark::blas::columns(), shark::blas::matrix_row< Matrix >::end(), shark::blas::matrix_column< M >::end(), shark::blas::matrix_row< Matrix >::indices(), shark::blas::matrix_reference< M >::inner_indices(), shark::blas::matrix_transpose< M >::inner_indices(), shark::blas::matrix_reference< M >::inner_nnz(), shark::blas::matrix_transpose< M >::inner_nnz(), shark::blas::matrix_reference< M >::nnz(), shark::blas::matrix_transpose< M >::nnz(), shark::blas::matrix_row< Matrix >::nnz(), shark::blas::matrix_reference< M >::operator()(), shark::blas::matrix_transpose< M >::operator()(), shark::blas::matrix_reference< M >::operator=(), shark::blas::matrix_transpose< M >::operator=(), shark::blas::matrix_reference< M >::outer_indices(), shark::blas::matrix_transpose< M >::outer_indices(), shark::blas::matrix_reference< M >::outer_indices_end(), shark::blas::matrix_transpose< M >::outer_indices_end(), shark::blas::matrix_reference< M >::reserve(), shark::blas::matrix_transpose< M >::reserve(), shark::blas::matrix_row< Matrix >::reserve(), shark::blas::matrix_reference< M >::reserve_column(), shark::blas::matrix_transpose< M >::reserve_column(), shark::blas::matrix_reference< M >::reserve_row(), shark::blas::matrix_transpose< M >::reserve_row(), shark::blas::row(), shark::blas::matrix_reference< M >::row_begin(), shark::blas::matrix_transpose< M >::row_begin(), shark::blas::matrix_range< Matrix >::row_begin(), shark::blas::matrix_reference< M >::row_end(), shark::blas::matrix_transpose< M >::row_end(), shark::blas::matrix_range< Matrix >::row_end(), shark::blas::rows(), shark::blas::matrix_reference< M >::set_element(), shark::blas::matrix_transpose< M >::set_element(), shark::blas::matrix_row< Matrix >::set_element(), shark::blas::matrix_column< M >::set_element(), shark::blas::matrix_vector_range< M >::set_element(), shark::blas::matrix_range< Matrix >::set_element(), shark::blas::matrix_row< Matrix >::size(), shark::blas::matrix_column< M >::size(), shark::blas::matrix_reference< M >::size1(), shark::blas::matrix_transpose< M >::size1(), shark::blas::matrix_reference< M >::size2(), shark::blas::matrix_transpose< M >::size2(), shark::blas::matrix_reference< M >::storage(), shark::blas::matrix_transpose< M >::storage(), shark::blas::matrix_row< Matrix >::storage(), shark::blas::matrix_column< M >::storage(), shark::blas::matrix_vector_range< M >::storage(), shark::blas::matrix_range< Matrix >::storage(), shark::blas::matrix_row< Matrix >::stride(), shark::blas::matrix_column< M >::stride(), shark::blas::matrix_vector_range< M >::stride(), shark::blas::matrix_reference< M >::stride1(), shark::blas::matrix_transpose< M >::stride1(), shark::blas::matrix_range< Matrix >::stride1(), shark::blas::matrix_reference< M >::stride2(), shark::blas::matrix_transpose< M >::stride2(), shark::blas::matrix_range< Matrix >::stride2(), shark::blas::subrange(), shark::blas::matrix_reference< M >::swap(), shark::blas::matrix_reference< M >::swap_columns(), shark::blas::matrix_reference< M >::swap_rows(), shark::blas::matrix_reference< M >::values(), shark::blas::matrix_transpose< M >::values(), and shark::blas::matrix_row< Matrix >::values().
|
inline |
Definition at line 76 of file matrix_proxy.hpp.
|
inline |
Array of indices of the nonzero elements.
Note that there is a pair of indices needed: When accessing the j-th element in row i you have to write code like this: index_type start = outer_indices()[i] //aquire start of the i-th row index = inner_indices()[start+j]; All elements in the row are contained in the range [outer_indices()[i],outer_indices_end()[i]) there might be gaps between the end of the one line and the start of the next!
Definition at line 131 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Returns the number of nonzero elements in the i-th row/column.
Definition at line 150 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Number of nonzero elements of the matrix.
Definition at line 115 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 159 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 170 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Returns an array containing the start of the rows.
See documentation of inner_indices() for more details
Definition at line 138 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Returns an array containing the end of the rows.
See documentation of inner_indices() for more details
Definition at line 145 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 224 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 232 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 228 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 182 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_range< Matrix >::row_begin(), and shark::blas::matrix_range< Matrix >::row_end().
|
inline |
Definition at line 188 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 185 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_range< Matrix >::row_begin(), and shark::blas::matrix_range< Matrix >::row_end().
|
inline |
Definition at line 191 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 163 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::matrix_column< M >::clear(), shark::blas::matrix_row< Matrix >::reserve(), shark::blas::matrix_row< Matrix >::set_element(), and shark::blas::matrix_column< M >::set_element().
|
inline |
Definition at line 208 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Returns the number of rows of the matrix.
Definition at line 81 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::adapt_matrix(), shark::blas::matrix_range< Matrix >::clear(), shark::blas::dense_matrix_adaptor< T, Orientation >::clear(), shark::blas::matrix_range< Matrix >::column_end(), shark::blas::dense_matrix_adaptor< T, Orientation >::column_end(), shark::blas::columns(), shark::blas::diag(), shark::blas::dense_matrix_adaptor< T, Orientation >::operator=(), shark::blas::rows(), shark::blas::subrange(), and shark::blas::to_matrix().
|
inline |
Returns the number of columns of the matrix.
Definition at line 85 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::adapt_matrix(), shark::blas::matrix_range< Matrix >::clear(), shark::blas::dense_matrix_adaptor< T, Orientation >::clear(), shark::blas::columns(), shark::blas::diag(), shark::blas::dense_matrix_adaptor< T, Orientation >::operator=(), shark::blas::matrix_range< Matrix >::row_end(), shark::blas::dense_matrix_adaptor< T, Orientation >::row_end(), shark::blas::rows(), shark::blas::subrange(), and shark::blas::to_matrix().
|
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 106 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Returns the stride in memory between two rows.
Definition at line 94 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::dense_matrix_adaptor< T, Orientation >::column_begin(), shark::blas::dense_matrix_adaptor< T, Orientation >::column_end(), shark::blas::dense_matrix_adaptor< T, Orientation >::row_begin(), shark::blas::dense_matrix_adaptor< T, Orientation >::row_end(), and shark::blas::matrix_range< Matrix >::storage().
|
inline |
Returns the stride in memory between two columns.
Definition at line 98 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
Referenced by shark::blas::dense_matrix_adaptor< T, Orientation >::column_begin(), shark::blas::dense_matrix_adaptor< T, Orientation >::column_end(), shark::blas::dense_matrix_adaptor< T, Orientation >::row_begin(), shark::blas::dense_matrix_adaptor< T, Orientation >::row_end(), and shark::blas::matrix_range< Matrix >::storage().
|
inline |
Definition at line 237 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 249 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Definition at line 245 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
inline |
Array of values of the nonzero elements.
Definition at line 119 of file matrix_proxy.hpp.
References shark::blas::matrix_reference< M >::expression().
|
friend |
Definition at line 241 of file matrix_proxy.hpp.