shark::blas::sparse_vector_adaptor< T, I > Class Template Reference

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

+ Inheritance diagram for shark::blas::sparse_vector_adaptor< T, I >:

Public Types

typedef value_type const & const_reference
 
typedef const_reference reference
 
typedef value_type const * const_pointer
 
typedef const_pointer pointer
 
typedef index_type const * const_index_pointer
 
typedef const_index_pointer index_pointer
 
typedef sparse_tag storage_category
 
typedef elementwise_tag evaluation_category
 
typedef compressed_storage_iterator< value_type const, index_type const > const_iterator
 
typedef const_iterator iterator
 

Public Member Functions

template<class E >
 sparse_vector_adaptor (vector_expression< E > const &expression)
 Constructor of a self_type proxy from a Dense VectorExpression. More...
 
 sparse_vector_adaptor ()
 
 sparse_vector_adaptor (size_type size, const_pointer values, const_index_pointer indices, size_type memoryLength)
 Constructor of a vector proxy from a block of memory. More...
 
size_type size () const
 Return the size of the vector. More...
 
size_type nnz () const
 Number of nonzero elements of the vector. More...
 
const_pointer values () const
 Array of values of the nonzero elements. More...
 
index_pointer indices () const
 Array of indices of the nonzero elements. More...
 
value_type operator() (index_type i) const
 Return a const reference to the element \(i\). More...
 
value_type operator[] (index_type i) const
 Return a const reference to the element \(i\). More...
 
const_iterator begin () const
 return an iterator behind the last non-zero element of the vector More...
 
const_iterator end () const
 return an iterator behind the last non-zero element of the vector More...
 
- Public Member Functions inherited from shark::blas::vector_expression< sparse_vector_adaptor< T, I > >
const expression_type & operator() () const
 
expression_type & operator() ()
 

Detailed Description

template<class T, class I>
class shark::blas::sparse_vector_adaptor< T, I >

Definition at line 589 of file vector_proxy.hpp.

Member Typedef Documentation

§ const_index_pointer

template<class T , class I >
typedef index_type const* shark::blas::sparse_vector_adaptor< T, I >::const_index_pointer

Definition at line 604 of file vector_proxy.hpp.

§ const_iterator

template<class T , class I >
typedef compressed_storage_iterator<value_type const, index_type const> shark::blas::sparse_vector_adaptor< T, I >::const_iterator

Definition at line 685 of file vector_proxy.hpp.

§ const_pointer

template<class T , class I >
typedef value_type const* shark::blas::sparse_vector_adaptor< T, I >::const_pointer

Definition at line 600 of file vector_proxy.hpp.

§ const_reference

template<class T , class I >
typedef value_type const& shark::blas::sparse_vector_adaptor< T, I >::const_reference

Definition at line 598 of file vector_proxy.hpp.

§ evaluation_category

template<class T , class I >
typedef elementwise_tag shark::blas::sparse_vector_adaptor< T, I >::evaluation_category

Definition at line 608 of file vector_proxy.hpp.

§ index_pointer

template<class T , class I >
typedef const_index_pointer shark::blas::sparse_vector_adaptor< T, I >::index_pointer

Definition at line 605 of file vector_proxy.hpp.

§ iterator

template<class T , class I >
typedef const_iterator shark::blas::sparse_vector_adaptor< T, I >::iterator

Definition at line 686 of file vector_proxy.hpp.

§ pointer

template<class T , class I >
typedef const_pointer shark::blas::sparse_vector_adaptor< T, I >::pointer

Definition at line 601 of file vector_proxy.hpp.

§ reference

template<class T , class I >
typedef const_reference shark::blas::sparse_vector_adaptor< T, I >::reference

Definition at line 599 of file vector_proxy.hpp.

§ storage_category

template<class T , class I >
typedef sparse_tag shark::blas::sparse_vector_adaptor< T, I >::storage_category

Definition at line 607 of file vector_proxy.hpp.

Constructor & Destructor Documentation

§ sparse_vector_adaptor() [1/3]

template<class T , class I >
template<class E >
shark::blas::sparse_vector_adaptor< T, I >::sparse_vector_adaptor ( vector_expression< E > const &  expression)
inline

Constructor of a self_type proxy from a Dense VectorExpression.

Be aware that the expression must live longer than the proxy!

Parameters
expressionExpression from which to construct the Proxy

Definition at line 619 of file vector_proxy.hpp.

§ sparse_vector_adaptor() [2/3]

template<class T , class I >
shark::blas::sparse_vector_adaptor< T, I >::sparse_vector_adaptor ( )
inline

Definition at line 626 of file vector_proxy.hpp.

§ sparse_vector_adaptor() [3/3]

template<class T , class I >
shark::blas::sparse_vector_adaptor< T, I >::sparse_vector_adaptor ( size_type  size,
const_pointer  values,
const_index_pointer  indices,
size_type  memoryLength 
)
inline

Constructor of a vector proxy from a block of memory.

Parameters
sizethe size of the vector represented by the memory
valuesthe block of memory used to store the values
indicesthe block of memory used to store the indices
memoryLengthlength of the strip of memory

Definition at line 633 of file vector_proxy.hpp.

Member Function Documentation

§ begin()

template<class T , class I >
const_iterator shark::blas::sparse_vector_adaptor< T, I >::begin ( ) const
inline

return an iterator behind the last non-zero element of the vector

Definition at line 689 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::indices(), and shark::blas::vector_reference< V >::values().

§ end()

template<class T , class I >
const_iterator shark::blas::sparse_vector_adaptor< T, I >::end ( ) const
inline

return an iterator behind the last non-zero element of the vector

Definition at line 694 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::indices(), shark::blas::vector_reference< V >::nnz(), and shark::blas::vector_reference< V >::values().

§ indices()

template<class T , class I >
index_pointer shark::blas::sparse_vector_adaptor< T, I >::indices ( ) const
inline

Array of indices of the nonzero elements.

Definition at line 660 of file vector_proxy.hpp.

§ nnz()

template<class T , class I >
size_type shark::blas::sparse_vector_adaptor< T, I >::nnz ( ) const
inline

Number of nonzero elements of the vector.

Definition at line 652 of file vector_proxy.hpp.

§ operator()()

template<class T , class I >
value_type shark::blas::sparse_vector_adaptor< T, I >::operator() ( index_type  i) const
inline

Return a const reference to the element \(i\).

Parameters
iindex of the element

Definition at line 666 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::indices(), shark::blas::vector_reference< V >::nnz(), SIZE_CHECK, and shark::blas::vector_reference< V >::values().

§ operator[]()

template<class T , class I >
value_type shark::blas::sparse_vector_adaptor< T, I >::operator[] ( index_type  i) const
inline

Return a const reference to the element \(i\).

Parameters
iindex of the element

Definition at line 677 of file vector_proxy.hpp.

§ size()

template<class T , class I >
size_type shark::blas::sparse_vector_adaptor< T, I >::size ( ) const
inline

Return the size of the vector.

Definition at line 643 of file vector_proxy.hpp.

§ values()

template<class T , class I >
const_pointer shark::blas::sparse_vector_adaptor< T, I >::values ( ) const
inline

Array of values of the nonzero elements.

Definition at line 656 of file vector_proxy.hpp.


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