.\" .de Id .. .de Sp .if n .sp .if t .sp 0.4 .. .TH pair_set 7rheolef "rheolef-7.0" "rheolef-7.0" "rheolef-7.0" .\" label: /*Class: .SH NAME pair_set - a set of (index,value) pair (rheolef-7.0) .SH SYNOPSIS A class for: l = {(0,3.3),...(7,8.2)} i.e. a wrapper for STL \fBmap\fP with some assignment operators, such as l1 += l2. This class is suitable for use with the \fBdisarray\fP class, as \fBdisarray\fP (see disarray(2)). .SH TODO template with A=std::allocator or heap_allocator difficulty: get heap_allocator or std::allocator and then requires heap_allocator> or std::allocator<>pair> for std::map .PP .\" skip start:AUTHOR: .\" skip start:DATE: .\" END .SH IMPLEMENTATION .\" begin_example .Sp .nf template > > class pair_set: public std::map > { // TODO: use A extra-arg for std::map for heap_allocator public: // typedefs: typedef std::size_t size_type; typedef std::pair pair_type; typedef std::pair const_pair_type; typedef pair_type value_type; typedef std::map > // TODO: use allocator_type for heap_allocator base; #ifdef TODO typedef typename base::allocator_type allocator_type; #endif // TODO typedef A allocator_type; typedef typename base::iterator iterator; typedef typename base::const_iterator const_iterator; // allocators: pair_set (const A& alloc = A()); pair_set (const pair_set& x, const A& alloc = A()); pair_set& operator= (const pair_set& x); void clear (); // basic algebra: semantic of a sparse vector pair_set& operator+= (const pair_type& x); // c := a union {x} template pair_set& operator+= (const pair_set& b); // c := a union b // boost mpi: template void serialize (Archive& ar, const unsigned int version); }; // io: template std::istream& operator>> (std::istream& is, pair_set& a); template std::ostream& operator<< (std::ostream& os, const pair_set& b); .Sp .fi .\" end_example .\" LENGTH = 1 .SH SEE ALSO disarray(2) .SH COPYRIGHT Copyright (C) 2000-2018 Pierre Saramito GPLv3+: GNU GPL version 3 or later . This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.