competitive/data_structure/
mod.rs

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