shark::blas::vector_range< V > Class Template Reference

A vector referencing a continuous subvector of elements of vector v containing all elements specified by range. More...

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

+ Inheritance diagram for shark::blas::vector_range< V >:

Public Types

typedef V::const_reference const_reference
 
typedef reference< V >::type reference
 
typedef V::const_pointer const_pointer
 
typedef pointer< V >::type pointer
 
typedef V::const_index_pointer const_index_pointer
 
typedef index_pointer< V >::type index_pointer
 
typedef V::storage_category storage_category
 
typedef elementwise_tag evaluation_category
 
typedef subrange_iterator< typename vector_closure_type::iterator > iterator
 
typedef subrange_iterator< typename vector_closure_type::const_iterator > const_iterator
 

Public Member Functions

 vector_range (vector_closure_type const &data, range const &r)
 
template<class E >
 vector_range (vector_range< E > const &other, typename boost::disable_if< boost::is_same< E, vector_range > >::type *dummy=0)
 
size_type start () const
 
vector_closure_type const & expression () const
 
vector_closure_type & expression ()
 
blas::range const & range () const
 
size_type size () const
 Return the size of the vector. More...
 
pointer storage () const
 Returns the pointer to the beginning of the vector storage. More...
 
difference_type stride () const
 Returns the stride between the elements in storage() More...
 
reference operator() (index_type i) const
 
vector_rangeoperator= (vector_range const &vr)
 
template<class E >
vector_rangeoperator= (vector_expression< E > const &e)
 
const_iterator begin () const
 
iterator begin ()
 
const_iterator end () const
 
iterator end ()
 
void clear ()
 
iterator set_element (iterator pos, index_type index, value_type value)
 
iterator clear_range (iterator first, iterator last)
 
iterator clear_element (iterator pos)
 
void reserve (size_type non_zeros)
 
- Public Member Functions inherited from shark::blas::vector_expression< vector_range< V > >
const expression_type & operator() () const
 
expression_type & operator() ()
 

Detailed Description

template<class V>
class shark::blas::vector_range< V >

A vector referencing a continuous subvector of elements of vector v containing all elements specified by range.

A vector range can be used as a normal vector in any expression. If the specified range falls outside that of the index range of the vector, then the vector_range is not a well formed vector_expression and access to an element outside of index range of the vector is undefined.

Template Parameters
Vthe type of vector referenced (for exaboost::mple vector<double>)

Definition at line 54 of file fwd.hpp.

Member Typedef Documentation

§ const_index_pointer

template<class V>
typedef V::const_index_pointer shark::blas::vector_range< V >::const_index_pointer

Definition at line 204 of file vector_proxy.hpp.

§ const_iterator

template<class V>
typedef subrange_iterator< typename vector_closure_type::const_iterator> shark::blas::vector_range< V >::const_iterator

Definition at line 292 of file vector_proxy.hpp.

§ const_pointer

template<class V>
typedef V::const_pointer shark::blas::vector_range< V >::const_pointer

Definition at line 200 of file vector_proxy.hpp.

§ const_reference

template<class V>
typedef V::const_reference shark::blas::vector_range< V >::const_reference

Definition at line 198 of file vector_proxy.hpp.

§ evaluation_category

template<class V>
typedef elementwise_tag shark::blas::vector_range< V >::evaluation_category

Definition at line 211 of file vector_proxy.hpp.

§ index_pointer

template<class V>
typedef index_pointer<V>::type shark::blas::vector_range< V >::index_pointer

Definition at line 205 of file vector_proxy.hpp.

§ iterator

template<class V>
typedef subrange_iterator< typename vector_closure_type::iterator> shark::blas::vector_range< V >::iterator

Definition at line 291 of file vector_proxy.hpp.

§ pointer

template<class V>
typedef pointer<V>::type shark::blas::vector_range< V >::pointer

Definition at line 201 of file vector_proxy.hpp.

§ reference

template<class V>
typedef reference<V>::type shark::blas::vector_range< V >::reference

Definition at line 199 of file vector_proxy.hpp.

§ storage_category

template<class V>
typedef V::storage_category shark::blas::vector_range< V >::storage_category

Definition at line 210 of file vector_proxy.hpp.

Constructor & Destructor Documentation

§ vector_range() [1/2]

template<class V>
shark::blas::vector_range< V >::vector_range ( vector_closure_type const &  data,
range const &  r 
)
inline

Definition at line 214 of file vector_proxy.hpp.

References RANGE_CHECK, and shark::blas::vector_reference< V >::size().

§ vector_range() [2/2]

template<class V>
template<class E >
shark::blas::vector_range< V >::vector_range ( vector_range< E > const &  other,
typename boost::disable_if< boost::is_same< E, vector_range< V > > >::type *  dummy = 0 
)
inline

Definition at line 222 of file vector_proxy.hpp.

Member Function Documentation

§ begin() [1/2]

template<class V>
const_iterator shark::blas::vector_range< V >::begin ( ) const
inline

Definition at line 294 of file vector_proxy.hpp.

§ begin() [2/2]

template<class V>
iterator shark::blas::vector_range< V >::begin ( )
inline

Definition at line 300 of file vector_proxy.hpp.

§ clear()

§ clear_element()

template<class V>
iterator shark::blas::vector_range< V >::clear_element ( iterator  pos)
inline

Definition at line 331 of file vector_proxy.hpp.

§ clear_range()

template<class V>
iterator shark::blas::vector_range< V >::clear_range ( iterator  first,
iterator  last 
)
inline

Definition at line 327 of file vector_proxy.hpp.

§ end() [1/2]

template<class V>
const_iterator shark::blas::vector_range< V >::end ( ) const
inline

Definition at line 306 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::size().

§ end() [2/2]

template<class V>
iterator shark::blas::vector_range< V >::end ( )
inline

Definition at line 312 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::size().

§ expression() [1/2]

template<class V>
vector_closure_type const& shark::blas::vector_range< V >::expression ( ) const
inline

Definition at line 238 of file vector_proxy.hpp.

§ expression() [2/2]

template<class V>
vector_closure_type& shark::blas::vector_range< V >::expression ( )
inline

Definition at line 241 of file vector_proxy.hpp.

§ operator()()

template<class V>
reference shark::blas::vector_range< V >::operator() ( index_type  i) const
inline

Definition at line 277 of file vector_proxy.hpp.

§ operator=() [1/2]

template<class V>
vector_range& shark::blas::vector_range< V >::operator= ( vector_range< V > const &  vr)
inline

Definition at line 282 of file vector_proxy.hpp.

References shark::blas::assign().

§ operator=() [2/2]

template<class V>
template<class E >
vector_range& shark::blas::vector_range< V >::operator= ( vector_expression< E > const &  e)
inline

Definition at line 287 of file vector_proxy.hpp.

References shark::blas::assign().

§ range()

template<class V>
blas::range const& shark::blas::vector_range< V >::range ( ) const
inline

Definition at line 245 of file vector_proxy.hpp.

§ reserve()

template<class V>
void shark::blas::vector_range< V >::reserve ( size_type  non_zeros)
inline

Definition at line 335 of file vector_proxy.hpp.

§ set_element()

template<class V>
iterator shark::blas::vector_range< V >::set_element ( iterator  pos,
index_type  index,
value_type  value 
)
inline

Definition at line 323 of file vector_proxy.hpp.

§ size()

template<class V>
size_type shark::blas::vector_range< V >::size ( ) const
inline

Return the size of the vector.

Definition at line 250 of file vector_proxy.hpp.

§ start()

template<class V>
size_type shark::blas::vector_range< V >::start ( ) const
inline

Definition at line 234 of file vector_proxy.hpp.

§ storage()

template<class V>
pointer shark::blas::vector_range< V >::storage ( ) const
inline

Returns the pointer to the beginning of the vector storage.

Low-level access to the vectors internals. Elements storage()[i*stride()] for i=1,...,size()-1 are valid

Definition at line 261 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::expression(), and shark::blas::vector_reference< V >::stride().

§ stride()

template<class V>
difference_type shark::blas::vector_range< V >::stride ( ) const
inline

Returns the stride between the elements in storage()

In general elements of dense storage entities are spaced like storage()[i*stride()] for i=1,...,size()-1

Definition at line 268 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::expression().


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