Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 >:

Classes

class  const_iterator
 
class  iterator
 

Public Types

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

Public Member Functions

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

Static Public Attributes

static const unsigned complexity
 

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

Member Typedef Documentation

template<class T , class A >
typedef A boost::numeric::ublas::mapped_vector< T, A >::array_type
template<class T , class A >
typedef vector_reference<self_type> boost::numeric::ublas::mapped_vector< T, A >::closure_type
template<class T , class A >
typedef const vector_reference<const self_type> boost::numeric::ublas::mapped_vector< T, A >::const_closure_type
template<class T , class A >
typedef const value_type& boost::numeric::ublas::mapped_vector< T, A >::const_reference
template<class T , class A >
typedef reverse_iterator_base<const_iterator> boost::numeric::ublas::mapped_vector< T, A >::const_reverse_iterator
template<class T , class A >
typedef A::difference_type boost::numeric::ublas::mapped_vector< T, A >::difference_type
template<class E>
typedef E boost::numeric::ublas::vector_expression< E >::expression_type
inherited
template<class T , class A >
typedef detail::map_traits<A,T>::reference boost::numeric::ublas::mapped_vector< T, A >::reference
template<class T , class A >
typedef reverse_iterator_base<iterator> boost::numeric::ublas::mapped_vector< T, A >::reverse_iterator
template<class T , class A >
typedef A::size_type boost::numeric::ublas::mapped_vector< T, A >::size_type
template<class T , class A >
typedef sparse_tag boost::numeric::ublas::mapped_vector< T, A >::storage_category
template<class T , class A >
typedef T boost::numeric::ublas::mapped_vector< T, A >::value_type
template<class T , class A >
typedef self_type boost::numeric::ublas::mapped_vector< T, A >::vector_temporary_type

Constructor & Destructor Documentation

template<class T , class A >
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( )
inline
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
template<class T , class A >
BOOST_UBLAS_INLINE boost::numeric::ublas::mapped_vector< T, A >::mapped_vector ( const mapped_vector< T, A > &  v)
inline
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

Member Function Documentation

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
template<class T , class A >
BOOST_UBLAS_INLINE iterator boost::numeric::ublas::mapped_vector< T, A >::begin ( void  )
inline
template<class T , class A >
BOOST_UBLAS_INLINE const_iterator boost::numeric::ublas::mapped_vector< T, A >::cbegin ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE const_iterator boost::numeric::ublas::mapped_vector< T, A >::cend ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::clear ( void  )
inline
template<class T , class A >
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::crbegin ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::crend ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE array_type& boost::numeric::ublas::mapped_vector< T, A >::data ( )
inline
template<class T , class A >
BOOST_UBLAS_INLINE iterator boost::numeric::ublas::mapped_vector< T, A >::end ( void  )
inline
template<class T , class A >
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::erase_element ( size_type  i)
inline
template<class T , class A >
BOOST_UBLAS_INLINE pointer boost::numeric::ublas::mapped_vector< T, A >::find_element ( size_type  i)
inline
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
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
template<class T , class A >
BOOST_UBLAS_INLINE size_type boost::numeric::ublas::mapped_vector< T, A >::nnz_capacity ( ) const
inline
BOOST_UBLAS_INLINE const container_type& boost::numeric::ublas::vector_container< mapped_vector< T, A > >::operator() ( ) const
inlineinherited
BOOST_UBLAS_INLINE container_type& boost::numeric::ublas::vector_container< mapped_vector< T, A > >::operator() ( )
inlineinherited
template<class T , class A >
BOOST_UBLAS_INLINE reference boost::numeric::ublas::mapped_vector< T, A >::operator() ( size_type  i)
inline
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

References boost::xpressive::at.

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
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
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

References boost::xpressive::at.

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
template<class T , class A >
BOOST_UBLAS_INLINE const_reference boost::numeric::ublas::mapped_vector< T, A >::operator[] ( size_type  i) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE reference boost::numeric::ublas::mapped_vector< T, A >::operator[] ( size_type  i)
inline
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
template<class T , class A >
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rbegin ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rbegin ( )
inline
template<class T , class A >
BOOST_UBLAS_INLINE const_reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rend ( ) const
inline
template<class T , class A >
BOOST_UBLAS_INLINE reverse_iterator boost::numeric::ublas::mapped_vector< T, A >::rend ( )
inline
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
template<class T , class A >
template<class Archive >
void boost::numeric::ublas::mapped_vector< T, A >::serialize ( Archive &  ar,
const unsigned  int 
)
inline
template<class T , class A >
BOOST_UBLAS_INLINE void boost::numeric::ublas::mapped_vector< T, A >::swap ( mapped_vector< T, A > &  v)
inline

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

Member Data Documentation

const unsigned boost::numeric::ublas::vector_container< mapped_vector< T, A > >::complexity
staticinherited

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