From 8e1c9f7da9759e3f8934beb0c0cbe48e0bac60c6 Mon Sep 17 00:00:00 2001 From: ngtkana Date: Tue, 2 Apr 2024 18:29:45 +0000 Subject: [PATCH] deploy: 6fd80ff37e86731a7a755633573c56c6ee2d4c21 --- dependencies.js | 2 +- help.html | 4 +- implementors/core/fmt/trait.Debug.js | 1 + .../iter/traits/collect/trait.FromIterator.js | 2 +- implementors/core/ops/deref/trait.Deref.js | 2 +- implementors/core/ops/deref/trait.DerefMut.js | 2 +- implementors/core/ops/index/trait.Index.js | 2 +- search-index.js | 2 +- segtree/index.html | 2 +- segtree/struct.Dense2dEntry.html | 2 +- segtree/struct.Dense2dSegtree.html | 8 +- segtree/struct.Entry.html | 3 +- segtree/struct.Segtree.html | 9 +- segtree/struct.SegtreeOfSegtrees.html | 14 +- segtree/struct.SparseSegtree.html | 10 +- segtree/trait.Op.html | 8 +- settings.html | 4 +- src/segtree/lib.rs.html | 316 ++++++++++++++++-- 18 files changed, 332 insertions(+), 61 deletions(-) diff --git a/dependencies.js b/dependencies.js index bea0dcfa..fca9f830 100644 --- a/dependencies.js +++ b/dependencies.js @@ -1 +1 @@ -dependencies = {"prefix_sum":{"dependencies":[],"tags":[]},"inversion_number":{"dependencies":[],"tags":[]},"suffix_array":{"dependencies":[],"tags":[]},"manacher":{"dependencies":[],"tags":[]},"mincost_flow":{"dependencies":[],"tags":[]},"bitvec":{"dependencies":[],"tags":[]},"heap_tricks":{"dependencies":[],"tags":[]},"dual_segtree":{"dependencies":[],"tags":[]},"fp":{"dependencies":[],"tags":[]},"make_graph":{"dependencies":[],"tags":[]},"trie":{"dependencies":[],"tags":[]},"hld":{"dependencies":[],"tags":[]},"hopkarp":{"dependencies":[],"tags":[]},"filter_position":{"dependencies":[],"tags":[]},"accum":{"dependencies":[],"tags":[]},"gss":{"dependencies":[],"tags":[]},"advance":{"dependencies":[],"tags":[]},"hungarian":{"dependencies":[],"tags":[]},"rb":{"dependencies":[],"tags":[]},"cht":{"dependencies":[],"tags":[]},"swag":{"dependencies":[],"tags":[]},"itermore":{"dependencies":[],"tags":[]},"box_segtree":{"dependencies":[],"tags":[]},"reverse":{"dependencies":[],"tags":[]},"veb":{"dependencies":[],"tags":[]},"not_nan":{"dependencies":[],"tags":[]},"fps":{"dependencies":["fp"],"tags":[]},"dial":{"dependencies":[],"tags":[]},"convex_hull":{"dependencies":[],"tags":[]},"trial":{"dependencies":[],"tags":[]},"tree_fold":{"dependencies":[],"tags":[]},"bfs":{"dependencies":[],"tags":[]},"partially_persistent_union_find":{"dependencies":[],"tags":[]},"io":{"dependencies":[],"tags":[]},"lagrange":{"dependencies":["fp"],"tags":[]},"dijkstra_radix_heap":{"dependencies":["radix_heap"],"tags":[]},"heap_slope_trick":{"dependencies":[],"tags":[]},"gridnei":{"dependencies":[],"tags":[]},"segbeats":{"dependencies":["open"],"tags":[]},"lazy_segtree":{"dependencies":[],"tags":[]},"cipolla":{"dependencies":[],"tags":[]},"zeta":{"dependencies":[],"tags":[]},"segbeats_task3":{"dependencies":["open"],"tags":[]},"slicemore":{"dependencies":[],"tags":[]},"elim":{"dependencies":[],"tags":[]},"rational":{"dependencies":[],"tags":[]},"numeric_search":{"dependencies":[],"tags":[]},"union_find":{"dependencies":[],"tags":[]},"sparse_table":{"dependencies":[],"tags":[]},"vec_lines":{"dependencies":[],"tags":[]},"randtools":{"dependencies":[],"tags":[]},"poly":{"dependencies":[],"tags":[]},"wavelet_matrix":{"dependencies":[],"tags":[]},"radix_heap":{"dependencies":[],"tags":[]},"uf_checklist":{"dependencies":["union_find"],"tags":[]},"two_sat":{"dependencies":["scc"],"tags":[]},"lg":{"dependencies":[],"tags":[]},"max_flow":{"dependencies":[],"tags":[]},"bitutils":{"dependencies":[],"tags":[]},"avl_tree":{"dependencies":[],"tags":[]},"monotone_minima":{"dependencies":[],"tags":[]},"dfs":{"dependencies":[],"tags":[]},"next_permutation":{"dependencies":[],"tags":[]},"lin_ineq":{"dependencies":[],"tags":[]},"space":{"dependencies":[],"tags":[]},"scc":{"dependencies":[],"tags":[]},"bfs01":{"dependencies":[],"tags":[]},"skew-heap":{"dependencies":[],"tags":[]},"open":{"dependencies":[],"tags":[]},"splay_tree":{"dependencies":[],"tags":[]},"euclid":{"dependencies":[],"tags":[]},"binary":{"dependencies":[],"tags":[]},"gco":{"dependencies":["dinic"],"tags":[]},"lazy_segbeats":{"dependencies":["open"],"tags":[]},"cmpmore":{"dependencies":[],"tags":[]},"erato":{"dependencies":[],"tags":[]},"rbtree":{"dependencies":[],"tags":[]},"newton":{"dependencies":[],"tags":[]},"sort_tree":{"dependencies":[],"tags":[]},"low_link":{"dependencies":[],"tags":[]},"dinic":{"dependencies":[],"tags":[]},"bsgs":{"dependencies":[],"tags":[]},"z_algo":{"dependencies":[],"tags":[]},"segtree":{"dependencies":[],"tags":[]}} \ No newline at end of file +dependencies = {"dual_segtree":{"dependencies":[],"tags":[]},"union_find":{"dependencies":[],"tags":[]},"inversion_number":{"dependencies":[],"tags":[]},"radix_heap":{"dependencies":[],"tags":[]},"bfs01":{"dependencies":[],"tags":[]},"sort_tree":{"dependencies":[],"tags":[]},"advance":{"dependencies":[],"tags":[]},"slicemore":{"dependencies":[],"tags":[]},"box_segtree":{"dependencies":[],"tags":[]},"make_graph":{"dependencies":[],"tags":[]},"heap_slope_trick":{"dependencies":[],"tags":[]},"gco":{"dependencies":["dinic"],"tags":[]},"randtools":{"dependencies":[],"tags":[]},"splay_tree":{"dependencies":[],"tags":[]},"cmpmore":{"dependencies":[],"tags":[]},"fps":{"dependencies":["fp"],"tags":[]},"tree_fold":{"dependencies":[],"tags":[]},"dial":{"dependencies":[],"tags":[]},"numeric_search":{"dependencies":[],"tags":[]},"rb":{"dependencies":[],"tags":[]},"lagrange":{"dependencies":["fp"],"tags":[]},"bitvec":{"dependencies":[],"tags":[]},"skew-heap":{"dependencies":[],"tags":[]},"segbeats":{"dependencies":["open"],"tags":[]},"uf_checklist":{"dependencies":["union_find"],"tags":[]},"monotone_minima":{"dependencies":[],"tags":[]},"cipolla":{"dependencies":[],"tags":[]},"bitutils":{"dependencies":[],"tags":[]},"wavelet_matrix":{"dependencies":[],"tags":[]},"low_link":{"dependencies":[],"tags":[]},"space":{"dependencies":[],"tags":[]},"rational":{"dependencies":[],"tags":[]},"two_sat":{"dependencies":["scc"],"tags":[]},"avl_tree":{"dependencies":[],"tags":[]},"binary":{"dependencies":[],"tags":[]},"hopkarp":{"dependencies":[],"tags":[]},"scc":{"dependencies":[],"tags":[]},"dinic":{"dependencies":[],"tags":[]},"open":{"dependencies":[],"tags":[]},"lin_ineq":{"dependencies":[],"tags":[]},"reverse":{"dependencies":[],"tags":[]},"hungarian":{"dependencies":[],"tags":[]},"sparse_table":{"dependencies":[],"tags":[]},"partially_persistent_union_find":{"dependencies":[],"tags":[]},"lazy_segtree":{"dependencies":[],"tags":[]},"z_algo":{"dependencies":[],"tags":[]},"veb":{"dependencies":[],"tags":[]},"segtree":{"dependencies":[],"tags":[]},"lg":{"dependencies":[],"tags":[]},"gss":{"dependencies":[],"tags":[]},"accum":{"dependencies":[],"tags":[]},"zeta":{"dependencies":[],"tags":[]},"mincost_flow":{"dependencies":[],"tags":[]},"suffix_array":{"dependencies":[],"tags":[]},"prefix_sum":{"dependencies":[],"tags":[]},"bfs":{"dependencies":[],"tags":[]},"swag":{"dependencies":[],"tags":[]},"itermore":{"dependencies":[],"tags":[]},"bsgs":{"dependencies":[],"tags":[]},"elim":{"dependencies":[],"tags":[]},"max_flow":{"dependencies":[],"tags":[]},"manacher":{"dependencies":[],"tags":[]},"newton":{"dependencies":[],"tags":[]},"heap_tricks":{"dependencies":[],"tags":[]},"euclid":{"dependencies":[],"tags":[]},"dijkstra_radix_heap":{"dependencies":["radix_heap"],"tags":[]},"not_nan":{"dependencies":[],"tags":[]},"vec_lines":{"dependencies":[],"tags":[]},"erato":{"dependencies":[],"tags":[]},"trial":{"dependencies":[],"tags":[]},"convex_hull":{"dependencies":[],"tags":[]},"gridnei":{"dependencies":[],"tags":[]},"trie":{"dependencies":[],"tags":[]},"dfs":{"dependencies":[],"tags":[]},"io":{"dependencies":[],"tags":[]},"hld":{"dependencies":[],"tags":[]},"filter_position":{"dependencies":[],"tags":[]},"fp":{"dependencies":[],"tags":[]},"rbtree":{"dependencies":[],"tags":[]},"next_permutation":{"dependencies":[],"tags":[]},"segbeats_task3":{"dependencies":["open"],"tags":[]},"poly":{"dependencies":[],"tags":[]},"cht":{"dependencies":[],"tags":[]},"lazy_segbeats":{"dependencies":["open"],"tags":[]}} \ No newline at end of file diff --git a/help.html b/help.html index dab6a677..0b303496 100644 --- a/help.html +++ b/help.html @@ -1,4 +1,4 @@ -Rustdoc help
Rustdoc help
-

Rustdoc help

Back
\ No newline at end of file +

Rustdoc help

Back
\ No newline at end of file diff --git a/implementors/core/fmt/trait.Debug.js b/implementors/core/fmt/trait.Debug.js index 0f6a2330..94d78509 100644 --- a/implementors/core/fmt/trait.Debug.js +++ b/implementors/core/fmt/trait.Debug.js @@ -35,6 +35,7 @@ "scc":[["impl Debug for Scc"]], "segbeats":[["impl<T: Debug> Debug for Segbeats<T>"]], "segbeats_task3":[["impl<T: Elm> Debug for Segbeats<T>"]], +"segtree":[["impl<'a, O: Op> Debug for Entry<'a, O>where\n O::Value: Debug,"],["impl<K, O: Op> Debug for SparseSegtree<K, O>where\n K: Debug,\n O::Value: Debug,"],["impl<O: Op> Debug for Dense2dSegtree<O>where\n O::Value: Debug,"],["impl<K, L, O: Op> Debug for SegtreeOfSegtrees<K, L, O>where\n K: Debug,\n L: Debug,\n O::Value: Debug,"],["impl<O: Op> Debug for Segtree<O>where\n O::Value: Debug,"]], "skew_heap":[["impl<T: Debug + Ord> Debug for SkewHeap<T>"]], "snippetter":[["impl Debug for CrateMetadata"]], "sparse_table":[["impl<T: Debug> Debug for SparseTableArgmin<T>"]], diff --git a/implementors/core/iter/traits/collect/trait.FromIterator.js b/implementors/core/iter/traits/collect/trait.FromIterator.js index 47f26ab8..1c25c8df 100644 --- a/implementors/core/iter/traits/collect/trait.FromIterator.js +++ b/implementors/core/iter/traits/collect/trait.FromIterator.js @@ -6,7 +6,7 @@ "lazy_segtree":[["impl<O: Op> FromIterator<<O as Op>::Value> for LazySegtree<O>where\n O::Value: Clone,\n O::Operator: Clone,"]], "rb":[["impl<O: Op> FromIterator<<O as Op>::Value> for Seg<O>"]], "rbtree":[["impl<A, O: Op<Value = A>> FromIterator<A> for RbTree<A, O>"]], -"segtree":[["impl<K, O: Op> FromIterator<(K, <O as Op>::Value)> for SparseSegtree<K, O>where\n K: Clone + Ord,\n O::Value: Clone,"],["impl<K, L, O: Op> FromIterator<(K, L, <O as Op>::Value)> for SegtreeOfSegtrees<K, L, O>where\n K: Ord + Clone,\n L: Ord + Clone,\n O::Value: Clone,"],["impl<O: Op> FromIterator<<O as Op>::Value> for Segtree<O>where\n O::Value: Clone,"]], +"segtree":[["impl<K, O: Op> FromIterator<(K, <O as Op>::Value)> for SparseSegtree<K, O>where\n K: Clone + Ord,\n O::Value: Clone,"],["impl<O: Op> FromIterator<<O as Op>::Value> for Segtree<O>where\n O::Value: Clone,"],["impl<K, L, O: Op> FromIterator<(K, L, <O as Op>::Value)> for SegtreeOfSegtrees<K, L, O>where\n K: Ord + Clone,\n L: Ord + Clone,\n O::Value: Clone,"]], "skew_heap":[["impl<A: Ord> FromIterator<A> for SkewHeap<A>"]], "splay_tree":[["impl<O: LazyOps> FromIterator<<O as LazyOps>::Value> for SplayTree<O>"]], "veb":[["impl<V> FromIterator<(usize, V)> for VebMap<V>"],["impl FromIterator<usize> for VebSet"]], diff --git a/implementors/core/ops/deref/trait.Deref.js b/implementors/core/ops/deref/trait.Deref.js index f6f31f39..ca12f9e3 100644 --- a/implementors/core/ops/deref/trait.Deref.js +++ b/implementors/core/ops/deref/trait.Deref.js @@ -1,4 +1,4 @@ (function() {var implementors = { -"segtree":[["impl<'a, O: Op> Deref for Entry<'a, O>"],["impl<'a, O: Op> Deref for Dense2dEntry<'a, O>"]], +"segtree":[["impl<'a, O: Op> Deref for Dense2dEntry<'a, O>"],["impl<'a, O: Op> Deref for Entry<'a, O>"]], "splay_tree":[["impl<O: LazyOps> Deref for Entry<'_, O>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/deref/trait.DerefMut.js b/implementors/core/ops/deref/trait.DerefMut.js index 91654e0a..5bfe649b 100644 --- a/implementors/core/ops/deref/trait.DerefMut.js +++ b/implementors/core/ops/deref/trait.DerefMut.js @@ -1,4 +1,4 @@ (function() {var implementors = { -"segtree":[["impl<'a, O: Op> DerefMut for Entry<'a, O>"],["impl<'a, O: Op> DerefMut for Dense2dEntry<'a, O>"]], +"segtree":[["impl<'a, O: Op> DerefMut for Dense2dEntry<'a, O>"],["impl<'a, O: Op> DerefMut for Entry<'a, O>"]], "splay_tree":[["impl<O: LazyOps> DerefMut for Entry<'_, O>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/ops/index/trait.Index.js b/implementors/core/ops/index/trait.Index.js index dabebee3..9741108c 100644 --- a/implementors/core/ops/index/trait.Index.js +++ b/implementors/core/ops/index/trait.Index.js @@ -1,7 +1,7 @@ (function() {var implementors = { "avl_tree":[["impl<T> Index<usize> for AvlTree<T>"]], "fp":[["impl<const P: u64> Index<usize> for Factorial<P>"]], -"segtree":[["impl<K: Ord, L: Ord, O: Op> Index<(K, L)> for SegtreeOfSegtrees<K, L, O>"],["impl<K: Ord, O: Op> Index<K> for SparseSegtree<K, O>"],["impl<O: Op> Index<usize> for Segtree<O>"],["impl<O: Op> Index<usize> for Dense2dSegtree<O>"],["impl<K: Ord, L: Ord, O: Op> Index<K> for SegtreeOfSegtrees<K, L, O>"]], +"segtree":[["impl<O: Op> Index<usize> for Segtree<O>"],["impl<K: Ord, L: Ord, O: Op> Index<(K, L)> for SegtreeOfSegtrees<K, L, O>"],["impl<K: Ord, L: Ord, O: Op> Index<K> for SegtreeOfSegtrees<K, L, O>"],["impl<O: Op> Index<usize> for Dense2dSegtree<O>"],["impl<K: Ord, O: Op> Index<K> for SparseSegtree<K, O>"]], "sparse_table":[["impl<I, T> Index<I> for SparseTableArgmin<T>where\n I: SliceIndex<[T]>,\n T: Clone,"]], "splay_tree":[["impl<O: LazyOps> Index<usize> for SplayTree<O>"]], "veb":[["impl<V> Index<usize> for VebMap<V>"]] diff --git a/search-index.js b/search-index.js index fcaec5f6..636a5275 100644 --- a/search-index.js +++ b/search-index.js @@ -63,7 +63,7 @@ var searchIndex = JSON.parse('{\ "scc":{"doc":"このライブラリを使える問題","t":"DLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Scc","add_edge","borrow","borrow_mut","build","clone","clone_into","cmp_count","cmp_of","cmp_ofs","default","eq","fmt","from","g","hash","into","is_empty","len","new","ord","quotient_graph","quotient_set","rg","to_owned","try_from","try_into","type_id"],"q":[[0,"scc"]],"d":["本体です。","【Require: 未ビルド】 辺 (from, to) …","","","【Require: 未ビルド】 ビルドします。","","","【Require: ビルド済み】 …","【Require: ビルド済み】 頂点 x …","【Require: ビルド済み】 …","","","","Returns the argument unchanged.","正向きのグラフの隣接リストを返します。","","Calls U::from(self).","管理しているグラフが空グラフならば、true …","管理しているグラフの頂点数を返します。","頂点数 n …","【Require: ビルド済み】 …","【Require: ビルド済み】 …","【Require: ビルド済み】 …","逆向きのグラフの隣接リストを返します。","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],"f":[0,[[1,2,2]],[[]],[[]],[1],[1,1],[[]],[1,2],[[1,2],2],[1],[[],1],[[1,1],3],[[1,4],5],[[]],[1],[[1,6]],[[]],[1,3],[1,2],[2,1],[1],[1,[[7,[[7,[2]]]]]],[1,[[7,[[7,[2]]]]]],[1],[[]],[[],8],[[],8],[[],9]],"c":[],"p":[[3,"Scc"],[15,"usize"],[15,"bool"],[3,"Formatter"],[6,"Result"],[8,"Hasher"],[3,"Vec"],[4,"Result"],[3,"TypeId"]]},\ "segbeats":{"doc":"","t":"IDLLLLLLLLLLKKKLLLLLLLLK","n":["Elm","Segbeats","borrow","borrow_mut","change_max","change_min","clone","clone_into","eq","fmt","from","into","max_value","min_value","mul_u32","new","query_max","query_min","query_sum","to_owned","try_from","try_into","type_id","zero"],"q":[[0,"segbeats"]],"d":["","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","",""],"i":[0,0,2,2,2,2,2,2,2,2,2,2,1,1,1,2,2,2,2,2,2,2,2,1],"f":[0,0,[[]],[[]],[[[2,[1]],[0,[3,[5,[4]]]],1]],[[[2,[1]],[0,[3,[5,[4]]]],1]],[[[2,[3]]],[[2,[3]]]],[[]],[[[2,[6]],[2,[6]]],7],[[[2,[8]],9],10],[[]],[[]],[[]],[[]],[11],[[],[[2,[1]]]],[[[2,[1]],[5,[4]]],1],[[[2,[1]],[5,[4]]],1],[[[2,[1]],[5,[4]]],1],[[]],[[],12],[[],12],[[],13],[[]]],"c":[],"p":[[8,"Elm"],[3,"Segbeats"],[8,"Clone"],[15,"usize"],[8,"RangeBounds"],[8,"PartialEq"],[15,"bool"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[15,"u32"],[4,"Result"],[3,"TypeId"]]},\ "segbeats_task3":{"doc":"","t":"IDLLLLLLLLLLLKKKLLLLLLLLLK","n":["Elm","Segbeats","borrow","borrow_mut","change_max","change_min","clone","clone_into","count_changes","eq","fmt","from","into","max_value","min_value","mul_u32","new","query_max","query_min","query_sum","range_add","to_owned","try_from","try_into","type_id","zero"],"q":[[0,"segbeats_task3"]],"d":["","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","","","","","","",""],"i":[0,0,2,2,2,2,2,2,2,2,2,2,2,1,1,1,2,2,2,2,2,2,2,2,2,1],"f":[0,0,[[]],[[]],[[[2,[1]],[0,[3,[5,[4]]]],1]],[[[2,[1]],[0,[3,[5,[4]]]],1]],[[[2,[3]]],[[2,[3]]]],[[]],[[[2,[1]],[5,[4]]],6],[[[2,[7]],[2,[7]]],8],[[[2,[1]],9],10],[[]],[[]],[[]],[[]],[11],[[],[[2,[1]]]],[[[2,[1]],[5,[4]]],1],[[[2,[1]],[5,[4]]],1],[[[2,[1]],[5,[4]]],1],[[[2,[1]],[0,[3,[5,[4]]]],1]],[[]],[[],12],[[],12],[[],13],[[]]],"c":[],"p":[[8,"Elm"],[3,"Segbeats"],[8,"Clone"],[15,"usize"],[8,"RangeBounds"],[15,"u64"],[8,"PartialEq"],[15,"bool"],[3,"Formatter"],[6,"Result"],[15,"u32"],[4,"Result"],[3,"TypeId"]]},\ -"segtree":{"doc":"","t":"DDDIDDDQLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLL","n":["Dense2dEntry","Dense2dSegtree","Entry","Op","Segtree","SegtreeOfSegtrees","SparseSegtree","Value","apply","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","deref","deref","deref_mut","deref_mut","drop","drop","entry","entry","entry","fold","fold","fold","fold","from","from","from","from","from","from","from_iter","from_iter","from_iter","from_len","identity","index","index","index","index","index","into","into","into","into","into","into","new","new","new","new","op","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id"],"q":[[0,"segtree"]],"d":["","","","","","","","The value type.","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the identity value.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","Multiplies two values.","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,3,4,6,6,7,10,4,11,8,6,7,10,4,11,8,7,8,7,8,7,8,6,10,11,6,10,4,11,6,7,10,4,11,8,6,10,4,6,3,6,10,4,4,11,6,7,10,4,11,8,6,10,4,11,3,6,7,10,4,11,8,6,7,10,4,11,8,6,7,10,4,11,8],"f":[0,0,0,0,0,0,0,0,[[[4,[[0,[1,2]],[0,[1,2]],3]],[0,[1,2]],[0,[1,2]],5]],[[[6,[3]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[7,[3]]]],[[[8,[3]]]],[[[7,[3]]]],[[[8,[3]]]],[[[7,[3]]]],[[[8,[3]]]],[[[6,[3]],9],[[7,[3]]]],[[[10,[1,3]],1],[[7,[3]]]],[[[11,[3]],9,9],[[8,[3]]]],[[[6,[3]],[12,[9]]]],[[[10,[1,3]],[12,[1]]]],[[[4,[[0,[1,2]],[0,[1,2]],3]],[12,[[0,[1,2]]]],[0,[[12,[[0,[1,2]]]],2]]]],[[[11,[3]],[12,[9]],[12,[9]]]],[[]],[[]],[[]],[[]],[[]],[[]],[13,[[6,[3]]]],[13,[[10,[[0,[2,1]],3]]]],[13,[[4,[[0,[1,2]],[0,[1,2]],3]]]],[9,[[6,[3]]]],[[]],[[[6,[3]],9]],[[[10,[1,3]],1]],[[[4,[1,1,3]],1]],[[[4,[1,1,3]]]],[[[11,[3]],9]],[[]],[[]],[[]],[[]],[[]],[[]],[[],[[6,[3]]]],[[],[[10,[2,1,3]]]],[[],[[4,[[0,[1,2]],[0,[1,2]],3]]]],[[],[[11,[3]]]],[[]],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],14],[[],15],[[],15],[[],15],[[],15],[[],15],[[],15]],"c":[],"p":[[8,"Ord"],[8,"Clone"],[8,"Op"],[3,"SegtreeOfSegtrees"],[8,"FnMut"],[3,"Segtree"],[3,"Entry"],[3,"Dense2dEntry"],[15,"usize"],[3,"SparseSegtree"],[3,"Dense2dSegtree"],[8,"RangeBounds"],[8,"IntoIterator"],[4,"Result"],[3,"TypeId"]]},\ +"segtree":{"doc":"","t":"DDDIDDDQLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLL","n":["Dense2dEntry","Dense2dSegtree","Entry","Op","Segtree","SegtreeOfSegtrees","SparseSegtree","Value","apply","as_slice","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","collect_map","collect_map","collect_vec","deref","deref","deref_mut","deref_mut","drop","drop","entry","entry","entry","fmt","fmt","fmt","fmt","fmt","fold","fold","fold","fold","from","from","from","from","from","from","from_iter","from_iter","from_iter","from_len","identity","index","index","index","index","index","into","into","into","into","into","into","iter","iter","iter","iter","new","new","new","new","op","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id"],"q":[[0,"segtree"]],"d":["","","","","","","","The value type.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the identity value.","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","Multiplies two values.","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,0,0,3,4,6,6,11,7,4,9,12,6,11,7,4,9,12,7,4,9,11,12,11,12,11,12,6,7,9,6,11,7,4,9,6,7,4,9,6,11,7,4,9,12,6,7,4,6,3,6,7,4,4,9,6,11,7,4,9,12,6,7,4,9,6,7,4,9,3,6,11,7,4,9,12,6,11,7,4,9,12,6,11,7,4,9,12],"f":[0,0,0,0,0,0,0,0,[[[4,[[0,[1,2]],[0,[1,2]],3]],[0,[1,2]],[0,[1,2]],5]],[[[6,[3]]]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[[7,[2,1,3]]],[[8,[2,1]]]],[[[4,[2,[0,[1,2]],2,[0,[1,2]],3]]],8],[[[9,[3]]],[[10,[10]]]],[[[11,[3]]]],[[[12,[3]]]],[[[11,[3]]]],[[[12,[3]]]],[[[11,[3]]]],[[[12,[3]]]],[[[6,[3]],13],[[11,[3]]]],[[[7,[1,3]],1],[[11,[3]]]],[[[9,[3]],13,13],[[12,[3]]]],[[[6,[3]],14],15],[[[11,[3]],14],15],[[[7,[16,3]],14],15],[[[4,[16,16,3]],14],15],[[[9,[3]],14],15],[[[6,[3]],[17,[13]]]],[[[7,[1,3]],[17,[1]]]],[[[4,[[0,[1,2]],[0,[1,2]],3]],[17,[[0,[1,2]]]],[0,[[17,[[0,[1,2]]]],2]]]],[[[9,[3]],[17,[13]],[17,[13]]]],[[]],[[]],[[]],[[]],[[]],[[]],[18,[[6,[3]]]],[18,[[7,[[0,[2,1]],3]]]],[18,[[4,[[0,[1,2]],[0,[1,2]],3]]]],[13,[[6,[3]]]],[[]],[[[6,[3]],13]],[[[7,[1,3]],1]],[[[4,[1,1,3]],1]],[[[4,[1,1,3]]]],[[[9,[3]],13]],[[]],[[]],[[]],[[]],[[]],[[]],[[[6,[3]]],19],[[[7,[1,3]]],19],[[[4,[[0,[1,2]],[0,[1,2]],3]]],19],[[[9,[3]]],19],[[],[[6,[3]]]],[[],[[7,[2,1,3]]]],[[],[[4,[[0,[1,2]],[0,[1,2]],3]]]],[[],[[9,[3]]]],[[]],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],21],[[],21],[[],21],[[],21],[[],21],[[],21]],"c":[],"p":[[8,"Ord"],[8,"Clone"],[8,"Op"],[3,"SegtreeOfSegtrees"],[8,"FnMut"],[3,"Segtree"],[3,"SparseSegtree"],[3,"BTreeMap"],[3,"Dense2dSegtree"],[3,"Vec"],[3,"Entry"],[3,"Dense2dEntry"],[15,"usize"],[3,"Formatter"],[6,"Result"],[8,"Debug"],[8,"RangeBounds"],[8,"IntoIterator"],[8,"Iterator"],[4,"Result"],[3,"TypeId"]]},\ "skew_heap":{"doc":"Meld のできるヒープ","t":"DLLLLLLLLLLLLLLLFLLLLLLLLLL","n":["SkewHeap","borrow","borrow_mut","clear","clone","clone_into","default","eq","extend","extend","fmt","from","from_iter","hash","into","into_sorted_vec","meld","meld","new","peek","pop","push","singleton","to_owned","try_from","try_into","type_id"],"q":[[0,"skew_heap"]],"d":["Meld のできるヒープ","","","中身を殻にします。","","","","","","","","Returns the argument unchanged.","","","Calls U::from(self).","ソート済みの Vec に変換します。","2 つの SkewHeap …","2 つの SkewHeap …","新しく構築します。","…","…","要素を一つ、追加します。","要素一つからなる SkewHeap を構築します。","","","",""],"i":[0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,2,2,2,2,2,2,2,2,2,2],"f":[0,[[]],[[]],[[[2,[1]]]],[[[2,[3]]],[[2,[3]]]],[[]],[[],[[2,[1]]]],[[[2,[4]],[2,[4]]],5],[[[2,[[0,[6,1]]]],7]],[[[2,[1]],7]],[[[2,[[0,[8,1]]]],9],10],[[]],[7,[[2,[1]]]],[[[2,[11]],12]],[[]],[[[2,[1]]],[[13,[1]]]],[[[2,[1]],[2,[1]]],[[2,[1]]]],[[[2,[1]],[2,[1]]]],[[],[[2,[1]]]],[[[2,[1]]],[[14,[1]]]],[[[2,[1]]],[[14,[1]]]],[[[2,[1]],1]],[1,[[2,[1]]]],[[]],[[],15],[[],15],[[],16]],"c":[],"p":[[8,"Ord"],[3,"SkewHeap"],[8,"Clone"],[8,"PartialEq"],[15,"bool"],[8,"Copy"],[8,"IntoIterator"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[8,"Hash"],[8,"Hasher"],[3,"Vec"],[4,"Option"],[4,"Result"],[3,"TypeId"]]},\ "slicemore":{"doc":"{lower,upper}_bound and partition_point","t":"IFKFKFKFKFKFKFK","n":["SliceMore","lower_bound","lower_bound","lower_bound_by","lower_bound_by","lower_bound_by_key","lower_bound_by_key","partition_point","partition_point","upper_bound","upper_bound","upper_bound_by","upper_bound_by","upper_bound_by_key","upper_bound_by_key"],"q":[[0,"slicemore"]],"d":["Method versions of functions.","Find $i$ s.t. $a _ { i - 1 } \\\\lt b \\\\le a _ i$.","","Find $i$ s.t. $f ( a _ { i - 1 } ) \\\\in \\\\left \\\\lbrace …","","Find $i$ s.t. $f ( a _ { i - 1 } ) \\\\lt b \\\\le f ( a _ i )$.","","Find $i$ s.t. $f ( a _ { i - 1 } ) \\\\land \\\\neg f ( a _ i )$.","","Find $i$ s.t. $a _ { i - 1 } \\\\le b \\\\lt a _ i$.","","Find $i$ s.t. $f ( a _ { i - 1 } ) \\\\in \\\\left \\\\lbrace …","","Find $i$ s.t. $f ( a _ { i - 1 } ) \\\\le b \\\\lt f ( a _ i )$.",""],"i":[0,0,4,0,4,0,4,0,4,0,4,0,4,0,4],"f":[0,[1,2],[1,2],[3,2],[3,2],[[1,3],2],[[1,3],2],[3,2],[3,2],[1,2],[1,2],[3,2],[3,2],[[1,3],2],[[1,3],2]],"c":[],"p":[[8,"Ord"],[15,"usize"],[8,"FnMut"],[8,"SliceMore"]]},\ "snippetter":{"doc":"","t":"HDHLLLLMLFLLLFFLMLLLL","n":["CRATE_METADATAS","CrateMetadata","PROJECT_ROOT","borrow","borrow_mut","clone","clone_into","dependencies","eq","find_project_root_path","fmt","from","into","main","parse_local_dependencies_from_cargo_toml","serialize","tags","to_owned","try_from","try_into","type_id"],"q":[[0,"snippetter"]],"d":["","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","",""],"i":[0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,1,1,1,1,1,1],"f":[0,0,0,[[]],[[]],[1,1],[[]],0,[[1,1],2],[[],3],[[1,4],5],[[]],[[]],[[]],[6,[[8,[7]]]],[[1,9],10],0,[[]],[[],10],[[],10],[[],11]],"c":[],"p":[[3,"CrateMetadata"],[15,"bool"],[3,"PathBuf"],[3,"Formatter"],[6,"Result"],[15,"str"],[3,"String"],[3,"Vec"],[8,"Serializer"],[4,"Result"],[3,"TypeId"]]},\ diff --git a/segtree/index.html b/segtree/index.html index 2b5b1e2e..0688b419 100644 --- a/segtree/index.html +++ b/segtree/index.html @@ -32,4 +32,4 @@ }); -
\ No newline at end of file +
\ No newline at end of file diff --git a/segtree/struct.Dense2dEntry.html b/segtree/struct.Dense2dEntry.html index 8012ed4f..b60419ec 100644 --- a/segtree/struct.Dense2dEntry.html +++ b/segtree/struct.Dense2dEntry.html @@ -32,7 +32,7 @@ }); -

Struct segtree::Dense2dEntry

source ·
pub struct Dense2dEntry<'a, O: Op> { /* private fields */ }

Trait Implementations§

source§

impl<'a, O: Op> Deref for Dense2dEntry<'a, O>

§

type Target = <O as Op>::Value

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, O: Op> DerefMut for Dense2dEntry<'a, O>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, O: Op> Drop for Dense2dEntry<'a, O>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, O> RefUnwindSafe for Dense2dEntry<'a, O>where +

Struct segtree::Dense2dEntry

source ·
pub struct Dense2dEntry<'a, O: Op> { /* private fields */ }

Trait Implementations§

source§

impl<'a, O: Op> Deref for Dense2dEntry<'a, O>

§

type Target = <O as Op>::Value

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, O: Op> DerefMut for Dense2dEntry<'a, O>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, O: Op> Drop for Dense2dEntry<'a, O>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, O> RefUnwindSafe for Dense2dEntry<'a, O>where <O as Op>::Value: RefUnwindSafe,

§

impl<'a, O> Send for Dense2dEntry<'a, O>where <O as Op>::Value: Send,

§

impl<'a, O> Sync for Dense2dEntry<'a, O>where <O as Op>::Value: Sync,

§

impl<'a, O> Unpin for Dense2dEntry<'a, O>

§

impl<'a, O> !UnwindSafe for Dense2dEntry<'a, O>

Blanket Implementations§

source§

impl<T> Any for Twhere diff --git a/segtree/struct.Dense2dSegtree.html b/segtree/struct.Dense2dSegtree.html index c51e9e2c..201ffa00 100644 --- a/segtree/struct.Dense2dSegtree.html +++ b/segtree/struct.Dense2dSegtree.html @@ -32,12 +32,14 @@ }); -

Struct segtree::Dense2dSegtree

source ·
pub struct Dense2dSegtree<O: Op> { /* private fields */ }

Implementations§

source§

impl<O: Op> Dense2dSegtree<O>

source

pub fn new(values: &[Vec<O::Value>]) -> Selfwhere - O::Value: Clone,

source

pub fn fold( +

Struct segtree::Dense2dSegtree

source ·
pub struct Dense2dSegtree<O: Op> { /* private fields */ }

Implementations§

source§

impl<O: Op> Dense2dSegtree<O>

source

pub fn new(values: &[Vec<O::Value>]) -> Selfwhere + O::Value: Clone,

source

pub fn fold( &self, i: impl RangeBounds<usize>, j: impl RangeBounds<usize> -) -> O::Value

source

pub fn entry(&mut self, i: usize, j: usize) -> Dense2dEntry<'_, O>

Trait Implementations§

source§

impl<O: Op> Index<usize> for Dense2dSegtree<O>

§

type Output = [<O as Op>::Value]

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for Dense2dSegtree<O>where +) -> O::Value

source

pub fn entry(&mut self, i: usize, j: usize) -> Dense2dEntry<'_, O>

source

pub fn iter(&self) -> impl Iterator<Item = &[O::Value]>

source

pub fn collect_vec(&self) -> Vec<Vec<O::Value>>where + O::Value: Clone,

Trait Implementations§

source§

impl<O: Op> Debug for Dense2dSegtree<O>where + O::Value: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<O: Op> Index<usize> for Dense2dSegtree<O>

§

type Output = [<O as Op>::Value]

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for Dense2dSegtree<O>where <O as Op>::Value: RefUnwindSafe,

§

impl<O> Send for Dense2dSegtree<O>where <O as Op>::Value: Send,

§

impl<O> Sync for Dense2dSegtree<O>where <O as Op>::Value: Sync,

§

impl<O> Unpin for Dense2dSegtree<O>where diff --git a/segtree/struct.Entry.html b/segtree/struct.Entry.html index 79f594d9..ee3d935d 100644 --- a/segtree/struct.Entry.html +++ b/segtree/struct.Entry.html @@ -32,7 +32,8 @@ }); -

Struct segtree::Entry

source ·
pub struct Entry<'a, O: Op> { /* private fields */ }

Trait Implementations§

source§

impl<'a, O: Op> Deref for Entry<'a, O>

§

type Target = <O as Op>::Value

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, O: Op> DerefMut for Entry<'a, O>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, O: Op> Drop for Entry<'a, O>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, O> RefUnwindSafe for Entry<'a, O>where +

Struct segtree::Entry

source ·
pub struct Entry<'a, O: Op> { /* private fields */ }

Trait Implementations§

source§

impl<'a, O: Op> Debug for Entry<'a, O>where + O::Value: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, O: Op> Deref for Entry<'a, O>

§

type Target = <O as Op>::Value

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a, O: Op> DerefMut for Entry<'a, O>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<'a, O: Op> Drop for Entry<'a, O>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<'a, O> RefUnwindSafe for Entry<'a, O>where <O as Op>::Value: RefUnwindSafe,

§

impl<'a, O> Send for Entry<'a, O>where <O as Op>::Value: Send,

§

impl<'a, O> Sync for Entry<'a, O>where <O as Op>::Value: Sync,

§

impl<'a, O> Unpin for Entry<'a, O>

§

impl<'a, O> !UnwindSafe for Entry<'a, O>

Blanket Implementations§

source§

impl<T> Any for Twhere diff --git a/segtree/struct.Segtree.html b/segtree/struct.Segtree.html index 23fd85b7..a760ea42 100644 --- a/segtree/struct.Segtree.html +++ b/segtree/struct.Segtree.html @@ -32,10 +32,11 @@ }); -

Struct segtree::Segtree

source ·
pub struct Segtree<O: Op> { /* private fields */ }

Implementations§

source§

impl<O: Op> Segtree<O>

source

pub fn from_len(n: usize) -> Selfwhere - O::Value: Clone,

source

pub fn new(values: &[O::Value]) -> Selfwhere - O::Value: Clone,

source

pub fn fold<R: RangeBounds<usize>>(&self, range: R) -> O::Value

source

pub fn entry(&mut self, index: usize) -> Entry<'_, O>

source

pub fn as_slice(&self) -> &[O::Value]

Trait Implementations§

source§

impl<O: Op> FromIterator<<O as Op>::Value> for Segtree<O>where - O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = O::Value>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<O: Op> Index<usize> for Segtree<O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for Segtree<O>where +

Struct segtree::Segtree

source ·
pub struct Segtree<O: Op> { /* private fields */ }

Implementations§

source§

impl<O: Op> Segtree<O>

source

pub fn from_len(n: usize) -> Selfwhere + O::Value: Clone,

source

pub fn new(values: &[O::Value]) -> Selfwhere + O::Value: Clone,

source

pub fn fold<R: RangeBounds<usize>>(&self, range: R) -> O::Value

source

pub fn entry(&mut self, index: usize) -> Entry<'_, O>

source

pub fn iter(&self) -> impl Iterator<Item = &O::Value>

source

pub fn as_slice(&self) -> &[O::Value]

Trait Implementations§

source§

impl<O: Op> Debug for Segtree<O>where + O::Value: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<O: Op> FromIterator<<O as Op>::Value> for Segtree<O>where + O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = O::Value>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<O: Op> Index<usize> for Segtree<O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<O> RefUnwindSafe for Segtree<O>where <O as Op>::Value: RefUnwindSafe,

§

impl<O> Send for Segtree<O>where <O as Op>::Value: Send,

§

impl<O> Sync for Segtree<O>where <O as Op>::Value: Sync,

§

impl<O> Unpin for Segtree<O>where diff --git a/segtree/struct.SegtreeOfSegtrees.html b/segtree/struct.SegtreeOfSegtrees.html index 7b031669..39aea95c 100644 --- a/segtree/struct.SegtreeOfSegtrees.html +++ b/segtree/struct.SegtreeOfSegtrees.html @@ -32,17 +32,23 @@ }); -
pub struct SegtreeOfSegtrees<K, L, O: Op> { /* private fields */ }

Implementations§

source§

impl<K, L, O: Op> SegtreeOfSegtrees<K, L, O>where +
pub struct SegtreeOfSegtrees<K, L, O: Op> { /* private fields */ }

Implementations§

source§

impl<K, L, O: Op> SegtreeOfSegtrees<K, L, O>where K: Ord + Clone, L: Ord + Clone, - O::Value: Clone,

source

pub fn new(points: &[(K, L, O::Value)]) -> Self

source

pub fn fold( + O::Value: Clone,

source

pub fn new(points: &[(K, L, O::Value)]) -> Self

source

pub fn fold( &self, i: impl RangeBounds<K>, j: impl RangeBounds<L> + Clone -) -> O::Value

source

pub fn apply(&mut self, k: K, l: L, f: impl FnMut(&mut O::Value))

Trait Implementations§

source§

impl<K, L, O: Op> FromIterator<(K, L, <O as Op>::Value)> for SegtreeOfSegtrees<K, L, O>where +) -> O::Value

source

pub fn apply(&mut self, k: &K, l: &L, f: impl FnMut(&mut O::Value))

source

pub fn iter(&self) -> impl Iterator<Item = (&K, &L, &O::Value)>

source

pub fn collect_map(&self) -> BTreeMap<(K, L), O::Value>where + K: Clone, + L: Clone, + O::Value: Clone,

Trait Implementations§

source§

impl<K, L, O: Op> Debug for SegtreeOfSegtrees<K, L, O>where + K: Debug, + L: Debug, + O::Value: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, L, O: Op> FromIterator<(K, L, <O as Op>::Value)> for SegtreeOfSegtrees<K, L, O>where K: Ord + Clone, L: Ord + Clone, - O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = (K, L, O::Value)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<K: Ord, L: Ord, O: Op> Index<(K, L)> for SegtreeOfSegtrees<K, L, O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, (i, j): (K, L)) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<K: Ord, L: Ord, O: Op> Index<K> for SegtreeOfSegtrees<K, L, O>

§

type Output = SparseSegtree<L, O>

The returned type after indexing.
source§

fn index(&self, i: K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<K, L, O> RefUnwindSafe for SegtreeOfSegtrees<K, L, O>where + O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = (K, L, O::Value)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<K: Ord, L: Ord, O: Op> Index<(K, L)> for SegtreeOfSegtrees<K, L, O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, (i, j): (K, L)) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<K: Ord, L: Ord, O: Op> Index<K> for SegtreeOfSegtrees<K, L, O>

§

type Output = SparseSegtree<L, O>

The returned type after indexing.
source§

fn index(&self, i: K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<K, L, O> RefUnwindSafe for SegtreeOfSegtrees<K, L, O>where K: RefUnwindSafe, L: RefUnwindSafe, <O as Op>::Value: RefUnwindSafe,

§

impl<K, L, O> Send for SegtreeOfSegtrees<K, L, O>where diff --git a/segtree/struct.SparseSegtree.html b/segtree/struct.SparseSegtree.html index 1ad3db4e..ac4e4e09 100644 --- a/segtree/struct.SparseSegtree.html +++ b/segtree/struct.SparseSegtree.html @@ -32,11 +32,15 @@ }); -

Struct segtree::SparseSegtree

source ·
pub struct SparseSegtree<K, O: Op> { /* private fields */ }

Implementations§

source§

impl<K: Ord, O: Op> SparseSegtree<K, O>

source

pub fn new(kv: &[(K, O::Value)]) -> Selfwhere +

Struct segtree::SparseSegtree

source ·
pub struct SparseSegtree<K, O: Op> { /* private fields */ }

Implementations§

source§

impl<K: Ord, O: Op> SparseSegtree<K, O>

source

pub fn new(kv: &[(K, O::Value)]) -> Selfwhere K: Clone, - O::Value: Clone,

source

pub fn fold<R: RangeBounds<K>>(&self, range: R) -> O::Value

source

pub fn entry(&mut self, key: K) -> Entry<'_, O>

Trait Implementations§

source§

impl<K, O: Op> FromIterator<(K, <O as Op>::Value)> for SparseSegtree<K, O>where + O::Value: Clone,

source

pub fn fold<R: RangeBounds<K>>(&self, range: R) -> O::Value

source

pub fn entry(&mut self, key: &K) -> Entry<'_, O>

source

pub fn iter(&self) -> impl Iterator<Item = (&K, &O::Value)>

source

pub fn collect_map(&self) -> BTreeMap<K, O::Value>where + K: Clone, + O::Value: Clone,

Trait Implementations§

source§

impl<K, O: Op> Debug for SparseSegtree<K, O>where + K: Debug, + O::Value: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<K, O: Op> FromIterator<(K, <O as Op>::Value)> for SparseSegtree<K, O>where K: Clone + Ord, - O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = (K, O::Value)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<K: Ord, O: Op> Index<K> for SparseSegtree<K, O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, key: K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<K, O> RefUnwindSafe for SparseSegtree<K, O>where + O::Value: Clone,

source§

fn from_iter<I: IntoIterator<Item = (K, O::Value)>>(iter: I) -> Self

Creates a value from an iterator. Read more
source§

impl<K: Ord, O: Op> Index<K> for SparseSegtree<K, O>

§

type Output = <O as Op>::Value

The returned type after indexing.
source§

fn index(&self, key: K) -> &Self::Output

Performs the indexing (container[index]) operation. Read more

Auto Trait Implementations§

§

impl<K, O> RefUnwindSafe for SparseSegtree<K, O>where K: RefUnwindSafe, <O as Op>::Value: RefUnwindSafe,

§

impl<K, O> Send for SparseSegtree<K, O>where K: Send, diff --git a/segtree/trait.Op.html b/segtree/trait.Op.html index d0bec81d..9a095091 100644 --- a/segtree/trait.Op.html +++ b/segtree/trait.Op.html @@ -32,13 +32,13 @@ }); -

Trait segtree::Op

source ·
pub trait Op {
+

Trait segtree::Op

source ·
pub trait Op {
     type Value;
 
     // Required methods
     fn identity() -> Self::Value;
     fn op(lhs: &Self::Value, rhs: &Self::Value) -> Self::Value;
-}

Required Associated Types§

source

type Value

The value type.

-

Required Methods§

source

fn identity() -> Self::Value

Returns the identity value.

-
source

fn op(lhs: &Self::Value, rhs: &Self::Value) -> Self::Value

Multiplies two values.

+}

Required Associated Types§

source

type Value

The value type.

+

Required Methods§

source

fn identity() -> Self::Value

Returns the identity value.

+
source

fn op(lhs: &Self::Value, rhs: &Self::Value) -> Self::Value

Multiplies two values.

Implementors§

\ No newline at end of file diff --git a/settings.html b/settings.html index 651968be..234ca2b9 100644 --- a/settings.html +++ b/settings.html @@ -1,4 +1,4 @@ -Rustdoc settings
Rustdoc settings
-

Rustdoc settings

Back
\ No newline at end of file +

Rustdoc settings

Back
\ No newline at end of file diff --git a/src/segtree/lib.rs.html b/src/segtree/lib.rs.html index 8e3072bf..b50b86c0 100644 --- a/src/segtree/lib.rs.html +++ b/src/segtree/lib.rs.html @@ -739,7 +739,137 @@ 705 706 707 -

use std::iter::FromIterator;
+708
+709
+710
+711
+712
+713
+714
+715
+716
+717
+718
+719
+720
+721
+722
+723
+724
+725
+726
+727
+728
+729
+730
+731
+732
+733
+734
+735
+736
+737
+738
+739
+740
+741
+742
+743
+744
+745
+746
+747
+748
+749
+750
+751
+752
+753
+754
+755
+756
+757
+758
+759
+760
+761
+762
+763
+764
+765
+766
+767
+768
+769
+770
+771
+772
+773
+774
+775
+776
+777
+778
+779
+780
+781
+782
+783
+784
+785
+786
+787
+788
+789
+790
+791
+792
+793
+794
+795
+796
+797
+798
+799
+800
+801
+802
+803
+804
+805
+806
+807
+808
+809
+810
+811
+812
+813
+814
+815
+816
+817
+818
+819
+820
+821
+822
+823
+824
+825
+826
+827
+828
+829
+830
+831
+832
+833
+834
+835
+
use core::fmt;
+use std::collections::BTreeMap;
+use std::iter::FromIterator;
 use std::ops::Deref;
 use std::ops::DerefMut;
 use std::ops::Index;
@@ -783,6 +913,7 @@
     pub fn fold<R: RangeBounds<usize>>(&self, range: R) -> O::Value {
         let n = self.values.len() / 2;
         let (mut start, mut end) = open(range, n);
+        assert!(start <= end && end <= n);
         start += n;
         end += n;
         let mut left = O::identity();
@@ -810,11 +941,26 @@
         }
     }
 
+    pub fn iter(&self) -> impl Iterator<Item = &O::Value> {
+        self.values[self.values.len() / 2..].iter()
+    }
+
     pub fn as_slice(&self) -> &[O::Value] {
         &self.values[self.values.len() / 2..]
     }
 }
 
+impl<O: Op> fmt::Debug for Segtree<O>
+where
+    O::Value: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("Segtree")
+            .field("values", &self.values)
+            .finish()
+    }
+}
+
 impl<O: Op> FromIterator<O::Value> for Segtree<O>
 where
     O::Value: Clone,
@@ -860,6 +1006,14 @@
         &mut self.segtree.values[self.index]
     }
 }
+impl<'a, O: Op> fmt::Debug for Entry<'a, O>
+where
+    O::Value: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("Entry").field("index", &self.index).finish()
+    }
+}
 
 pub struct SparseSegtree<K, O: Op> {
     inner: Segtree<O>,
@@ -876,7 +1030,7 @@
         let values = kv.iter().map(|(_, v)| v.clone()).collect::<Vec<_>>();
         Self {
             inner: Segtree::new(&values),
-            keys: keys.to_vec(),
+            keys,
         }
     }
 
@@ -885,13 +1039,42 @@
         self.inner.fold(start..end)
     }
 
-    pub fn entry(&mut self, key: K) -> Entry<'_, O> {
-        let index = self.keys.binary_search(&key).unwrap() + self.keys.len();
+    pub fn entry(&mut self, key: &K) -> Entry<'_, O> {
+        let index = self.keys.binary_search(key).unwrap() + self.keys.len();
         Entry {
             segtree: &mut self.inner,
             index,
         }
     }
+
+    pub fn iter(&self) -> impl Iterator<Item = (&K, &O::Value)> {
+        self.keys.iter().zip(self.inner.as_slice())
+    }
+
+    pub fn collect_map(&self) -> BTreeMap<K, O::Value>
+    where
+        K: Clone,
+        O::Value: Clone,
+    {
+        self.keys
+            .iter()
+            .cloned()
+            .zip(self.inner.iter().cloned())
+            .collect()
+    }
+}
+
+impl<K, O: Op> fmt::Debug for SparseSegtree<K, O>
+where
+    K: fmt::Debug,
+    O::Value: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("SparseSegtree")
+            .field("inner", &self.inner)
+            .field("keys", &self.keys)
+            .finish()
+    }
 }
 
 impl<K: Ord, O: Op> FromIterator<(K, O::Value)> for SparseSegtree<K, O>
@@ -976,14 +1159,51 @@
         O::op(&left, &right)
     }
 
-    pub fn apply(&mut self, k: K, l: L, mut f: impl FnMut(&mut O::Value)) {
-        let mut i = self.keys.binary_search(&k).unwrap();
+    pub fn apply(&mut self, k: &K, l: &L, mut f: impl FnMut(&mut O::Value)) {
+        let mut i = self.keys.binary_search(k).unwrap();
         i += self.keys.len();
         while i != 0 {
-            f(&mut self.segtrees[i].entry(l.clone()));
+            f(&mut self.segtrees[i].entry(l));
             i /= 2;
         }
     }
+
+    pub fn iter(&self) -> impl Iterator<Item = (&K, &L, &O::Value)> {
+        self.keys
+            .iter()
+            .zip(self.segtrees[self.keys.len()..].iter())
+            .flat_map(|(k, segtree)| segtree.iter().map(move |(l, v)| (k, l, v)))
+    }
+
+    pub fn collect_map(&self) -> BTreeMap<(K, L), O::Value>
+    where
+        K: Clone,
+        L: Clone,
+        O::Value: Clone,
+    {
+        self.keys
+            .iter()
+            .flat_map(|k| {
+                self.segtrees[self.keys.len() + self.keys.binary_search(k).unwrap()]
+                    .iter()
+                    .map(move |(l, v)| ((k.clone(), l.clone()), v.clone()))
+            })
+            .collect()
+    }
+}
+
+impl<K, L, O: Op> fmt::Debug for SegtreeOfSegtrees<K, L, O>
+where
+    K: fmt::Debug,
+    L: fmt::Debug,
+    O::Value: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("SegtreeOfSegtrees")
+            .field("segtrees", &self.segtrees)
+            .field("keys", &self.keys)
+            .finish()
+    }
 }
 
 impl<K, L, O: Op> FromIterator<(K, L, O::Value)> for SegtreeOfSegtrees<K, L, O>
@@ -1023,7 +1243,7 @@
     {
         let values_ = values;
         let h = values.len();
-        let w = values.get(0).map_or(0, |v| v.len());
+        let w = values.get(0).map_or(0, Vec::len);
         let mut values = vec![vec![O::identity(); 2 * w]; 2 * h];
         for (values, values_) in values[h..].iter_mut().zip(values_) {
             values[w..].clone_from_slice(values_);
@@ -1043,7 +1263,9 @@
         let h = self.values.len() / 2;
         let w = self.values.get(0).map_or(0, |v| v.len() / 2);
         let (mut i0, mut i1) = open(i, h);
+        assert!(i0 <= i1 && i1 <= h);
         let (mut j0, mut j1) = open(j, w);
+        assert!(j0 <= j1 && j1 <= w);
         i0 += h;
         i1 += h;
         j0 += w;
@@ -1100,6 +1322,30 @@
             j: w + j,
         }
     }
+
+    pub fn iter(&self) -> impl Iterator<Item = &[O::Value]> {
+        self.values[self.values.len() / 2..]
+            .iter()
+            .map(|v| &v[v.len() / 2..])
+    }
+
+    pub fn collect_vec(&self) -> Vec<Vec<O::Value>>
+    where
+        O::Value: Clone,
+    {
+        self.iter().map(<[_]>::to_vec).collect()
+    }
+}
+
+impl<O: Op> fmt::Debug for Dense2dSegtree<O>
+where
+    O::Value: fmt::Debug,
+{
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
+        f.debug_struct("Dense2dSegtree")
+            .field("values", &self.values)
+            .finish()
+    }
 }
 
 impl<O: Op> Index<usize> for Dense2dSegtree<O> {
@@ -1172,13 +1418,23 @@
     use std::ops::Bound;
     let start = match bounds.start_bound() {
         Bound::Unbounded => 0,
-        Bound::Included(x) => keys.binary_search(x).unwrap_or_else(|i| i),
-        Bound::Excluded(x) => keys.binary_search(x).unwrap_or_else(|i| i + 1),
+        Bound::Included(x) => match keys.binary_search(x) {
+            Ok(i) | Err(i) => i,
+        },
+        Bound::Excluded(x) => match keys.binary_search(x) {
+            Ok(i) => i + 1,
+            Err(i) => i,
+        },
     };
     let end = match bounds.end_bound() {
         Bound::Unbounded => keys.len(),
-        Bound::Included(x) => keys.binary_search(x).map_or_else(|i| i + 1, |i| i + 1),
-        Bound::Excluded(x) => keys.binary_search(x).unwrap_or_else(|i| i),
+        Bound::Included(x) => match keys.binary_search(x) {
+            Ok(i) => i + 1,
+            Err(i) => i,
+        },
+        Bound::Excluded(x) => match keys.binary_search(x) {
+            Ok(i) | Err(i) => i,
+        },
     };
     (start, end)
 }
@@ -1228,7 +1484,8 @@
 
     #[test]
     fn test_segtree() {
-        use rolling_hash::*;
+        use rolling_hash::BASE;
+        use rolling_hash::O;
 
         let mut rng = StdRng::seed_from_u64(42);
         for _ in 0..100 {
@@ -1264,7 +1521,7 @@
 
     #[test]
     fn test_segtree_usability() {
-        use rolling_hash::*;
+        use rolling_hash::O;
         let _ = Segtree::<O>::from_len(1);
         let _ = Segtree::<O>::new(&[(0, 1)]);
         let _ = Segtree::<O>::from_iter(vec![(0, 1)]);
@@ -1277,7 +1534,8 @@
 
     #[test]
     fn test_sparse_segtree() {
-        use rolling_hash::*;
+        use rolling_hash::BASE;
+        use rolling_hash::O;
 
         let mut rng = StdRng::seed_from_u64(42);
         for _ in 0..100 {
@@ -1292,7 +1550,7 @@
                 .copied()
                 .map(|key| (key, (rng.gen_range(0..BASE), BASE)))
                 .collect::<Vec<_>>();
-            let mut segtree = SparseSegtree::<usize, O>::from_iter(vec.iter().copied());
+            let mut segtree = vec.iter().copied().collect::<SparseSegtree<_, O>>();
             for _ in 0..q {
                 match rng.gen_range(0..2) {
                     // fold
@@ -1311,12 +1569,9 @@
                     1 => {
                         let k = rng.gen_range(0..n);
                         let x = (rng.gen_range(0..BASE), BASE);
-                        match keys.binary_search(&k) {
-                            Ok(j) => {
-                                *segtree.entry(k) = x;
-                                vec[j].1 = x;
-                            }
-                            Err(_) => {}
+                        if let Ok(j) = keys.binary_search(&k) {
+                            *segtree.entry(&k) = x;
+                            vec[j].1 = x;
                         }
                     }
                     _ => unreachable!(),
@@ -1327,18 +1582,19 @@
 
     #[test]
     fn test_sparse_segtree_usability() {
-        use rolling_hash::*;
+        use rolling_hash::O;
         let _ = SparseSegtree::<usize, O>::new(&[(0, (1, 1))]);
         let _ = SparseSegtree::<usize, O>::from_iter(vec![(0, (1, 1))]);
         let mut segtree = SparseSegtree::<usize, O>::new(&[(0, (1, 1))]);
         let _ = segtree.fold(0..1);
-        let _ = segtree.entry(0);
+        let _ = segtree.entry(&0);
         assert_eq!(segtree[0], (1, 1));
     }
 
     #[test]
+    #[allow(clippy::many_single_char_names)]
     fn test_segtree_of_segtree() {
-        use xor::*;
+        use xor::O;
         let mut rng = StdRng::seed_from_u64(42);
         for _ in 0..30 {
             let h = rng.gen_range(1..=20);
@@ -1375,7 +1631,7 @@
                         let y = rng.gen_range(0..u64::MAX);
                         let (i, j, x) = vec[k];
                         vec[k].2 = x ^ y;
-                        segtree.apply(i, j, |v| *v ^= y);
+                        segtree.apply(&i, &j, |v| *v ^= y);
                     }
                     _ => unreachable!(),
                 }
@@ -1385,7 +1641,7 @@
 
     #[test]
     fn test_dense_2d_segtree() {
-        use xor::*;
+        use xor::O;
         let mut rng = StdRng::seed_from_u64(42);
         for _ in 0..20 {
             let h = rng.gen_range(1..=10);
@@ -1428,9 +1684,9 @@
 
     #[test]
     fn test_dense_2d_segtree_usability() {
-        use xor::*;
-        let _ = Dense2dSegtree::<O>::new(&vec![vec![0]]);
-        let mut segtree = Dense2dSegtree::<O>::new(&vec![vec![0]]);
+        use xor::O;
+        let _ = Dense2dSegtree::<O>::new(&[vec![0]]);
+        let mut segtree = Dense2dSegtree::<O>::new(&[vec![0]]);
         let _ = segtree.fold(0..1, 0..1);
         let _ = segtree.entry(0, 0);
         assert_eq!(segtree[0][0], 0);