Boost.uBlas 1.49
Linear Algebra in C++: matrices, vectors and numeric algorithms

boost::numeric::ublas::mapped_vector< T, A > Class Template Reference

Index map based sparse vector. More...

#include <vector_sparse.hpp>

Inheritance diagram for boost::numeric::ublas::mapped_vector< T, A >:
Collaboration diagram for boost::numeric::ublas::mapped_vector< T, A >:

List of all members.

Classes

class  const_iterator
class  iterator

Public Types

typedef A array_type
typedef vector_reference
< self_type
closure_type
typedef const vector_reference
< const self_type
const_closure_type
typedef const value_typeconst_reference
typedef reverse_iterator_base
< const_iterator
const_reverse_iterator
typedef mapped_vector< T, A > container_type
typedef A::difference_type difference_type
typedef mapped_vector< T, A > expression_type
typedef detail::map_traits< A,
T >::reference 
reference
typedef reverse_iterator_base
< iterator
reverse_iterator
typedef A::size_type size_type
typedef sparse_tag storage_category
typedef vector_tag type_category
typedef T value_type
typedef self_type vector_temporary_type

Public Member Functions

BOOST_UBLAS_INLINE mapped_vector ()
BOOST_UBLAS_INLINE mapped_vector (size_type size, size_type non_zeros=0)
template<class AE >
BOOST_UBLAS_INLINE mapped_vector (const vector_expression< AE > &ae, size_type non_zeros=0)
BOOST_UBLAS_INLINE mapped_vector (const mapped_vector &v)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectorassign (const vector_expression< AE > &ae)
BOOST_UBLAS_INLINE mapped_vectorassign_temporary (mapped_vector &v)
BOOST_UBLAS_INLINE const_iterator begin () const
BOOST_UBLAS_INLINE iterator begin ()
BOOST_UBLAS_INLINE void clear ()
BOOST_UBLAS_INLINE const
array_type
data () const
BOOST_UBLAS_INLINE array_typedata ()
BOOST_UBLAS_INLINE const_iterator end () const
BOOST_UBLAS_INLINE iterator end ()
BOOST_UBLAS_INLINE void erase_element (size_type i)
const_iterator find (size_type i) const
iterator find (size_type i)
BOOST_UBLAS_INLINE pointer find_element (size_type i)
BOOST_UBLAS_INLINE const_pointer find_element (size_type i) const
BOOST_UBLAS_INLINE true_reference insert_element (size_type i, const_reference t)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectorminus_assign (const vector_expression< AE > &ae)
BOOST_UBLAS_INLINE size_type nnz () const
BOOST_UBLAS_INLINE size_type nnz_capacity () const
BOOST_UBLAS_INLINE reference operator() (size_type i)
BOOST_UBLAS_INLINE container_typeoperator() ()
BOOST_UBLAS_INLINE const
container_type
operator() () const
BOOST_UBLAS_INLINE const_reference operator() (size_type i) const
template<class AT >
BOOST_UBLAS_INLINE mapped_vectoroperator*= (const AT &at)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectoroperator+= (const vector_expression< AE > &ae)
template<class C >
BOOST_UBLAS_INLINE mapped_vectoroperator+= (const vector_container< C > &v)
template<class C >
BOOST_UBLAS_INLINE mapped_vectoroperator-= (const vector_container< C > &v)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectoroperator-= (const vector_expression< AE > &ae)
template<class AT >
BOOST_UBLAS_INLINE mapped_vectoroperator/= (const AT &at)
BOOST_UBLAS_INLINE mapped_vectoroperator= (const mapped_vector &v)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectoroperator= (const vector_expression< AE > &ae)
template<class C >
BOOST_UBLAS_INLINE mapped_vectoroperator= (const vector_container< C > &v)
BOOST_UBLAS_INLINE const_reference operator[] (size_type i) const
BOOST_UBLAS_INLINE reference operator[] (size_type i)
template<class AE >
BOOST_UBLAS_INLINE mapped_vectorplus_assign (const vector_expression< AE > &ae)
BOOST_UBLAS_INLINE
const_reverse_iterator 
rbegin () const
BOOST_UBLAS_INLINE reverse_iterator rbegin ()
BOOST_UBLAS_INLINE true_reference ref (size_type i)
BOOST_UBLAS_INLINE
const_reverse_iterator 
rend () const
BOOST_UBLAS_INLINE reverse_iterator rend ()
BOOST_UBLAS_INLINE void reserve (size_type non_zeros=0, bool preserve=true)
BOOST_UBLAS_INLINE void resize (size_type size, bool preserve=true)
template<class Archive >
void serialize (Archive &ar, const unsigned int)
BOOST_UBLAS_INLINE size_type size () const
BOOST_UBLAS_INLINE void swap (mapped_vector &v)

Static Public Attributes

static const unsigned complexity

Private Types

typedef const T * const_pointer
typedef A::const_iterator const_subiterator_type
typedef T * pointer
typedef mapped_vector< T, A > self_type
typedef A::iterator subiterator_type
typedef T & true_reference

Private Member Functions

BOOST_UBLAS_INLINE true_reference at_element (size_type i)
BOOST_UBLAS_INLINE size_type restrict_capacity (size_type non_zeros) const

Private Attributes

array_type data_
size_type size_

Static Private Attributes

static const value_type zero_ = value_type()

Friends

BOOST_UBLAS_INLINE friend void swap (mapped_vector &v1, mapped_vector &v2)

Detailed Description

template<class T, class A>
class boost::numeric::ublas::mapped_vector< T, A >

Index map based sparse vector.

A sparse vector of values of type T of variable size. The sparse storage type A can be std::map<size_t, T> or map_array<size_t, T>. This means that only non-zero elements are effectively stored.

For a $n$-dimensional sparse vector, and 0 <= i < n the non-zero elements $v_i$ are mapped to consecutive elements of the associative container, i.e. for elements $k = v_{i_1}$ and $k + 1 = v_{i_2}$ of the container, holds $i_1 < i_2$.

Supported parameters for the adapted array are map_array<std::size_t, T> and map_std<std::size_t, T>. The latter is equivalent to std::map<std::size_t, T>.

Template Parameters:
Tthe type of object stored in the vector (like double, float, complex, etc...)
Athe type of Storage array

Definition at line 280 of file vector_sparse.hpp.


Member Typedef Documentation

template<class T, class A>
typedef T& boost::numeric::ublas::mapped_vector< T, A >::true_reference [private]

Definition at line 283 of file vector_sparse.hpp.

template<class T, class A>
typedef T* boost::numeric::ublas::mapped_vector< T, A >::pointer [private]

Definition at line 284 of file vector_sparse.hpp.

template<class T, class A>
typedef const T* boost::numeric::ublas::mapped_vector< T, A >::const_pointer [private]

Definition at line 285 of file vector_sparse.hpp.

template<class T, class A>
typedef mapped_vector<T, A> boost::numeric::ublas::mapped_vector< T, A >::self_type [private]

Definition at line 286 of file vector_sparse.hpp.

template<class T, class A>
typedef A::size_type boost::numeric::ublas::mapped_vector< T, A >::size_type

Definition at line 291 of file vector_sparse.hpp.

template<class T, class A>
typedef A::difference_type boost::numeric::ublas::mapped_vector< T, A >::difference_type

Definition at line 292 of file vector_sparse.hpp.

template<class T, class A>
typedef T boost::numeric::ublas::mapped_vector< T, A >::value_type

Definition at line 293 of file vector_sparse.hpp.

template<class T, class A>
typedef A boost::numeric::ublas::mapped_vector< T, A >::array_type

Definition at line 294 of file vector_sparse.hpp.

template<class T, class A>
typedef const value_type& boost::numeric::ublas::mapped_vector< T, A >::const_reference

Definition at line 295 of file vector_sparse.hpp.

template<class T, class A>
typedef detail::map_traits<A,T>::reference boost::numeric::ublas::mapped_vector< T, A >::reference

Definition at line 297 of file vector_sparse.hpp.

template<class T, class A>
typedef const vector_reference<const self_type> boost::numeric::ublas::mapped_vector< T, A >::const_closure_type

Definition at line 301 of file vector_sparse.hpp.

template<class T, class A>
typedef vector_reference<self_type> boost::numeric::ublas::mapped_vector< T, A >::closure_type

Definition at line 302 of file vector_sparse.hpp.

template<class T, class A>
typedef self_type boost::numeric::ublas::mapped_vector< T, A >::vector_temporary_type

Definition at line 303 of file vector_sparse.hpp.

template<class T, class A>
typedef sparse_tag boost::numeric::ublas::mapped_vector< T, A >::storage_category

Definition at line 304 of file vector_sparse.hpp.

template<class T, class A>
typedef A::const_iterator boost::numeric::ublas::mapped_vector< T, A >::const_subiterator_type [private]

Definition at line 553 of file vector_sparse.hpp.

template<class T, class A>
typedef A::iterator boost::numeric::ublas::mapped_vector< T, A >::subiterator_type [private]

Definition at line 554 of file vector_sparse.hpp.

Definition at line 732 of file vector_sparse.hpp.

Definition at line 733 of file vector_sparse.hpp.

Definition at line 281 of file expression_types.hpp.


Constructor & Destructor Documentation

template<class T, class A>
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( ) [inline]

Definition at line 308 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( size_type  size,
size_type  non_zeros = 0 
) [inline]

Definition at line 312 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( const mapped_vector< T, A > &  v) [inline]

Definition at line 318 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( const vector_expression< AE > &  ae,
size_type  non_zeros = 0 
) [inline]

Definition at line 323 of file vector_sparse.hpp.


Member Function Documentation

template<class T, class A>
BOOST_UBLAS_INLINE size_type boost::numeric::ublas::mapped_vector< T, A >::size ( ) const [inline]

Definition at line 332 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE size_type boost::numeric::ublas::mapped_vector< T, A >::nnz_capacity ( ) const [inline]

Definition at line 336 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE size_type boost::numeric::ublas::mapped_vector< T, A >::nnz ( ) const [inline]

Definition at line 340 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const array_type& boost::numeric::ublas::mapped_vector< T, A >::data ( ) const [inline]

Definition at line 346 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE array_type& boost::numeric::ublas::mapped_vector< T, A >::data ( ) [inline]

Definition at line 350 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE size_type boost::numeric::ublas::mapped_vector< T, A >::restrict_capacity ( size_type  non_zeros) const [inline, private]

Definition at line 357 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::resize ( size_type  size,
bool  preserve = true 
) [inline]

Definition at line 363 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::reserve ( size_type  non_zeros = 0,
bool  preserve = true 
) [inline]

Definition at line 375 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE pointer boost::numeric::ublas::mapped_vector< T, A >::find_element ( size_type  i) [inline]

Definition at line 381 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_pointer boost::numeric::ublas::mapped_vector< T, A >::find_element ( size_type  i) const [inline]

Definition at line 385 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_reference boost::numeric::ublas::mapped_vector< T, A >::operator() ( size_type  i) const [inline]

Definition at line 395 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE true_reference boost::numeric::ublas::mapped_vector< T, A >::ref ( size_type  i) [inline]

Definition at line 404 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE reference boost::numeric::ublas::mapped_vector< T, A >::operator() ( size_type  i) [inline]

Definition at line 411 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_reference boost::numeric::ublas::mapped_vector< T, A >::operator[] ( size_type  i) const [inline]

Definition at line 421 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE reference boost::numeric::ublas::mapped_vector< T, A >::operator[] ( size_type  i) [inline]

Definition at line 425 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE true_reference boost::numeric::ublas::mapped_vector< T, A >::insert_element ( size_type  i,
const_reference  t 
) [inline]

Definition at line 431 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::erase_element ( size_type  i) [inline]

Definition at line 440 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::clear ( ) [inline]

Definition at line 449 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator= ( const mapped_vector< T, A > &  v) [inline]

Definition at line 455 of file vector_sparse.hpp.

template<class T, class A>
template<class C >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator= ( const vector_container< C > &  v) [inline]

Definition at line 464 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::assign_temporary ( mapped_vector< T, A > &  v) [inline]

Definition at line 470 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator= ( const vector_expression< AE > &  ae) [inline]

Definition at line 476 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::assign ( const vector_expression< AE > &  ae) [inline]

Definition at line 482 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator+= ( const vector_expression< AE > &  ae) [inline]

Definition at line 490 of file vector_sparse.hpp.

template<class T, class A>
template<class C >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator+= ( const vector_container< C > &  v) [inline]

Definition at line 496 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::plus_assign ( const vector_expression< AE > &  ae) [inline]

Definition at line 502 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator-= ( const vector_expression< AE > &  ae) [inline]

Definition at line 508 of file vector_sparse.hpp.

template<class T, class A>
template<class C >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator-= ( const vector_container< C > &  v) [inline]

Definition at line 514 of file vector_sparse.hpp.

template<class T, class A>
template<class AE >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::minus_assign ( const vector_expression< AE > &  ae) [inline]

Definition at line 520 of file vector_sparse.hpp.

template<class T, class A>
template<class AT >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator*= ( const AT &  at) [inline]

Definition at line 526 of file vector_sparse.hpp.

template<class T, class A>
template<class AT >
BOOST_UBLAS_INLINE mapped_vector& boost::numeric::ublas::mapped_vector< T, A >::operator/= ( const AT &  at) [inline]

Definition at line 532 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::swap ( mapped_vector< T, A > &  v) [inline]

Definition at line 539 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE true_reference boost::numeric::ublas::mapped_vector< T, A >::at_element ( size_type  i) [inline, private]

Definition at line 557 of file vector_sparse.hpp.

template<class T, class A>
const_iterator boost::numeric::ublas::mapped_vector< T, A >::find ( size_type  i) const [inline]

Definition at line 571 of file vector_sparse.hpp.

template<class T, class A>
iterator boost::numeric::ublas::mapped_vector< T, A >::find ( size_type  i) [inline]

Definition at line 575 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_iterator boost::numeric::ublas::mapped_vector< T, A >::begin ( ) const [inline]

Definition at line 648 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_iterator boost::numeric::ublas::mapped_vector< T, A >::end ( ) const [inline]

Definition at line 652 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE iterator boost::numeric::ublas::mapped_vector< T, A >::begin ( ) [inline]

Definition at line 723 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE iterator boost::numeric::ublas::mapped_vector< T, A >::end ( ) [inline]

Definition at line 727 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rbegin ( ) const [inline]

Definition at line 736 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rend ( ) const [inline]

Definition at line 740 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rbegin ( ) [inline]

Definition at line 744 of file vector_sparse.hpp.

template<class T, class A>
BOOST_UBLAS_INLINE reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rend ( ) [inline]

Definition at line 748 of file vector_sparse.hpp.

template<class T, class A>
template<class Archive >
void boost::numeric::ublas::mapped_vector< T, A >::serialize ( Archive &  ar,
const unsigned  int 
) [inline]

Definition at line 754 of file vector_sparse.hpp.

BOOST_UBLAS_INLINE const container_type& boost::numeric::ublas::vector_container< mapped_vector< T, A > >::operator() ( ) const [inline, inherited]
BOOST_UBLAS_INLINE container_type& boost::numeric::ublas::vector_container< mapped_vector< T, A > >::operator() ( ) [inline, inherited]

Friends And Related Function Documentation

template<class T, class A>
BOOST_UBLAS_INLINE friend void swap ( mapped_vector< T, A > &  v1,
mapped_vector< T, A > &  v2 
) [friend]

Definition at line 546 of file vector_sparse.hpp.


Member Data Documentation

template<class T, class A>
size_type boost::numeric::ublas::mapped_vector< T, A >::size_ [private]

Definition at line 764 of file vector_sparse.hpp.

template<class T, class A>
array_type boost::numeric::ublas::mapped_vector< T, A >::data_ [private]

Definition at line 765 of file vector_sparse.hpp.

template<class T, class A>
const mapped_vector< T, A >::value_type boost::numeric::ublas::mapped_vector< T, A >::zero_ = value_type() [static, private]

Definition at line 766 of file vector_sparse.hpp.

const unsigned boost::numeric::ublas::vector_container< mapped_vector< T, A > >::complexity [static, inherited]

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