1 #ifndef SPARSE_VECTOR_HH
2 #define SPARSE_VECTOR_HH
9 #include <unordered_map>
12 #include "sparse_vector_base.hh"
32 using map_type = std::unordered_map<key_type, value_type>;
57 v.
end() != it; ++it) {
58 out << it->first <<
":" << it->second <<
" ";
Base class template for sparse vector and matrix.
Definition: sparse_vector_base.hh:23
size_t size_type
usual definition of size_type
Definition: sparse_vector_base.hh:30
const value_type & def() const
Default value.
Definition: sparse_vector_base.hh:272
const_iterator begin() const
Begin const iterator over vector entries.
Definition: sparse_vector_base.hh:251
const_iterator end() const
End const iterator over vector entries.
Definition: sparse_vector_base.hh:262
typename map_type::const_iterator const_iterator
Stl-compatible constant iterator over vector elements.
Definition: sparse_vector_base.hh:37
Represents a sparse vector.
Definition: sparse_vector.hh:24
T value_type
type of vector entries
Definition: sparse_vector.hh:30
typename parent_t::size_type size_type
usual definition of size_type
Definition: sparse_vector.hh:29
SparseVector(const value_type &def)
Construct with default value.
Definition: sparse_vector.hh:40
size_type key_type
type of vector index
Definition: sparse_vector.hh:31
std::unordered_map< key_type, value_type > map_type
map type
Definition: sparse_vector.hh:32
Definition: aligner.cc:15
std::ostream & operator<<(std::ostream &out, const AlignerRestriction &r)
Definition: aligner_restriction.hh:135