64#ifndef __ADS_RangeTree
65 #define __ADS_RangeTree
96template< std::totally_ordered T >
97 requires std::numeric_limits< T >::is_specialized
115 return(
Value( c , p.second ) );
120 Value m( a.size() + b.size() );
121 std::merge( a.begin() , a.end() , b.begin() , b.end() , m.begin() );
148 template< Executor E >
163 void insert(
const T & x ,
const T & y );
178 void remove(
const T & x ,
const T & y );
181 [[nodiscard]] std::size_t
size(
void )
const {
return( f_n ); }
203 [[nodiscard]] std::size_t
count(
const T & x1 ,
const T & x2 ,
const T & y1 ,
204 const T & y2 )
const;
211 static std::vector< std::pair< Point , std::size_t > >
212 counted( std::vector< Point > & P );
227#include "ADS/geometry/impl/RangeTree.tpp"
The contracts of ADS: the preconditions, the postconditions and the invariants of the operations,...
The layer of execution of the parallel algorithms of ADS, beyond the book: an executor runs the calls...
The binary search trees balanced by join alone, and the augmented maps, beyond the book: JoinTree< K ...
a DICTIONARY on a binary search tree balanced by the join of B alone, augmented by G,...
Definition JoinTree.h:291
std::pair< T, T > Point
Definition RangeTree.h:103
void remove(const T &x, const T &y)
one copy less of , if there,
RangeTree(std::vector< Point > P)
the points of , sorted, counted and inserted by multiInsert(),
RangeTree(void)=default
no point
std::size_t count(const T &x1, const T &x2, const T &y1, const T &y2) const
the points of , with their copies,
void insert(const T &x, const T &y)
one more copy of , , since the ordinates of all its ancestors are merged again
std::size_t size(void) const
the points, with their copies
Definition RangeTree.h:181
RangeTree(E &ex, std::vector< Point > P)
the points of , as above, on the threads of ex
the augmentation: the sorted ordinates, with their copies
Definition RangeTree.h:107
static Value identity(void)
the empty sequence, the identity of the merge
Definition RangeTree.h:111
static Value combine(const Value &a, const Value &b)
the merge of the sorted sequences and ,
Definition RangeTree.h:119
std::vector< T > Value
the ordinates of a subtree, sorted
Definition RangeTree.h:109
static Value from(const Point &p, const std::size_t &c)
copies of the ordinate of the point
Definition RangeTree.h:114