Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::BSTPolicy Concept Reference

Concept for BST tree policies used by DynSetTree. More...

#include <ah-concepts.H>

Concept definition

template<typename T, typename Key>
concept Aleph::BSTPolicy =
requires { typename T::Node; } &&
requires(T & t, T & t2, const T & ct,
typename T::Node * p, const Key & key)
{
{ t.getRoot() } -> std::convertible_to<typename T::Node *>;
{ t.search(key) } -> std::convertible_to<typename T::Node *>;
{ t.search_or_insert(p) } -> std::convertible_to<typename T::Node *>;
{ t.insert_dup(p) } -> std::convertible_to<typename T::Node *>;
{ t.remove(key) } -> std::convertible_to<typename T::Node *>;
{ ct.verify() } -> std::convertible_to<bool>;
{ t.swap(t2) };
{ t.get_compare() };
requires (!requires { ct.getRoot(); } ||
requires
{
{ ct.getRoot() } -> std::convertible_to<const typename T::Node *>;
});
requires (!requires { ct.search(key); } ||
requires
{
{ ct.search(key) } -> std::convertible_to<const typename T::Node *>;
});
}
Concept for BST tree policies used by DynSetTree.
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.
std::decay_t< typename HeadC::Item_Type > T
Definition ah-zip.H:105

Detailed Description

Concept for BST tree policies used by DynSetTree.

Checks that an instantiated tree type T = Tree<Key, Compare> exposes the minimal interface required by DynSetTree: a Node type alias and the core operations getRoot, search, search_or_insert, insert_dup, remove, verify, swap, and get_compare.

Optional operations (join, select, position, …) are NOT checked here because not every tree type supports them.

Template Parameters
Tthe fully instantiated tree type, e.g. Avl_Tree<int>.
Keythe key type stored in the tree.

Definition at line 116 of file ah-concepts.H.