competitive/data_structure/
mod.rs

1//! data structures
2
3use crate::algebra::{
4    AbelianGroup, AbelianMonoid, AdditiveOperation, Associative, EmptyAct, Group, LazyMapMonoid,
5    Magma, MaxOperation, MinOperation, Monoid, MonoidAct, SemiGroup, Unital,
6};
7use crate::algorithm::{BitDpExt, SliceBisectExt};
8use crate::num::{Bounded, RangeBoundsExt};
9use crate::tools::{Comparator, Xorshift, comparator};
10
11#[codesnip::entry("Accumulate")]
12pub use self::accumulate::{Accumulate, Accumulate2d, AccumulateKd};
13#[codesnip::entry("Allocator")]
14pub use self::allocator::{Allocator, BoxAllocator, MemoryPool};
15#[codesnip::entry("BinaryIndexedTree")]
16pub use self::binary_indexed_tree::BinaryIndexedTree;
17#[codesnip::entry("BinaryIndexedTree2D")]
18pub use self::binary_indexed_tree_2d::BinaryIndexedTree2D;
19#[codesnip::entry("BitVector")]
20pub use self::bit_vector::{BitVector, RankSelectDictionaries};
21#[codesnip::entry("BitSet")]
22pub use self::bitset::BitSet;
23#[codesnip::entry("compress")]
24pub use self::compress::{Compressor, HashCompress, VecCompress};
25#[codesnip::entry("CompressedBinaryIndexedTree")]
26pub use self::compressed_binary_indexed_tree::{
27    CompressedBinaryIndexedTree, CompressedBinaryIndexedTree1d, CompressedBinaryIndexedTree2d,
28    CompressedBinaryIndexedTree3d, CompressedBinaryIndexedTree4d,
29};
30#[codesnip::entry("CompressedSegmentTree")]
31pub use self::compressed_segment_tree::{
32    CompressedSegmentTree, CompressedSegmentTree1d, CompressedSegmentTree2d,
33    CompressedSegmentTree3d, CompressedSegmentTree4d,
34};
35#[codesnip::entry("container")]
36pub use self::container::{
37    BTreeMapFactory, Container, ContainerEntry, ContainerFactory, HashMapFactory,
38    HashMapFactoryWithCapacity,
39};
40#[codesnip::entry("Counter")]
41pub use self::counter::{BTreeCounter, HashCounter};
42#[codesnip::entry("DisjointSparseTable")]
43pub use self::disjoint_sparse_table::DisjointSparseTable;
44#[codesnip::entry("FibonacciHash")]
45pub use self::fibonacci_hash::{
46    FibHashMap, FibHashSet, FibonacciHasher, FibonacciHasheru32, FibonacciHasheru64,
47};
48#[codesnip::entry("Static2DTree")]
49pub use self::kdtree::Static2DTree;
50#[codesnip::entry("LazySegmentTree")]
51pub use self::lazy_segment_tree::LazySegmentTree;
52#[codesnip::entry("LazySegmentTreeMap")]
53pub use self::lazy_segment_tree_map::LazySegmentTreeMap;
54#[codesnip::entry("LineSet")]
55pub use self::line_set::LineSet;
56#[codesnip::entry("PairingHeap")]
57pub use self::pairing_heap::PairingHeap;
58#[codesnip::entry("PartiallyRetroactivePriorityQueue")]
59pub use self::partially_retroactive_priority_queue::PartiallyRetroactivePriorityQueue;
60#[codesnip::entry("RangeArithmeticProgressionAdd")]
61pub use self::range_ap_add::RangeArithmeticProgressionAdd;
62#[codesnip::entry("RangeFrequency")]
63pub use self::range_frequency::RangeFrequency;
64#[codesnip::entry("RangeMap")]
65pub use self::range_map::{RangeMap, RangeSet};
66#[codesnip::entry("SegmentTree")]
67pub use self::segment_tree::SegmentTree;
68#[codesnip::entry("SegmentTreeMap")]
69pub use self::segment_tree_map::SegmentTreeMap;
70#[codesnip::entry("sliding_window_aggregation")]
71pub use self::sliding_window_aggregation::{DequeAggregation, QueueAggregation};
72#[codesnip::entry("slope_trick")]
73pub use self::slope_trick::SlopeTrick;
74#[codesnip::entry("SparseSet")]
75pub use self::sparse_set::SparseSet;
76#[codesnip::entry("SplayTree")]
77pub use self::splay_tree::{SplayMap, SplaySequence};
78#[codesnip::entry("SubmaskRangeQuery")]
79pub use self::submask_range_query::SubmaskRangeQuery;
80#[codesnip::entry("transducer")]
81pub use self::transducer::*;
82#[codesnip::entry("Treap")]
83pub use self::treap::{Treap, TreapData};
84#[codesnip::entry("Trie")]
85pub use self::trie::Trie;
86#[codesnip::entry("UnionFind")]
87pub use self::union_find::{
88    MergingUnionFind, PotentializedUnionFind, UndoableUnionFind, UnionFind, UnionFindBase,
89};
90#[codesnip::entry("VecMap")]
91pub use self::vec_map::{FixedVecMapFactory, VecMap, VecMapFactory, VecMapFactoryWithCapacity};
92#[codesnip::entry("WaveletMatrix")]
93pub use self::wavelet_matrix::WaveletMatrix;
94
95#[cfg_attr(
96    nightly,
97    codesnip::entry("Accumulate", include("algebra", "discrete_steps"))
98)]
99mod accumulate;
100#[cfg_attr(nightly, codesnip::entry("Allocator"))]
101mod allocator;
102#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree", include("algebra")))]
103mod binary_indexed_tree;
104#[cfg_attr(nightly, codesnip::entry("BinaryIndexedTree2D", include("algebra")))]
105mod binary_indexed_tree_2d;
106#[cfg_attr(
107    nightly,
108    codesnip::entry("binary_search_tree", include("Allocator", "LazyMapMonoid"))
109)]
110pub mod binary_search_tree;
111#[cfg_attr(nightly, codesnip::entry("BitVector"))]
112mod bit_vector;
113#[cfg_attr(nightly, codesnip::entry("BitSet"))]
114mod bitset;
115#[cfg_attr(nightly, codesnip::entry("compress", include("binary_search")))]
116mod compress;
117#[cfg_attr(
118    nightly,
119    codesnip::entry("CompressedBinaryIndexedTree", include("algebra", "binary_search"))
120)]
121mod compressed_binary_indexed_tree;
122#[cfg_attr(
123    nightly,
124    codesnip::entry("CompressedSegmentTree", include("algebra", "binary_search"))
125)]
126mod compressed_segment_tree;
127#[cfg_attr(nightly, codesnip::entry("container"))]
128mod container;
129#[cfg_attr(nightly, codesnip::entry("Counter"))]
130mod counter;
131#[cfg_attr(nightly, codesnip::entry("DisjointSparseTable", include("algebra")))]
132mod disjoint_sparse_table;
133#[cfg_attr(nightly, codesnip::entry("FibonacciHash"))]
134mod fibonacci_hash;
135#[cfg_attr(nightly, codesnip::entry("Static2DTree"))]
136mod kdtree;
137#[cfg_attr(
138    nightly,
139    codesnip::entry("LazySegmentTree", include("LazyMapMonoid", "discrete_steps"))
140)]
141mod lazy_segment_tree;
142#[cfg_attr(
143    nightly,
144    codesnip::entry("LazySegmentTreeMap", include("LazyMapMonoid", "discrete_steps"))
145)]
146mod lazy_segment_tree_map;
147#[cfg_attr(nightly, codesnip::entry("LineSet", include("bounded")))]
148mod line_set;
149#[cfg_attr(
150    nightly,
151    codesnip::entry("PairingHeap", include("Comparator", "MonoidAct"))
152)]
153mod pairing_heap;
154#[cfg_attr(
155    nightly,
156    codesnip::entry(
157        "PartiallyRetroactivePriorityQueue",
158        include("bounded", "SegmentTree", "MaxOperation", "MinOperation")
159    )
160)]
161pub mod partially_retroactive_priority_queue;
162#[cfg_attr(nightly, codesnip::entry("RangeArithmeticProgressionAdd"))]
163mod range_ap_add;
164#[cfg_attr(
165    nightly,
166    codesnip::entry("RangeFrequency", include("BinaryIndexedTree", "AdditiveOperation"))
167)]
168mod range_frequency;
169#[cfg_attr(nightly, codesnip::entry("RangeMap"))]
170mod range_map;
171#[cfg_attr(
172    nightly,
173    codesnip::entry("SegmentTree", include("algebra", "discrete_steps"))
174)]
175mod segment_tree;
176#[cfg_attr(
177    nightly,
178    codesnip::entry("SegmentTreeMap", include("algebra", "discrete_steps"))
179)]
180mod segment_tree_map;
181#[cfg_attr(
182    nightly,
183    codesnip::entry("sliding_window_aggregation", include("algebra"))
184)]
185mod sliding_window_aggregation;
186#[cfg_attr(nightly, codesnip::entry("slope_trick"))]
187mod slope_trick;
188#[cfg_attr(nightly, codesnip::entry("SparseSet"))]
189mod sparse_set;
190#[cfg_attr(
191    nightly,
192    codesnip::entry("SplayTree", include("Allocator", "LazyMapMonoid"))
193)]
194pub mod splay_tree;
195#[cfg_attr(
196    nightly,
197    codesnip::entry("SubmaskRangeQuery", include("algebra", "BitDp", "Xorshift"))
198)]
199pub mod submask_range_query;
200#[cfg_attr(
201    nightly,
202    codesnip::entry(
203        "transducer",
204        include("algebra", "container", "VecMap", "digit_sequence")
205    )
206)]
207mod transducer;
208#[cfg_attr(
209    nightly,
210    codesnip::entry("Treap", include("binary_search_tree", "Xorshift"))
211)]
212pub mod treap;
213#[cfg_attr(nightly, codesnip::entry("Trie", include("algebra")))]
214mod trie;
215#[cfg_attr(
216    nightly,
217    codesnip::entry("UnionFind", include("algebra", "TupleOperation"))
218)]
219pub mod union_find;
220#[cfg_attr(nightly, codesnip::entry("VecMap", include("container")))]
221mod vec_map;
222#[cfg_attr(nightly, codesnip::entry("WaveletMatrix", include("BitVector")))]
223mod wavelet_matrix;