shark::blas::matrix_reference< M > Class Template Reference

Wraps another expression as a reference. More...

#include <shark/LinAlg/BLAS/fwd.hpp>

+ Inheritance diagram for shark::blas::matrix_reference< M >:

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_referenceoperator= (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)
 
- Public Member Functions inherited from shark::blas::matrix_expression< matrix_reference< M > >
const expression_type & operator() () const
 
expression_type & operator() ()
 

Friends

void swap (matrix_reference &m1, matrix_reference &m2)
 

Detailed Description

template<class M>
class shark::blas::matrix_reference< M >

Wraps another expression as a reference.

Definition at line 51 of file fwd.hpp.

Member Typedef Documentation

§ column_iterator

template<class M >
typedef column_iterator<M>::type shark::blas::matrix_reference< M >::column_iterator

Definition at line 178 of file matrix_proxy.hpp.

§ const_column_iterator

Definition at line 179 of file matrix_proxy.hpp.

§ const_index_pointer

template<class M >
typedef M::const_index_pointer shark::blas::matrix_reference< M >::const_index_pointer

Definition at line 55 of file matrix_proxy.hpp.

§ const_pointer

template<class M >
typedef M::const_pointer shark::blas::matrix_reference< M >::const_pointer

Definition at line 51 of file matrix_proxy.hpp.

§ const_reference

template<class M >
typedef M::const_reference shark::blas::matrix_reference< M >::const_reference

Definition at line 49 of file matrix_proxy.hpp.

§ const_row_iterator

Definition at line 177 of file matrix_proxy.hpp.

§ evaluation_category

template<class M >
typedef elementwise_tag shark::blas::matrix_reference< M >::evaluation_category

Definition at line 62 of file matrix_proxy.hpp.

§ index_pointer

template<class M >
typedef index_pointer<M>::type shark::blas::matrix_reference< M >::index_pointer

Definition at line 56 of file matrix_proxy.hpp.

§ orientation

template<class M >
typedef M::orientation shark::blas::matrix_reference< M >::orientation

Definition at line 60 of file matrix_proxy.hpp.

§ pointer

template<class M >
typedef pointer<M>::type shark::blas::matrix_reference< M >::pointer

Definition at line 52 of file matrix_proxy.hpp.

§ reference

template<class M >
typedef reference<M>::type shark::blas::matrix_reference< M >::reference

Definition at line 50 of file matrix_proxy.hpp.

§ row_iterator

template<class M >
typedef row_iterator<M>::type shark::blas::matrix_reference< M >::row_iterator

Definition at line 176 of file matrix_proxy.hpp.

§ storage_category

template<class M >
typedef M::storage_category shark::blas::matrix_reference< M >::storage_category

Definition at line 61 of file matrix_proxy.hpp.

Constructor & Destructor Documentation

§ matrix_reference() [1/2]

template<class M >
shark::blas::matrix_reference< M >::matrix_reference ( M &  m)
inline

Definition at line 66 of file matrix_proxy.hpp.

§ matrix_reference() [2/2]

template<class M >
template<class E >
shark::blas::matrix_reference< M >::matrix_reference ( matrix_reference< E > const &  other)
inline

Definition at line 68 of file matrix_proxy.hpp.

Member Function Documentation

§ clear()

template<class M >
void shark::blas::matrix_reference< M >::clear ( )
inline

§ clear_element()

§ clear_range()

§ column_begin() [1/2]

§ column_begin() [2/2]

template<class M >
column_iterator shark::blas::matrix_reference< M >::column_begin ( index_type  j)
inline

§ column_end() [1/2]

§ column_end() [2/2]

template<class M >
column_iterator shark::blas::matrix_reference< M >::column_end ( index_type  j)
inline

§ expression() [1/2]

template<class M >
M& shark::blas::matrix_reference< M >::expression ( ) const
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().

§ expression() [2/2]

template<class M >
M& shark::blas::matrix_reference< M >::expression ( )
inline

Definition at line 76 of file matrix_proxy.hpp.

§ inner_indices()

template<class M >
index_pointer shark::blas::matrix_reference< M >::inner_indices ( ) const
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().

§ inner_nnz()

template<class M >
size_type shark::blas::matrix_reference< M >::inner_nnz ( index_type  i) const
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().

§ nnz()

template<class M >
size_type shark::blas::matrix_reference< M >::nnz ( ) const
inline

Number of nonzero elements of the matrix.

Definition at line 115 of file matrix_proxy.hpp.

References shark::blas::matrix_reference< M >::expression().

§ operator()()

template<class M >
reference shark::blas::matrix_reference< M >::operator() ( index_type  i,
index_type  j 
) const
inline

§ operator=()

template<class M >
template<class E >
matrix_reference& shark::blas::matrix_reference< M >::operator= ( matrix_expression< E > const &  e)
inline

§ outer_indices()

template<class M >
index_pointer shark::blas::matrix_reference< M >::outer_indices ( ) const
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().

§ outer_indices_end()

template<class M >
index_pointer shark::blas::matrix_reference< M >::outer_indices_end ( ) const
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().

§ reserve()

template<class M >
void shark::blas::matrix_reference< M >::reserve ( size_type  non_zeros)
inline

§ reserve_column()

template<class M >
void shark::blas::matrix_reference< M >::reserve_column ( size_type  column,
size_type  non_zeros 
)
inline

§ reserve_row()

template<class M >
void shark::blas::matrix_reference< M >::reserve_row ( size_type  row,
size_type  non_zeros 
)
inline

§ row_begin() [1/2]

§ row_begin() [2/2]

template<class M >
row_iterator shark::blas::matrix_reference< M >::row_begin ( index_type  i)
inline

§ row_end() [1/2]

§ row_end() [2/2]

template<class M >
row_iterator shark::blas::matrix_reference< M >::row_end ( index_type  i)
inline

§ set_element() [1/2]

§ set_element() [2/2]

template<class M >
row_iterator shark::blas::matrix_reference< M >::set_element ( row_iterator  pos,
index_type  index,
value_type  value 
)
inline

§ size1()

§ size2()

§ storage()

template<class M >
pointer shark::blas::matrix_reference< M >::storage ( ) const
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().

§ stride1()

§ stride2()

§ swap()

template<class M >
void shark::blas::matrix_reference< M >::swap ( matrix_reference< M > &  m)
inline

§ swap_columns()

template<class M >
void shark::blas::matrix_reference< M >::swap_columns ( index_type  i,
index_type  j 
)
inline

§ swap_rows()

template<class M >
void shark::blas::matrix_reference< M >::swap_rows ( index_type  i,
index_type  j 
)
inline

§ values()

template<class M >
const_pointer shark::blas::matrix_reference< M >::values ( ) const
inline

Array of values of the nonzero elements.

Definition at line 119 of file matrix_proxy.hpp.

References shark::blas::matrix_reference< M >::expression().

Friends And Related Function Documentation

§ swap

template<class M >
void swap ( matrix_reference< M > &  m1,
matrix_reference< M > &  m2 
)
friend

Definition at line 241 of file matrix_proxy.hpp.


The documentation for this class was generated from the following files: