2 #ifndef vbl_io_sparse_array_base_hxx_ 3 #define vbl_io_sparse_array_base_hxx_ 9 #include <vsl/vsl_pair_io.h> 10 #include <vsl/vsl_binary_io.h> 14 template<
class T,
class Index>
17 constexpr
short io_version_no = 1;
23 std::pair<Index, T> tt((*s).first, (*s).second);
30 template<
class T,
class Index>
45 std::pair<Index, T> value;
46 for (
unsigned i=0; i<size; i++){
48 p(value.first)=value.second;
54 std::cerr <<
"I/O ERROR: vsl_b_read(vsl_b_istream&, vbl_sparse_array_base<T, Index> &)\n" 55 <<
" Unknown version number "<< v <<
'\n';
56 is.is().
clear(std::ios::badbit);
64 template<
class T,
class Index>
71 s != p.
end() && k<5; ++s)
84 #define VBL_IO_SPARSE_ARRAY_BASE_INSTANTIATE(T, I) \ 85 template void vsl_print_summary(std::ostream &, const vbl_sparse_array_base<T , I > &); \ 86 template void vsl_b_read(vsl_b_istream &, vbl_sparse_array_base<T , I > &); \ 87 template void vsl_b_write(vsl_b_ostream &, const vbl_sparse_array_base<T , I > &) 89 #endif // vbl_io_sparse_array_base_hxx_ Map::const_iterator const_iterator
The type of iterators into the efficient storage.
size_type count_nonempty() const
Return number of locations that have been assigned a value using "put".
const_iterator end() const
A bidirectional iterator pointing just beyond last non-empty element.
const_iterator begin() const
A bidirectional iterator pointing at the first non-empty element.
void vsl_b_write(vsl_b_ostream &os, const vbl_sparse_array_base< T, Index > &p)
Binary save self to stream.
void clear()
Empty the sparse matrix.
void vsl_b_read(vsl_b_istream &is, vbl_sparse_array_base< T, Index > &p)
Binary load self from stream.
A fully featured sparse array which devolves indexing to its templated type.
void vsl_print_summary(std::ostream &os, const vbl_sparse_array_base< T, Index > &p)
Output a human readable summary to the stream.