75#ifndef __ADS_Capabilities
76 #define __ADS_Capabilities
107template<
class... E >
121constexpr auto key_of(
void )
123 if constexpr(
requires {
typename S::Key; } )
124 return( std::type_identity< typename S::Key >() );
125 else if constexpr(
requires {
typename S::key_type; } )
126 return( std::type_identity< typename S::key_type >() );
127 else if constexpr(
requires {
typename S::value_type; } )
128 return( std::type_identity< typename S::value_type >() );
130 return( std::type_identity< std::size_t >() );
136 using type =
typename decltype( key_of< S >() )::type;
142 using type = mod::list<>;
146 requires requires {
typename S::modifications; }
149 using type =
typename S::modifications;
155 using type = queue_item_t< Q >;
160 requires {
typename Q::Key; } && !
requires {
typename Q::Priority; } )
161struct priority_of< Q >
163 using type =
typename Q::Key;
167 requires requires {
typename Q::Priority; }
168struct priority_of< Q >
170 using type =
typename Q::Priority;
226 if constexpr(
requires { S::monotone; } )
227 return(
unsigned( S::monotone ) );
235 { S::monotone } -> std::convertible_to< unsigned >;
250 std::derived_from< T , forwarding_query > && std::is_empty_v< T >;
263 static constexpr bool meet(
bool a ,
bool b ) {
return( a && b ); }
277 static constexpr bool meet(
bool a ,
bool b ) {
return( a && b ); }
295 return( std::max( a , b ) );
321template<
class S ,
class T >
322constexpr auto query_of(
void )
324 if constexpr(
requires { S::query( T() ); } )
325 return( S::query( T() ) );
327 return( T::template fallback< S >() );
335template<
class S , forwarding_query_tag T >
337 detail::query_of< std::remove_cvref_t< S > , T >();
342 T::meet( T::template fallback< int >() , T::template fallback< int >() );
346template<
class A ,
class B , meetable_query T >
356 template<
class S , forwarding_query_tag T >
357 constexpr auto operator()(
const S & , T )
const noexcept {
367inline constexpr detail::Query
query{};
384 constexpr void operator()( S & s , std::size_t n )
const {
385 if constexpr(
requires { s.reserve( n ); } )
387 else if constexpr(
requires {
reserve( s , n ); } )
395 void operator()(
const void * p )
const noexcept { prefetchLine( p ); }
397 void operator()(
const void * p , Locality l )
const noexcept {
398 prefetchLine( p , l );
400 template<
class S ,
class K >
401 requires( ! std::is_same_v< K , Locality > )
402 constexpr void operator()(
const S & s ,
const K & k )
const {
403 if constexpr(
requires { s.prefetch( k ); } )
405 else if constexpr(
requires {
prefetch( s , k ); } )
410template<
class S ,
class R >
412 requires( S & s , R && r )
413{ s.insert_bulk( std::forward< R >( r ) ); };
414template<
class S ,
class R >
416 requires( S & s , R && r )
418template<
class S ,
class R >
420 std::ranges::input_range< R > &&
421 requires( S & s , std::ranges::range_reference_t< R > x )
426 template<
class S ,
class R >
427 requires( member_bulk< S , R > || free_bulk< S , R > || one_by_one< S , R > )
428 constexpr void operator()( S & s , R && r )
const {
429 if constexpr( member_bulk< S , R > )
430 s.insert_bulk( std::forward< R >( r ) );
431 else if constexpr( free_bulk< S , R > )
464template<
class S ,
class R = std::span< const key_type_t< S > > >
466{ s.insert_bulk( r ); };
470template<
class S ,
class R = std::span< const key_type_t< S > > >
472{ s.erase_bulk( r ); };
480{ std::move( s ).split( k ); };
489 { S::join2( std::move( l ) , std::move( r ) ) } -> std::same_as< S >;
494template<
class S ,
class K = key_type_t< S > >
495concept rankable =
requires(
const S & s ,
const K & k )
497 { s.rank( k ) } -> std::convertible_to< std::size_t >;
503template<
class S ,
class G =
void >
505 ( std::is_void_v< G > &&
506 requires(
const S & s , std::size_t i )
507{ s.select( i ); } ) ||
508 ( ! std::is_void_v< G > &&
509 requires(
const S & s ,
bool ( *p )(
const typename G::Value & ) )
516template<
class S ,
class K = key_type_t< S > >
518 requires(
const S & s ,
const K & k )
529template<
class S ,
class G >
535 } -> std::convertible_to< typename G::Value >;
541template<
class S ,
class A >
544{ s.applyRange( k , k , a ); };
580 if constexpr(
requires { Q::decrease_key; } )
581 return( Q::decrease_key );
599 requires( Q & q ,
typename Q::Handle h ,
const typename Q::Priority & p )
618 std::vector< queue_item_t< Q > > & out )
620 q.extract( theta , out );
628{ q.shift_all( d ); };
655template<
class Q ,
class F = detail::same_key< Q > >
676 typename T::Clear::Stamp;
678 { ct.epoch() } -> std::convertible_to< std::uint64_t >;
689{ s.rollback( s.checkpoint() ); };
707 template<
class... A >
708 void operator()( A &&... )
const;
718 requires(
const G & g ,
int v , detail::any_arc f )
719{ g.forEachIn( v , f ); };
726 { g.arcId( u , u ) } -> std::convertible_to< std::size_t >;
The prefetch of a line of the cache, beyond the book: ADS::prefetch( p ) asks the processor to bring ...
The PRIORITYQUEUE of section 10.1, with decreasing priority, in two concepts.
the PRIORITYQUEUE of section 10.1 with handles and decreasing priority: the types Item,...
Definition PriorityQueue.h:115
the PRIORITYQUEUE of section 10.1 without handles: the type of the items (Item or value_type),...
Definition PriorityQueue.h:102
an AddressablePriorityQueue with increase( h , p ) and erase( h ) on its handles as well (the open li...
Definition Capabilities.h:597
augRange( lo , hi ), the values of the augmentation G of the keys in combined, kept by the structure...
Definition Capabilities.h:530
batch(), a group of changes told as one (the observers of a batch of changes)
Definition Capabilities.h:732
erase_bulk( r ) of the range of keys as one operation (the event BulkErased)
Definition Capabilities.h:471
insert_bulk( r ) of the range of items as one operation (the generic insertion of a range,...
Definition Capabilities.h:465
whether S declares the only direction in which its values move
Definition Capabilities.h:234
clear() in by epochs: a policy of clear(), T::Clear, that stamps the places, and epoch() (the node t...
Definition Capabilities.h:674
erase( k ) of a key (the node tables that reuse their places within an episode)
Definition Capabilities.h:666
a tag of a forwarded query
Definition Capabilities.h:249
forEachIn( v , f ), the arcs entering (the observers that repair a tree from the heads of the arcs t...
Definition Capabilities.h:717
S::join2( l , r ), the tree of the keys of and of when those of are smaller (the union of Blelloch...
Definition Capabilities.h:487
whether the query T composes two answers
Definition Capabilities.h:341
update( id ), the key of the item read again from the table the queue observes (the queue of the ope...
Definition Capabilities.h:609
prefetch( k ), a hint that (a key or its hash) is looked up next (a batch of lookups by group prefet...
Definition Capabilities.h:517
applyRange( lo , hi , a ), the action applied to every value of the keys in in by a lazy tag (the ...
Definition Capabilities.h:542
rank( k ), the number of keys smaller than (the order statistics); its time is the query rank_comple...
Definition Capabilities.h:495
rekey( f ), the key of each item recomputed by and the order rebuilt in (the change of the key func...
Definition Capabilities.h:656
reserve( n ), room for items (the builders)
Definition Capabilities.h:523
select( i ), the key of rank (the order statistics); with an augmentation G, augSelect( p ),...
Definition Capabilities.h:504
shift_all( delta ), every key moved by in (D* Lite, Generalized Adaptive A*)
Definition Capabilities.h:626
snapshot(), a view of the present state in which later changes do not touch (the audits,...
Definition Capabilities.h:694
std::move( s ).split( k ), the keys before , its value and the keys after it (the set operations of B...
Definition Capabilities.h:478
arcId( u , v ), an id of the arc that does not change while the arc is in the graph (the observers th...
Definition Capabilities.h:724
checkpoint() and rollback( t ) back to a checkpoint (a speculative change, a batch that exits by an e...
Definition Capabilities.h:688
constexpr detail::InsertBulk insert_bulk
the items of the range inserted in : s.insert_bulk( r ), else insert_bulk( s , r ) found by ADL,...
Definition Capabilities.h:456
typename detail::modifications_of< S >::type modifications_of
the events of S [see Modification.h], S::modifications if it declares them, the empty list otherwise:...
Definition Capabilities.h:185
constexpr decrease_key_kind decrease_key_of(void)
how the queue Q lowers a priority: Q::decrease_key if it declares it (e.g., a queue whose decrease() ...
Definition Capabilities.h:578
decrease_key_kind
how a priority queue lowers the priority of an item: it cannot (none), by a new insertion and the sta...
Definition Capabilities.h:553
constexpr unsigned monotone_of(void)
the directions in which the values of S may move, as the bits up and down of mod::effect: S::monotone...
Definition Capabilities.h:224
typename detail::key_type_of< S >::type key_type_t
the keys of S, which its lookups take: S::Key, else S::key_type, else S::value_type,...
Definition Capabilities.h:179
typename detail::priority_of< Q >::type priority_t
the priorities of the queue Q: Q::Priority, else Q::Key (the first key of a queue of two,...
Definition Capabilities.h:190
constexpr detail::Prefetch prefetch
a hint that is looked up next: s.prefetch( k ), else prefetch( s , k ) found by ADL,...
Definition Capabilities.h:451
complexity
a class of time, from the cheapest
Definition Capabilities.h:281
constexpr detail::Query query
the answer of to the query of the tag , query_v< S , T >
Definition Capabilities.h:367
constexpr bool enable_stable_references
whether the items of S keep their addresses while they are in it, so that a handle may be a pointer a...
Definition Capabilities.h:203
constexpr bool nonmonotone_values
whether the values of the nodes of the table T may grow as well as fall, so that its concurrent field...
Definition Capabilities.h:216
constexpr auto query_meet_v
the answer of the composition of A and B to the query T
Definition Capabilities.h:347
constexpr auto query_v
the answer of S to the query T, at compile time: the static S::query( T() ) if it has one,...
Definition Capabilities.h:336
constexpr stable_references_t stable_references
the tags of the queries
Definition Capabilities.h:312
constexpr detail::Reserve reserve
room for items in : s.reserve( n ), else reserve( s , n ) found by ADL, else nothing (the builders)
Definition Capabilities.h:444
@ lazy
Definition Capabilities.h:553
@ none
Definition Capabilities.h:553
@ native
Definition Capabilities.h:553
@ constant
Definition Capabilities.h:281
@ logarithmic
Definition Capabilities.h:281
@ linear
Definition Capabilities.h:281
Growth linear(double a, double beta)
the order of ,
GrB_Type type(void)
the type of GraphBLAS of the numbers T: GrB_BOOL, the integers of 8 to 64 bits with or without sign,...
Definition GraphBLAS.h:128
constexpr detail::QueueDecrease queue_decrease
the priority of the item of the handle of lowered to , i.e., the item moved toward the minimum: q....
Definition QueueCustomization.h:295
typename detail::queue_handle< Q >::type queue_handle_t
the handles of the queue Q, which its insertions return: Q::Handle, else Q::handle_type (the mutable ...
Definition QueueCustomization.h:250
typename detail::queue_item< Q >::type queue_item_t
the items of the queue Q: Q::Item, else Q::value_type
Definition QueueCustomization.h:93
Definition Capabilities.h:104
constexpr rank_complexity_t rank_complexity
Definition Capabilities.h:314
constexpr event_set_t event_set
Definition Capabilities.h:315
constexpr thread_safe_reads_t thread_safe_reads
Definition Capabilities.h:313
the query of the events of a structure, as std::type_identity of a mod::list; by default modification...
Definition Capabilities.h:303
static constexpr auto fallback(void)
the answer of a structure that does not give one
Definition Capabilities.h:306
the base of the tags of the queries that a wrapper forwards to what it wraps
Definition Capabilities.h:245
a list of types, the events of a structure [see Modification.h]
Definition Modification.h:482
the query of the time of rank(), so that an rank is not taken for an one; linear by default,...
Definition Capabilities.h:287
static constexpr complexity fallback(void)
the answer of a structure that does not give one
Definition Capabilities.h:290
static constexpr complexity meet(complexity a, complexity b)
the answer of the composition of two structures
Definition Capabilities.h:294
the query of whether the items keep their addresses; by default enable_stable_references< S >,...
Definition Capabilities.h:256
static constexpr bool meet(bool a, bool b)
the answer of the composition of two structures
Definition Capabilities.h:263
static constexpr bool fallback(void)
the answer of a structure that does not give one
Definition Capabilities.h:259
the query of whether reads may run with other reads and with writes from other threads; false by defa...
Definition Capabilities.h:270
static constexpr bool meet(bool a, bool b)
the answer of the composition of two structures
Definition Capabilities.h:277
static constexpr bool fallback(void)
the answer of a structure that does not give one
Definition Capabilities.h:273