Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::Interval_Tree_Vtl< T, Compare > Struct Template Reference

Interval tree using nodes with virtual destructor. More...

#include <tpl_interval_tree.H>

Inheritance diagram for Aleph::Interval_Tree_Vtl< T, Compare >:
[legend]
Collaboration diagram for Aleph::Interval_Tree_Vtl< T, Compare >:
[legend]

Public Types

using Base = Gen_Interval_Tree< Interval_Tree_NodeVtl, T, Compare >
 
- Public Types inherited from Aleph::Gen_Interval_Tree< NodeType, T, Compare >
using Key = Interval< T >
 
using IntervalCmp = Interval_Less< T, Compare >
 
using Node = NodeType< Key >
 

Additional Inherited Members

- Public Member Functions inherited from Aleph::Gen_Interval_Tree< NodeType, T, Compare >
void set_seed (const unsigned long seed) noexcept
 Set the random number generator seed.
 
IntervalCmp key_comp () const noexcept
 Return the interval comparison functor (over Interval<T> keys)
 
const Compare & endpoint_comp () const noexcept
 Return the endpoint comparison functor (const)
 
const Compare & get_compare () const noexcept
 Backwards-compatible accessor for the endpoint comparator.
 
void swap (Gen_Interval_Tree &tree) noexcept(noexcept(std::swap(tree_root, tree.tree_root)) and noexcept(std::swap(cmp, tree.cmp)) and noexcept(std::swap(r, tree.r)) and noexcept(std::swap(num_nodes, tree.num_nodes)))
 Swap all state with tree in O(1)
 
 Gen_Interval_Tree (const unsigned long seed, const Compare &_cmp=Compare())
 Construct with explicit seed and comparator.
 
 Gen_Interval_Tree (const Compare &_cmp=Compare())
 Construct with default seed (from system time).
 
 Gen_Interval_Tree (const Gen_Interval_Tree &)=delete
 Deleted copy constructor.
 
Gen_Interval_Treeoperator= (const Gen_Interval_Tree &)=delete
 Deleted copy assignment.
 
 Gen_Interval_Tree (Gen_Interval_Tree &&)=delete
 Deleted move constructor.
 
Gen_Interval_Treeoperator= (Gen_Interval_Tree &&)=delete
 Deleted move assignment.
 
 ~Gen_Interval_Tree ()
 
gsl_rnggsl_rng_object () const noexcept
 Get a pointer to the GSL random number generator.
 
Node *& getRoot () noexcept
 Return the tree's root.
 
const NodegetRoot () const
 Return the tree's root (const)
 
size_t size () const noexcept
 Return the number of nodes.
 
bool is_empty () const noexcept
 Return true if the tree is empty.
 
void reset_num_nodes () noexcept
 Reset the node count (used after manual tree destruction)
 
const Nodesearch (const Key &key) const
 Search for an exact interval in the tree.
 
Nodeinsert (Node *p)
 Insert a node (no duplicates).
 
Nodeinsert_dup (Node *p)
 Insert a node (duplicates allowed).
 
Noderemove (const Key &key)
 Remove an interval from the tree.
 
const Nodeoverlap_search (const Key &query) const
 Find any interval that overlaps with query (CLRS algorithm).
 
template<class Op >
void all_overlaps (const Key &query, Op &&op) const
 Apply op to every interval overlapping query.
 
DynList< Keyfind_all_overlaps (const Key &query) const
 Find all intervals overlapping query.
 
template<class Op >
void stab (const T &p, Op &&op) const
 Apply op to every interval containing point p.
 
DynList< Keyfind_stab (const T &p) const
 Find all intervals containing point p.
 
bool verify () const
 Verify BST, heap, and max_endpoint invariants.
 

Detailed Description

template<typename T, class Compare = Aleph::less<T>>
requires StrictWeakOrder<Compare, T>
struct Aleph::Interval_Tree_Vtl< T, Compare >

Interval tree using nodes with virtual destructor.

Template Parameters
TEndpoint type.
CompareComparison functor for endpoints.

Definition at line 995 of file tpl_interval_tree.H.

Member Typedef Documentation

◆ Base

template<typename T , class Compare = Aleph::less<T>>
using Aleph::Interval_Tree_Vtl< T, Compare >::Base = Gen_Interval_Tree<Interval_Tree_NodeVtl, T, Compare>

Definition at line 998 of file tpl_interval_tree.H.


The documentation for this struct was generated from the following file: