shark::blas::dense_vector_adaptor< T > Class Template Reference

Represents a given chunk of memory as a dense vector of elements of type T. More...

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

+ Inheritance diagram for shark::blas::dense_vector_adaptor< T >:

Public Types

typedef value_type const & const_reference
 
typedef T & reference
 
typedef T * pointer
 
typedef value_type const * const_pointer
 
typedef index_type const * const_index_pointer
 
typedef index_type * index_pointer
 
typedef dense_tag storage_category
 
typedef elementwise_tag evaluation_category
 
typedef dense_storage_iterator< T > iterator
 
typedef dense_storage_iterator< value_type const > const_iterator
 

Public Member Functions

template<class E >
 dense_vector_adaptor (vector_expression< E > const &expression)
 Constructor of a self_type proxy from a Dense VectorExpression. More...
 
template<class E >
 dense_vector_adaptor (vector_expression< E > &expression)
 Constructor of a self_type proxy from a Dense VectorExpression. More...
 
 dense_vector_adaptor (pointer values, size_type size, difference_type stride=1)
 Constructor of a self_type proxy from a block of memory. More...
 
template<class U >
 dense_vector_adaptor (dense_vector_adaptor< U > const &v)
 Copy-constructor of a self_type. More...
 
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 th stride between the elements in storage() More...
 
const_reference operator() (index_type i) const
 Return a const reference to the element \(i\). More...
 
reference operator() (index_type i)
 Return a reference to the element \(i\). More...
 
const_reference operator[] (index_type i) const
 Return a const reference to the element \(i\). More...
 
reference operator[] (index_type i)
 Return a reference to the element \(i\). More...
 
reference insert_element (index_type i, const_reference t)
 Set element \(i\) to the value t. More...
 
void erase_element (index_type i)
 Set element \(i\) to the zero value. More...
 
dense_vector_adaptoroperator= (dense_vector_adaptor const &e)
 
template<class E >
dense_vector_adaptoroperator= (const vector_expression< E > &e)
 
const_iterator begin () const
 return an iterator on the first element of the vector More...
 
const_iterator end () const
 return an iterator after the last element of the vector More...
 
iterator begin ()
 Return an iterator on the first element of the vector. More...
 
iterator end ()
 Return an iterator at the end of the vector. More...
 
iterator set_element (iterator pos, index_type index, value_type value)
 
iterator clear_element (iterator pos)
 
iterator clear_range (iterator start, iterator end)
 
- Public Member Functions inherited from shark::blas::vector_expression< dense_vector_adaptor< T > >
const expression_type & operator() () const
 
expression_type & operator() ()
 

Detailed Description

template<class T>
class shark::blas::dense_vector_adaptor< T >

Represents a given chunk of memory as a dense vector of elements of type T.

This adaptor is read/write if T is non-const and read-only if T is const.

Definition at line 380 of file vector_proxy.hpp.

Member Typedef Documentation

§ const_index_pointer

template<class T>
typedef index_type const* shark::blas::dense_vector_adaptor< T >::const_index_pointer

Definition at line 395 of file vector_proxy.hpp.

§ const_iterator

template<class T>
typedef dense_storage_iterator<value_type const> shark::blas::dense_vector_adaptor< T >::const_iterator

Definition at line 526 of file vector_proxy.hpp.

§ const_pointer

template<class T>
typedef value_type const* shark::blas::dense_vector_adaptor< T >::const_pointer

Definition at line 392 of file vector_proxy.hpp.

§ const_reference

template<class T>
typedef value_type const& shark::blas::dense_vector_adaptor< T >::const_reference

Definition at line 389 of file vector_proxy.hpp.

§ evaluation_category

template<class T>
typedef elementwise_tag shark::blas::dense_vector_adaptor< T >::evaluation_category

Definition at line 401 of file vector_proxy.hpp.

§ index_pointer

template<class T>
typedef index_type* shark::blas::dense_vector_adaptor< T >::index_pointer

Definition at line 396 of file vector_proxy.hpp.

§ iterator

template<class T>
typedef dense_storage_iterator<T> shark::blas::dense_vector_adaptor< T >::iterator

Definition at line 525 of file vector_proxy.hpp.

§ pointer

template<class T>
typedef T* shark::blas::dense_vector_adaptor< T >::pointer

Definition at line 391 of file vector_proxy.hpp.

§ reference

template<class T>
typedef T& shark::blas::dense_vector_adaptor< T >::reference

Definition at line 390 of file vector_proxy.hpp.

§ storage_category

template<class T>
typedef dense_tag shark::blas::dense_vector_adaptor< T >::storage_category

Definition at line 400 of file vector_proxy.hpp.

Constructor & Destructor Documentation

§ dense_vector_adaptor() [1/4]

template<class T>
template<class E >
shark::blas::dense_vector_adaptor< T >::dense_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
expressionThe Expression from which to construct the Proxy

Definition at line 410 of file vector_proxy.hpp.

§ dense_vector_adaptor() [2/4]

template<class T>
template<class E >
shark::blas::dense_vector_adaptor< T >::dense_vector_adaptor ( vector_expression< E > &  expression)
inline

Constructor of a self_type proxy from a Dense VectorExpression.

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

Parameters
expressionThe Expression from which to construct the Proxy

Definition at line 420 of file vector_proxy.hpp.

§ dense_vector_adaptor() [3/4]

template<class T>
shark::blas::dense_vector_adaptor< T >::dense_vector_adaptor ( pointer  values,
size_type  size,
difference_type  stride = 1 
)
inline

Constructor of a self_type proxy from a block of memory.

Parameters
valuesthe block of memory used
sizesize of the self_type
stridedistance between elements of the self_type in memory

Definition at line 429 of file vector_proxy.hpp.

§ dense_vector_adaptor() [4/4]

template<class T>
template<class U >
shark::blas::dense_vector_adaptor< T >::dense_vector_adaptor ( dense_vector_adaptor< U > const &  v)
inline

Copy-constructor of a self_type.

Parameters
vis the proxy to be copied

Definition at line 435 of file vector_proxy.hpp.

Member Function Documentation

§ begin() [1/2]

template<class T>
const_iterator shark::blas::dense_vector_adaptor< T >::begin ( ) const
inline

return an iterator on the first element of the vector

Definition at line 529 of file vector_proxy.hpp.

§ begin() [2/2]

template<class T>
iterator shark::blas::dense_vector_adaptor< T >::begin ( )
inline

Return an iterator on the first element of the vector.

Definition at line 539 of file vector_proxy.hpp.

§ clear_element()

template<class T>
iterator shark::blas::dense_vector_adaptor< T >::clear_element ( iterator  pos)
inline

Definition at line 555 of file vector_proxy.hpp.

References shark::blas::vector_reference< V >::end(), and SIZE_CHECK.

§ clear_range()

template<class T>
iterator shark::blas::dense_vector_adaptor< T >::clear_range ( iterator  start,
iterator  end 
)
inline

Definition at line 563 of file vector_proxy.hpp.

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

§ end() [1/2]

template<class T>
const_iterator shark::blas::dense_vector_adaptor< T >::end ( ) const
inline

return an iterator after the last element of the vector

Definition at line 534 of file vector_proxy.hpp.

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

§ end() [2/2]

template<class T>
iterator shark::blas::dense_vector_adaptor< T >::end ( )
inline

Return an iterator at the end of the vector.

Definition at line 544 of file vector_proxy.hpp.

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

§ erase_element()

template<class T>
void shark::blas::dense_vector_adaptor< T >::erase_element ( index_type  i)
inline

Set element \(i\) to the zero value.

Parameters
iindex of the element

Definition at line 507 of file vector_proxy.hpp.

§ insert_element()

template<class T>
reference shark::blas::dense_vector_adaptor< T >::insert_element ( index_type  i,
const_reference  t 
)
inline

Set element \(i\) to the value t.

Parameters
iindex of the element
treference to the value to be set

Definition at line 501 of file vector_proxy.hpp.

§ operator()() [1/2]

template<class T>
const_reference shark::blas::dense_vector_adaptor< T >::operator() ( index_type  i) const
inline

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

Parameters
iindex of the element

Definition at line 472 of file vector_proxy.hpp.

§ operator()() [2/2]

template<class T>
reference shark::blas::dense_vector_adaptor< T >::operator() ( index_type  i)
inline

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

Parameters
iindex of the element

Definition at line 478 of file vector_proxy.hpp.

§ operator=() [1/2]

template<class T>
dense_vector_adaptor& shark::blas::dense_vector_adaptor< T >::operator= ( dense_vector_adaptor< T > const &  e)
inline

Definition at line 512 of file vector_proxy.hpp.

References shark::blas::assign().

§ operator=() [2/2]

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

Definition at line 516 of file vector_proxy.hpp.

References shark::blas::assign().

§ operator[]() [1/2]

template<class T>
const_reference shark::blas::dense_vector_adaptor< T >::operator[] ( index_type  i) const
inline

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

Parameters
iindex of the element

Definition at line 484 of file vector_proxy.hpp.

§ operator[]() [2/2]

template<class T>
reference shark::blas::dense_vector_adaptor< T >::operator[] ( index_type  i)
inline

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

Parameters
iindex of the element

Definition at line 490 of file vector_proxy.hpp.

§ set_element()

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

Definition at line 549 of file vector_proxy.hpp.

References SIZE_CHECK.

§ size()

template<class T>
size_type shark::blas::dense_vector_adaptor< T >::size ( ) const
inline

Return the size of the vector.

Definition at line 444 of file vector_proxy.hpp.

§ storage()

template<class T>
pointer shark::blas::dense_vector_adaptor< T >::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 451 of file vector_proxy.hpp.

§ stride()

template<class T>
difference_type shark::blas::dense_vector_adaptor< T >::stride ( ) const
inline

Returns th 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 458 of file vector_proxy.hpp.


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