Coordimate array based sparse vector. More...
#include <vector_sparse.hpp>
Classes | |
class | const_iterator |
class | iterator |
Public Types | |
typedef IA::value_type | size_type |
typedef IA::difference_type | difference_type |
typedef T | value_type |
typedef const T & | const_reference |
typedef T & | reference |
typedef IA | index_array_type |
typedef TA | value_array_type |
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 coordinate_vector< T, IB, IA, TA > | container_type |
typedef vector_tag | type_category |
typedef E | expression_type |
Public Member Functions | |
BOOST_UBLAS_INLINE | coordinate_vector () |
BOOST_UBLAS_INLINE | coordinate_vector (size_type size, size_type non_zeros=0) |
BOOST_UBLAS_INLINE | coordinate_vector (const coordinate_vector &v) |
template<class AE > | |
BOOST_UBLAS_INLINE | coordinate_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 index_array_type::size_type | filled () const |
BOOST_UBLAS_INLINE const index_array_type & | index_data () const |
BOOST_UBLAS_INLINE const value_array_type & | value_data () const |
BOOST_UBLAS_INLINE void | set_filled (const typename index_array_type::size_type &sorted, const typename index_array_type::size_type &filled) |
BOOST_UBLAS_INLINE index_array_type & | index_data () |
BOOST_UBLAS_INLINE value_array_type & | value_data () |
BOOST_UBLAS_INLINE void | resize (size_type size, bool preserve=true) |
BOOST_UBLAS_INLINE void | reserve (size_type non_zeros, 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 void | append_element (size_type i, const_reference t) |
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 coordinate_vector & | operator= (const coordinate_vector &v) |
template<class C > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator= (const vector_container< C > &v) |
BOOST_UBLAS_INLINE coordinate_vector & | assign_temporary (coordinate_vector &v) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator= (const vector_expression< AE > &ae) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | assign (const vector_expression< AE > &ae) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator+= (const vector_expression< AE > &ae) |
template<class C > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator+= (const vector_container< C > &v) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | plus_assign (const vector_expression< AE > &ae) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator-= (const vector_expression< AE > &ae) |
template<class C > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator-= (const vector_container< C > &v) |
template<class AE > | |
BOOST_UBLAS_INLINE coordinate_vector & | minus_assign (const vector_expression< AE > &ae) |
template<class AT > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator*= (const AT &at) |
template<class AT > | |
BOOST_UBLAS_INLINE coordinate_vector & | operator/= (const AT &at) |
BOOST_UBLAS_INLINE void | swap (coordinate_vector &v) |
size_type | lower_bound (size_type beg, size_type end, size_type target) const |
void | inplace_merge (size_type beg, size_type mid, size_type end) const |
BOOST_UBLAS_INLINE void | sort () const |
BOOST_UBLAS_INLINE void | push_back (size_type i, const_reference t) |
BOOST_UBLAS_INLINE void | pop_back () |
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_type & | operator() () |
Static Public Member Functions | |
static BOOST_UBLAS_INLINE size_type | index_base () |
Static Public Attributes | |
static const unsigned | complexity |
Friends | |
class | iterator |
class | const_iterator |
BOOST_UBLAS_INLINE friend void | swap (coordinate_vector &v1, coordinate_vector &v2) |
Coordimate array based sparse vector.
a sparse vector of values of type T
of variable size. The non zero values are stored as two seperate arrays: an index array and a value array. The arrays may be out of order with multiple entries for each vector element. If there are multiple values for the same index the sum of these values is the real value. It is way more efficient for inserting values than a compressed_vector
but less memory efficient. Also linearly parsing a vector can be longer in specific cases than a compressed_vector
.
For a n-dimensional sorted coordinate vector and the non-zero elements are mapped to consecutive elements of the index and value container, i.e. for elements and of these containers holds .
Supported parameters for the adapted array (indices and values) are unbounded_array<>
, bounded_array<>
and std::vector<>
.
T | the type of object stored in the vector (like double, float, complex, etc...) |
IB | the index base of the compressed vector. Default is 0. Other supported value is 1 |
IA | the type of adapted array for indices. Default is unbounded_array<std::size_t> |
TA | the type of adapted array for values. Default is unbounded_array<T> |
typedef vector_reference<self_type> boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::closure_type |
typedef const vector_reference<const self_type> boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_closure_type |
typedef const T& boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_reference |
typedef reverse_iterator_base<const_iterator> boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_reverse_iterator |
|
inherited |
typedef IA::difference_type boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::difference_type |
|
inherited |
typedef IA boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::index_array_type |
typedef T& boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::reference |
typedef reverse_iterator_base<iterator> boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::reverse_iterator |
typedef IA::value_type boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::size_type |
typedef sparse_tag boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::storage_category |
|
inherited |
typedef TA boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::value_array_type |
typedef T boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::value_type |
typedef self_type boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::vector_temporary_type |
|
inline |
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::swap().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator+=(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator-=(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator=().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::find().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::cend(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_iterator::index(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::iterator::index(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::inplace_merge(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::lower_bound(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::rbegin().
|
inline |
|
inline |
|
inline |
|
inline |
References boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_iterator, boost::numeric::ublas::detail::lower_bound(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::sort().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::begin(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::end().
|
inline |
|
inline |
|
inline |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inline |
|
inline |
|
inline |
References boost::xpressive::at.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References boost::xpressive::at.
|
inline |
|
inline |
|
inline |
|
inline |
References boost::multiprecision::backends::i.
|
inline |
References boost::multiprecision::backends::i.
|
inline |
|
inline |
References BOOST_UBLAS_CHECK, and boost::accumulators::extract::min.
|
inline |
|
inline |
|
inline |
|
inline |
References BOOST_UBLAS_CHECK, boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::insert_element(), boost::it, boost::numeric::ublas::detail::lower_bound(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::sort().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator()().
|
inline |
|
inline |
|
inline |
References boost::accumulators::extract::min, boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::resize(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::sort().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::append_element(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::push_back().
|
inline |
References boost::accumulators::extract::min, boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::size(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::sort().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator=(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::reserve().
|
inline |
|
inline |
|
inline |
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_iterator::index(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::iterator::index(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::const_iterator::operator*(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::iterator::operator*(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator=(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::resize().
|
inline |
References boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::filled(), boost::multiprecision::backends::i, and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::inplace_merge().
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::erase_element(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::find(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::find_element(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::operator()(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::ref(), boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::reserve(), and boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::resize().
|
inline |
References boost::swap.
Referenced by boost::numeric::ublas::coordinate_vector< T, IB, IA, TA >::assign_temporary().
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
staticinherited |