20 #ifndef _PASL_DATA_MAP_H_
21 #define _PASL_DATA_MAP_H_
31 template <
class Item,
class Item_swap>
41 : item(), no_item(true) { }
44 : item(item), no_item(false) { }
47 : item(other.item), no_item(other.no_item) { }
50 Item_swap::swap(item, other.
item);
51 std::swap(no_item, other.
no_item);
74 template <
class Item,
class Measured>
79 using key_type =
typename value_type::first_type;
99 template <
class Option>
118 util::atomic::fatal([] {
119 std::cout <<
"inverse operation not supported" << std::endl;
130 template <
class Item,
class Size,
class Key_swap>
151 template <
class Item>
166 class Compare = std::less<Key>,
167 class Key_swap = std_swap<Key>,
168 class Alloc = std::allocator<std::pair<const Key, Item> >,
204 option_type target(k);
205 it.search_by([target] (
const option_type& key) {
206 return target >= key;
232 return ((*it).first == k) ? it : seq.
end();
237 if (it == seq.
end()) {
243 }
else if ((*it).first != k) {
255 if (it == seq.
end()-1) {
265 return nb - seq.
size();
268 std::ostream&
stream(std::ostream& out)
const {
272 out <<
"(" << v.first <<
"," << v.second <<
")";
option(const option &other)
iterator erase(iterator first, iterator last)
Erases items.
iterator begin() const
Returns iterator to beginning.
measured_type operator()(const value_type *lo, const value_type *hi) const
ptrdiff_t difference_type
void push_back(const value_type &x)
Adds item at the end.
bool operator>=(const self_type &y) const
size_type size() const
Returns size.
const value_type & const_reference
static value_type inverse(value_type x)
const value_type * const_pointer
static value_type combine(value_type left, value_type right)
value_type pop_front()
Deletes first item.
iterator find(const key_type &k) const
typename container_type::iterator iterator
std::ostream & stream(std::ostream &out) const
Iterator< self_type, config_type > iterator
iterator end() const
Returns iterator to end.
static value_type identity()
static void swap(measured_type &x, measured_type &y)
void for_each(const Body &f) const
Visits every item in the container.
mapped_type & operator[](const key_type &k) const
static constexpr bool has_inverse
std::pair< key_type, mapped_type > value_type
bool operator<(const self_type &y) const
typename value_type::first_type key_type
size_type erase(const key_type &k)
iterator insert(iterator position, const value_type &val)
Inserts items.
typename value_type::first_type key_type
const int chunk_capacity
[weighted_split_example]
typename algebra_type::value_type measured_type
static void swap(Item &x, Item &y)
measured_type operator()(const value_type &v) const
Chunked-sequence functor.