diff --git a/dependencies.js b/dependencies.js index b5e45c08..d6cbe43d 100644 --- a/dependencies.js +++ b/dependencies.js @@ -1 +1 @@ -dependencies = {"fp":{"dependencies":[],"tags":[]},"bitutils":{"dependencies":[],"tags":[]},"elim":{"dependencies":[],"tags":[]},"two_sat":{"dependencies":["scc"],"tags":[]},"segbeats_task3":{"dependencies":["open"],"tags":[]},"rbtree":{"dependencies":[],"tags":[]},"bfs":{"dependencies":[],"tags":[]},"segbeats":{"dependencies":["open"],"tags":[]},"tree_fold":{"dependencies":[],"tags":[]},"gridnei":{"dependencies":[],"tags":[]},"io":{"dependencies":[],"tags":[]},"interval_heap":{"dependencies":[],"tags":[]},"bfs01":{"dependencies":[],"tags":[]},"reverse":{"dependencies":[],"tags":[]},"swag":{"dependencies":[],"tags":[]},"avl_tree":{"dependencies":[],"tags":[]},"open":{"dependencies":[],"tags":[]},"monotone_minima":{"dependencies":[],"tags":[]},"itermore":{"dependencies":[],"tags":[]},"zeta":{"dependencies":[],"tags":[]},"bsgs":{"dependencies":[],"tags":[]},"fps":{"dependencies":["fp"],"tags":[]},"gco":{"dependencies":["dinic"],"tags":[]},"lg":{"dependencies":[],"tags":[]},"low_link":{"dependencies":[],"tags":[]},"lazy_segtree":{"dependencies":[],"tags":[]},"union_find":{"dependencies":[],"tags":[]},"poly":{"dependencies":[],"tags":[]},"next_permutation":{"dependencies":[],"tags":[]},"dual_segtree":{"dependencies":[],"tags":[]},"cht":{"dependencies":[],"tags":[]},"suffix_sum":{"dependencies":[],"tags":[]},"hld":{"dependencies":[],"tags":[]},"rational":{"dependencies":[],"tags":[]},"hungarian":{"dependencies":[],"tags":[]},"skew-heap":{"dependencies":[],"tags":[]},"heap_slope_trick":{"dependencies":[],"tags":[]},"dfs":{"dependencies":[],"tags":[]},"cmpmore":{"dependencies":[],"tags":[]},"slicemore":{"dependencies":[],"tags":[]},"wavelet_matrix":{"dependencies":[],"tags":[]},"z_algo":{"dependencies":[],"tags":[]},"not_nan":{"dependencies":[],"tags":[]},"uf_checklist":{"dependencies":["union_find"],"tags":[]},"splay_tree":{"dependencies":[],"tags":[]},"mincost_flow":{"dependencies":[],"tags":[]},"space":{"dependencies":[],"tags":[]},"gss":{"dependencies":[],"tags":[]},"advance":{"dependencies":[],"tags":[]},"convex_hull":{"dependencies":[],"tags":[]},"bitvec":{"dependencies":[],"tags":[]},"segtree":{"dependencies":[],"tags":[]},"filter_position":{"dependencies":[],"tags":[]},"lazy_segbeats":{"dependencies":["open"],"tags":[]},"max_flow":{"dependencies":[],"tags":[]},"sort_tree":{"dependencies":[],"tags":[]},"sparse_table":{"dependencies":[],"tags":[]},"binary":{"dependencies":[],"tags":[]},"rb":{"dependencies":[],"tags":[]},"make_graph":{"dependencies":[],"tags":[]},"euclid":{"dependencies":[],"tags":[]},"cipolla":{"dependencies":[],"tags":[]},"inversion_number":{"dependencies":[],"tags":[]},"lin_ineq":{"dependencies":[],"tags":[]},"dinic":{"dependencies":[],"tags":[]},"trial":{"dependencies":[],"tags":[]},"trie":{"dependencies":[],"tags":[]},"dial":{"dependencies":[],"tags":[]},"newton":{"dependencies":[],"tags":[]},"erato":{"dependencies":[],"tags":[]},"hopkarp":{"dependencies":[],"tags":[]},"veb":{"dependencies":[],"tags":[]},"radix_heap":{"dependencies":[],"tags":[]},"accum":{"dependencies":[],"tags":[]},"numeric_search":{"dependencies":[],"tags":[]},"scc":{"dependencies":[],"tags":[]},"manacher":{"dependencies":[],"tags":[]},"dijkstra_radix_heap":{"dependencies":["radix_heap"],"tags":[]},"suffix_array":{"dependencies":[],"tags":[]},"heap_tricks":{"dependencies":[],"tags":[]},"partially_persistent_union_find":{"dependencies":[],"tags":[]},"randtools":{"dependencies":[],"tags":[]},"vec_lines":{"dependencies":[],"tags":[]},"lagrange":{"dependencies":["fp"],"tags":[]}} \ No newline at end of file +dependencies = {"euclid":{"dependencies":[],"tags":[]},"bitvec":{"dependencies":[],"tags":[]},"fps":{"dependencies":["fp"],"tags":[]},"interval_heap":{"dependencies":[],"tags":[]},"max_flow":{"dependencies":[],"tags":[]},"union_find":{"dependencies":[],"tags":[]},"bitutils":{"dependencies":[],"tags":[]},"rbtree":{"dependencies":[],"tags":[]},"wavelet_matrix":{"dependencies":[],"tags":[]},"make_graph":{"dependencies":[],"tags":[]},"lg":{"dependencies":[],"tags":[]},"suffix_array":{"dependencies":[],"tags":[]},"lagrange":{"dependencies":["fp"],"tags":[]},"cht":{"dependencies":[],"tags":[]},"two_sat":{"dependencies":["scc"],"tags":[]},"z_algo":{"dependencies":[],"tags":[]},"gridnei":{"dependencies":[],"tags":[]},"inversion_number":{"dependencies":[],"tags":[]},"gss":{"dependencies":[],"tags":[]},"advance":{"dependencies":[],"tags":[]},"binary":{"dependencies":[],"tags":[]},"open":{"dependencies":[],"tags":[]},"cipolla":{"dependencies":[],"tags":[]},"next_permutation":{"dependencies":[],"tags":[]},"numeric_search":{"dependencies":[],"tags":[]},"segtree":{"dependencies":[],"tags":[]},"hopkarp":{"dependencies":[],"tags":[]},"scc":{"dependencies":[],"tags":[]},"mincost_flow":{"dependencies":[],"tags":[]},"space":{"dependencies":[],"tags":[]},"fp":{"dependencies":[],"tags":[]},"monotone_minima":{"dependencies":[],"tags":[]},"elim":{"dependencies":[],"tags":[]},"itermore":{"dependencies":[],"tags":[]},"dijkstra_radix_heap":{"dependencies":["radix_heap"],"tags":[]},"veb":{"dependencies":[],"tags":[]},"rb":{"dependencies":[],"tags":[]},"bfs":{"dependencies":[],"tags":[]},"segbeats":{"dependencies":["open"],"tags":[]},"lazy_segbeats":{"dependencies":["open"],"tags":[]},"dfs":{"dependencies":[],"tags":[]},"avl_tree":{"dependencies":[],"tags":[]},"hungarian":{"dependencies":[],"tags":[]},"tree_fold":{"dependencies":[],"tags":[]},"io":{"dependencies":[],"tags":[]},"trial":{"dependencies":[],"tags":[]},"poly":{"dependencies":[],"tags":[]},"uf_checklist":{"dependencies":["union_find"],"tags":[]},"lazy_segtree":{"dependencies":[],"tags":[]},"dial":{"dependencies":[],"tags":[]},"erato":{"dependencies":[],"tags":[]},"dinic":{"dependencies":[],"tags":[]},"dual_segtree":{"dependencies":[],"tags":[]},"swag":{"dependencies":[],"tags":[]},"heap_tricks":{"dependencies":[],"tags":[]},"zeta":{"dependencies":[],"tags":[]},"radix_heap":{"dependencies":[],"tags":[]},"filter_position":{"dependencies":[],"tags":[]},"bsgs":{"dependencies":[],"tags":[]},"skew-heap":{"dependencies":[],"tags":[]},"sparse_table":{"dependencies":[],"tags":[]},"cmpmore":{"dependencies":[],"tags":[]},"not_nan":{"dependencies":[],"tags":[]},"reverse":{"dependencies":[],"tags":[]},"newton":{"dependencies":[],"tags":[]},"suffix_sum":{"dependencies":[],"tags":[]},"bfs01":{"dependencies":[],"tags":[]},"sort_tree":{"dependencies":[],"tags":[]},"heap_slope_trick":{"dependencies":[],"tags":[]},"gco":{"dependencies":["dinic"],"tags":[]},"splay_tree":{"dependencies":[],"tags":[]},"hld":{"dependencies":[],"tags":[]},"accum":{"dependencies":[],"tags":[]},"lin_ineq":{"dependencies":[],"tags":[]},"segbeats_task3":{"dependencies":["open"],"tags":[]},"partially_persistent_union_find":{"dependencies":[],"tags":[]},"randtools":{"dependencies":[],"tags":[]},"slicemore":{"dependencies":[],"tags":[]},"rational":{"dependencies":[],"tags":[]},"low_link":{"dependencies":[],"tags":[]},"vec_lines":{"dependencies":[],"tags":[]},"convex_hull":{"dependencies":[],"tags":[]},"trie":{"dependencies":[],"tags":[]},"manacher":{"dependencies":[],"tags":[]}} \ No newline at end of file diff --git a/help.html b/help.html index cc22d4a2..ab44fa7f 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/convert/trait.From.js b/implementors/core/convert/trait.From.js index b595d3bb..a5aaf5fd 100644 --- a/implementors/core/convert/trait.From.js +++ b/implementors/core/convert/trait.From.js @@ -2,7 +2,7 @@ "cht":[["impl From<i64> for Quadratic"]], "dual_segtree":[["impl<O: Ops> From<Vec<<O as Ops>::Value, Global>> for DualSegtree<O>"]], "fp":[["impl<const P: u64> From<i16> for Fp<P>"],["impl<const P: u64> From<isize> for Fp<P>"],["impl<const P: u64> From<i64> for Fp<P>"],["impl<const P: u64> From<i32> for Fp<P>"],["impl<const P: u64> From<u32> for Fp<P>"],["impl<const P: u64> From<u64> for Fp<P>"],["impl<const P: u64> From<i128> for Fp<P>"],["impl<const P: u64> From<u128> for Fp<P>"],["impl<const P: u64> From<u16> for Fp<P>"],["impl<const P: u64> From<i8> for Fp<P>"],["impl<const P: u64> From<usize> for Fp<P>"],["impl<const P: u64> From<u8> for Fp<P>"]], -"interval_heap":[["impl<T: Ord + Debug> From<Vec<T, Global>> for IntervalHeap<T>"]], +"interval_heap":[["impl<T: Ord> From<Vec<T, Global>> for IntervalHeap<T>"]], "sparse_table":[["impl<'a, O: Op> From<&'a [<O as Op>::Value]> for SparseTable<O>where\n O::Value: Clone,"],["impl<O: Op> From<Vec<<O as Op>::Value, Global>> for SparseTable<O>"],["impl<O: Op> From<Vec<Vec<<O as Op>::Value, Global>, Global>> for SparseTable2d<O>"],["impl<'a, O: Op> From<&'a [Vec<<O as Op>::Value, Global>]> for SparseTable2d<O>where\n O::Value: Clone,"]], "suffix_sum":[["impl<O: Op> From<Vec<<O as Op>::Value, Global>> for SuffixSum<O>"],["impl<O: Op> From<Vec<Vec<<O as Op>::Value, Global>, Global>> for SuffixSum2d<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/iter/traits/collect/trait.Extend.js b/implementors/core/iter/traits/collect/trait.Extend.js index 1cf63963..72b6e801 100644 --- a/implementors/core/iter/traits/collect/trait.Extend.js +++ b/implementors/core/iter/traits/collect/trait.Extend.js @@ -1,3 +1,4 @@ (function() {var implementors = { +"interval_heap":[["impl<T: Ord> Extend<T> for IntervalHeap<T>"]], "skew_heap":[["impl<A: Ord> Extend<A> for SkewHeap<A>"],["impl<'a, A: 'a + Copy + Ord> Extend<&'a A> for SkewHeap<A>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/implementors/core/iter/traits/collect/trait.FromIterator.js b/implementors/core/iter/traits/collect/trait.FromIterator.js index 89b0e24b..3f474d6e 100644 --- a/implementors/core/iter/traits/collect/trait.FromIterator.js +++ b/implementors/core/iter/traits/collect/trait.FromIterator.js @@ -3,6 +3,7 @@ "bitvec":[["impl FromIterator<bool> for BitVec"]], "dual_segtree":[["impl<O: Ops> FromIterator<<O as Ops>::Value> for DualSegtree<O>"]], "heap_tricks":[["impl<T: Copy + Ord + Hash> FromIterator<T> for RemovableHeap<T>"]], +"interval_heap":[["impl<T: Ord> FromIterator<T> for IntervalHeap<T>"]], "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>"]], diff --git a/implementors/core/iter/traits/collect/trait.IntoIterator.js b/implementors/core/iter/traits/collect/trait.IntoIterator.js index a5577107..6221f358 100644 --- a/implementors/core/iter/traits/collect/trait.IntoIterator.js +++ b/implementors/core/iter/traits/collect/trait.IntoIterator.js @@ -1,6 +1,7 @@ (function() {var implementors = { "avl_tree":[["impl<'a, T> IntoIterator for &'a AvlTree<T>"],["impl<T> IntoIterator for AvlTree<T>"]], "bitvec":[["impl<'a> IntoIterator for &'a BitVec"]], +"interval_heap":[["impl<T: Ord> IntoIterator for IntervalHeap<T>"]], "rb":[["impl<'a, K: Ord, V> IntoIterator for &'a Multimap<K, V>"],["impl<'a, O: Op> IntoIterator for &'a Seg<O>"],["impl<'a, K: Ord> IntoIterator for &'a Multiset<K>"],["impl<'a, K: Ord, O: MultimapOp> IntoIterator for &'a MultimapSeg<K, O>"]], "rbtree":[["impl<'a, O: Op> IntoIterator for &'a RbTree<O::Value, O>"]], "splay_tree":[["impl<'a, O: LazyOps> IntoIterator for &'a SplayTree<O>"]] diff --git a/interval_heap/index.html b/interval_heap/index.html index f6ecc894..4c6cdf07 100644 --- a/interval_heap/index.html +++ b/interval_heap/index.html @@ -32,7 +32,7 @@ }); -

Crate interval_heap

source ·
Expand description

Interval Heaps

+

Crate interval_heap

source ·
Expand description

Interval Heaps

van Leeuwen, Jan, and Derick Wood. “Interval heaps.” The Computer Journal 36.3 (1993): 209-216.

  • Double-ended priority queue: IntervalHeap
  • diff --git a/interval_heap/struct.IntervalHeap.html b/interval_heap/struct.IntervalHeap.html index 5245c75c..c99ecc0d 100644 --- a/interval_heap/struct.IntervalHeap.html +++ b/interval_heap/struct.IntervalHeap.html @@ -32,14 +32,14 @@ }); -
    pub struct IntervalHeap<T: Ord> { /* private fields */ }
    Expand description

    Interval heap (double-ended priority queue)

    +
    pub struct IntervalHeap<T: Ord> { /* private fields */ }
    Expand description

    Interval heap (double-ended priority queue)

    Implementations§

    source§

    impl<T: Ord> IntervalHeap<T>

    source

    pub fn new() -> Self

    Constructs a new, empty interval heap.

    source

    pub fn peek_min(&self) -> Option<&T>

    Returns $\min(S)$.

    source

    pub fn peek_max(&self) -> Option<&T>

    Returns $\max(S)$.

    source

    pub fn pop_min(&mut self) -> Option<T>

    Removes and returns $\min(S)$.

    source

    pub fn pop_max(&mut self) -> Option<T>

    Removes and returns $\max(S)$.

    source

    pub fn push(&mut self, x: T)

    $S \leftarrow S \cup \{\!\{x\}\!\}$.

    -

    Trait Implementations§

    source§

    impl<T: Clone + Ord> Clone for IntervalHeap<T>

    source§

    fn clone(&self) -> IntervalHeap<T>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<T: Debug + Ord> Debug for IntervalHeap<T>

    source§

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

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

    impl<T: Ord> Default for IntervalHeap<T>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    source§

    impl<T: Ord + Debug> From<Vec<T, Global>> for IntervalHeap<T>

    source§

    fn from(values: Vec<T>) -> Self

    Converts to this type from the input type.
    source§

    impl<T: PartialEq + Ord> PartialEq<IntervalHeap<T>> for IntervalHeap<T>

    source§

    fn eq(&self, other: &IntervalHeap<T>) -> bool

    This method tests for self and other values to be equal, and is used +

    Trait Implementations§

    source§

    impl<T: Clone + Ord> Clone for IntervalHeap<T>

    source§

    fn clone(&self) -> IntervalHeap<T>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<T: Debug + Ord> Debug for IntervalHeap<T>

    source§

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

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

    impl<T: Ord> Default for IntervalHeap<T>

    source§

    fn default() -> Self

    Returns the “default value” for a type. Read more
    source§

    impl<T: Ord> Extend<T> for IntervalHeap<T>

    source§

    fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I)

    Extends a collection with the contents of an iterator. Read more
    source§

    fn extend_one(&mut self, item: A)

    🔬This is a nightly-only experimental API. (extend_one)
    Extends a collection with exactly one element.
    source§

    fn extend_reserve(&mut self, additional: usize)

    🔬This is a nightly-only experimental API. (extend_one)
    Reserves capacity in a collection for the given number of additional elements. Read more
    source§

    impl<T: Ord> From<Vec<T, Global>> for IntervalHeap<T>

    source§

    fn from(values: Vec<T>) -> Self

    Converts to this type from the input type.
    source§

    impl<T: Ord> FromIterator<T> for IntervalHeap<T>

    source§

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

    Creates a value from an iterator. Read more
    source§

    impl<T: Ord> IntoIterator for IntervalHeap<T>

    §

    type IntoIter = IntoIter<T, Global>

    Which kind of iterator are we turning this into?
    §

    type Item = T

    The type of the elements being iterated over.
    source§

    fn into_iter(self) -> Self::IntoIter

    Creates an iterator from a value. Read more
    source§

    impl<T: PartialEq + Ord> PartialEq<IntervalHeap<T>> for IntervalHeap<T>

    source§

    fn eq(&self, other: &IntervalHeap<T>) -> bool

    This method tests for self and other values to be equal, and is used by ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
    source§

    impl<T: Eq + Ord> Eq for IntervalHeap<T>

    source§

    impl<T: Ord> StructuralEq for IntervalHeap<T>

    source§

    impl<T: Ord> StructuralPartialEq for IntervalHeap<T>

    Auto Trait Implementations§

    §

    impl<T> RefUnwindSafe for IntervalHeap<T>where T: RefUnwindSafe,

    §

    impl<T> Send for IntervalHeap<T>where diff --git a/search-index.js b/search-index.js index e110b04c..74f58de9 100644 --- a/search-index.js +++ b/search-index.js @@ -31,7 +31,7 @@ var searchIndex = JSON.parse('{\ "hld":{"doc":"重軽分解をします。","t":"DDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Hld","IterE","IterV","adjacent_toward","between","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","child","clone","clone","clone","clone_into","clone_into","clone_into","default","dist","eq","eq","eq","fmt","fmt","fmt","from","from","from","hash","hash","hash","head","into","into","into","into_iter","into_iter","is_adjacent","is_ancestor_of","iter_e","iter_v","lca","new","next","next","ord","parent","size","time","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id"],"q":[[0,"hld"]],"d":["重軽分解","","","x の隣接頂点のうち、toward …","3 つの頂点番号 a, b, c について、bac …","","","","","","","親を消したグラフを返します。","","","","","","","","2 …","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","頂点番号から、Heavy path …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","頂点 u, v が隣接頂点であれば true…","pu の祖先であれば true、さもなくば false …","Self::iter_v とほぼ同様ですが、LCA …","2 つの頂点番号から、その間のパスを Heavy …","2 つの頂点番号から、LCA …","HLD …","","","…","…","…","…","","","","","","","","","","","",""],"i":[0,0,0,1,1,1,4,5,1,4,5,1,1,4,5,1,4,5,1,1,1,4,5,1,4,5,1,4,5,1,4,5,1,1,4,5,4,5,1,1,1,1,1,1,4,5,1,1,1,1,1,4,5,1,4,5,1,4,5,1,4,5],"f":[0,0,0,[[1,2,2],2],[[1,2,2,2],3],[[]],[[]],[[]],[[]],[[]],[[]],[1],[1,1],[4,4],[5,5],[[]],[[]],[[]],[[],1],[[1,2,2],2],[[1,1],3],[[4,4],3],[[5,5],3],[[1,6],7],[[4,6],7],[[5,6],7],[[]],[[]],[[]],[[1,8]],[[4,8]],[[5,8]],[1],[[]],[[]],[[]],[[]],[[]],[[1,2,2],3],[[1,2,2],3],[[1,2,2],5],[[1,2,2],4],[[1,2,2],2],[2,1],[4,9],[5,9],[1],[1],[1],[1],[[]],[[]],[[]],[[],10],[[],10],[[],10],[[],10],[[],10],[[],10],[[],11],[[],11],[[],11]],"c":[],"p":[[3,"Hld"],[15,"usize"],[15,"bool"],[3,"IterV"],[3,"IterE"],[3,"Formatter"],[6,"Result"],[8,"Hasher"],[4,"Option"],[4,"Result"],[3,"TypeId"]]},\ "hopkarp":{"doc":"Finds a maximum cardinality bipartite matching by …","t":"DMLLLLMLLLMLLFLMMLLLL","n":["HopkarpResult","backward","borrow","borrow_mut","clone","clone_into","count","default","eq","fmt","forward","from","hash","hopkarp","into","left","right","to_owned","try_from","try_into","type_id"],"q":[[0,"hopkarp"]],"d":["Summary of the result of Hopcroft―Karp’s algorithm.","","","","","","Cardinality of a maximum cardinality bipartite matching.","","","","","Returns the argument unchanged.","","Takes a forward adjacency list and the length of the right …","Calls U::from(self).","","","","","",""],"i":[0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1],"f":[0,0,[[]],[[]],[1,1],[[]],0,[[],1],[[1,1],2],[[1,3],4],0,[[]],[[1,5]],[6,1],[[]],0,0,[[]],[[],7],[[],7],[[],8]],"c":[],"p":[[3,"HopkarpResult"],[15,"bool"],[3,"Formatter"],[6,"Result"],[8,"Hasher"],[15,"usize"],[4,"Result"],[3,"TypeId"]]},\ "hungarian":{"doc":"Solve an assignment problem by Hungarian algorithm.","t":"DIMLLLLLLMLFKLMMLLLLMK","n":["HungarianResult","Value","backward","borrow","borrow_mut","clone","clone_into","eq","fmt","forward","from","hungarian","infinity","into","left","right","to_owned","try_from","try_into","type_id","value","zero"],"q":[[0,"hungarian"]],"d":["A value object to represent the optimal solution of an …","A trait to adapt a value type to hungarian","Takes the second component of a match and returns the …","","","","","","","Takes the first component of a match and returns the …","Returns the argument unchanged.","See the crate level documentation","","Calls U::from(self).","A left half of an optimal potential.","A right half of an optimal potential.","","","","","The value of an optimal solution.",""],"i":[0,0,3,3,3,3,3,3,3,3,3,0,2,3,3,3,3,3,3,3,3,2],"f":[0,0,0,[[]],[[]],[[[3,[[0,[1,2]]]]],[[3,[[0,[1,2]]]]]],[[]],[[[3,[[0,[4,2]]]],[3,[[0,[4,2]]]]],5],[[[3,[[0,[6,2]]]],7],8],0,[[]],[[],[[3,[2]]]],[[]],[[]],0,0,[[]],[[],9],[[],9],[[],10],0,[[]]],"c":[],"p":[[8,"Clone"],[8,"Value"],[3,"HungarianResult"],[8,"PartialEq"],[15,"bool"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[4,"Result"],[3,"TypeId"]]},\ -"interval_heap":{"doc":"Interval Heaps","t":"DLLLLLLLLLLLLLLLLLLLL","n":["IntervalHeap","borrow","borrow_mut","clone","clone_into","default","eq","fmt","from","from","into","new","peek_max","peek_min","pop_max","pop_min","push","to_owned","try_from","try_into","type_id"],"q":[[0,"interval_heap"]],"d":["Interval heap (double-ended priority queue)","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","Constructs a new, empty interval heap.","Returns $\\\\max(S)$.","Returns $\\\\min(S)$.","Removes and returns $\\\\max(S)$.","Removes and returns $\\\\min(S)$.","$S \\\\leftarrow S \\\\cup \\\\{\\\\!\\\\{x\\\\}\\\\!\\\\}$.","","","",""],"i":[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],"f":[0,[[]],[[]],[[[3,[[0,[1,2]]]]],[[3,[[0,[1,2]]]]]],[[]],[[],[[3,[2]]]],[[[3,[[0,[4,2]]]],[3,[[0,[4,2]]]]],5],[[[3,[[0,[6,2]]]],7],8],[[]],[[[9,[[0,[2,6]]]]],[[3,[[0,[2,6]]]]]],[[]],[[],[[3,[2]]]],[[[3,[2]]],[[10,[2]]]],[[[3,[2]]],[[10,[2]]]],[[[3,[2]]],[[10,[2]]]],[[[3,[2]]],[[10,[2]]]],[[[3,[2]],2]],[[]],[[],11],[[],11],[[],12]],"c":[],"p":[[8,"Clone"],[8,"Ord"],[3,"IntervalHeap"],[8,"PartialEq"],[15,"bool"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[3,"Vec"],[4,"Option"],[4,"Result"],[3,"TypeId"]]},\ +"interval_heap":{"doc":"Interval Heaps","t":"DLLLLLLLLLLLLLLLLLLLLLLL","n":["IntervalHeap","borrow","borrow_mut","clone","clone_into","default","eq","extend","fmt","from","from","from_iter","into","into_iter","new","peek_max","peek_min","pop_max","pop_min","push","to_owned","try_from","try_into","type_id"],"q":[[0,"interval_heap"]],"d":["Interval heap (double-ended priority queue)","","","","","","","","","","Returns the argument unchanged.","","Calls U::from(self).","","Constructs a new, empty interval heap.","Returns $\\\\max(S)$.","Returns $\\\\min(S)$.","Removes and returns $\\\\max(S)$.","Removes and returns $\\\\min(S)$.","$S \\\\leftarrow S \\\\cup \\\\{\\\\!\\\\{x\\\\}\\\\!\\\\}$.","","","",""],"i":[0,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3],"f":[0,[[]],[[]],[[[3,[[0,[1,2]]]]],[[3,[[0,[1,2]]]]]],[[]],[[],[[3,[2]]]],[[[3,[[0,[4,2]]]],[3,[[0,[4,2]]]]],5],[[[3,[2]],6]],[[[3,[[0,[7,2]]]],8],9],[[[10,[2]]],[[3,[2]]]],[[]],[6,[[3,[2]]]],[[]],[[[3,[2]]]],[[],[[3,[2]]]],[[[3,[2]]],[[11,[2]]]],[[[3,[2]]],[[11,[2]]]],[[[3,[2]]],[[11,[2]]]],[[[3,[2]]],[[11,[2]]]],[[[3,[2]],2]],[[]],[[],12],[[],12],[[],13]],"c":[],"p":[[8,"Clone"],[8,"Ord"],[3,"IntervalHeap"],[8,"PartialEq"],[15,"bool"],[8,"IntoIterator"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[3,"Vec"],[4,"Option"],[4,"Result"],[3,"TypeId"]]},\ "inversion_number":{"doc":"Calculates the number of inversions.","t":"F","n":["inversion_number"],"q":[[0,"inversion_number"]],"d":["Takes a sequence of numbers in 0..value_limit and returns …"],"i":[0],"f":[[1,2]],"c":[],"p":[[15,"usize"],[15,"u64"]]},\ "io":{"doc":"Read input from stdin and parse it.","t":"IFK","n":["ParseLine","input","parse_line"],"q":[[0,"io"]],"d":["Trait for types that can be parsed.","Read input from stdin and parse it.",""],"i":[0,0,1],"f":[0,[[],1],[2]],"c":[],"p":[[8,"ParseLine"],[15,"str"]]},\ "itermore":{"doc":"An extension trait of Iterator","t":"DIDDDLLLLLLLLFKLLLLLLLLLLLLLLLLFKLLLLFKLLLLLLLLFKLLLLLLLLLLLLLLLL","n":["ClosedPrefixSum","IterMore","MaxDecrease","MaxIncrease","OpenPrefixSum","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","closed_prefix_sum","closed_prefix_sum","closed_prefix_sum","closed_prefix_sum","closed_prefix_sum","closed_prefix_sum","from","from","from","from","into","into","into","into","into_iter","into_iter","into_iter","into_iter","max_decrease","max_decrease","max_decrease","max_decrease","max_decrease","max_decrease","max_increase","max_increase","max_increase","max_increase","max_increase","max_increase","next","next","next","next","open_prefix_sum","open_prefix_sum","open_prefix_sum","open_prefix_sum","open_prefix_sum","open_prefix_sum","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id"],"q":[[0,"itermore"]],"d":["Return value of closed_prefix_sum.","An extension trait of Iterator","Return value of max_decrease.","Return value of max_increase.","Return value of open_prefix_sum.","","","","","","","","","Returns $\\\\sum \\\\left \\\\lbrace a _ j \\\\vert 0 \\\\le j \\\\le i …","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","Returns $\\\\max \\\\left \\\\lbrace a _ j \\\\vert 0 \\\\le j \\\\le i …","","","","","","Returns $a _ i - \\\\min \\\\left \\\\lbrace a _ j \\\\vert 0 \\\\le j …","","","","","","","","","","Returns $\\\\sum \\\\left \\\\lbrace a _ j \\\\vert 0 \\\\le j \\\\lt i …","","","","","","","","","","","","","","","","",""],"i":[0,0,0,0,0,6,2,4,3,6,2,4,3,0,10,6,2,4,3,6,2,4,3,6,2,4,3,6,2,4,3,0,10,6,2,4,3,0,10,6,2,4,3,6,2,4,3,0,10,6,2,4,3,6,2,4,3,6,2,4,3,6,2,4,3],"f":[0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,2],[[],2],[[],2],[[],2],[[],2],[[],2],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,3],[[],3],[[],3],[[],3],[[],3],[[],3],[1,4],[[],4],[[],4],[[],4],[[],4],[[],4],[[[6,[5]]],7],[[[2,[5]]],7],[[[4,[5]]],7],[[[3,[5]]],7],[1,6],[[],6],[[],6],[[],6],[[],6],[[],6],[[],8],[[],8],[[],8],[[],8],[[],8],[[],8],[[],8],[[],8],[[],9],[[],9],[[],9],[[],9]],"c":[],"p":[[8,"IntoIterator"],[3,"ClosedPrefixSum"],[3,"MaxDecrease"],[3,"MaxIncrease"],[8,"Iterator"],[3,"OpenPrefixSum"],[4,"Option"],[4,"Result"],[3,"TypeId"],[8,"IterMore"]]},\ diff --git a/settings.html b/settings.html index 38ec7867..ef1a6432 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/interval_heap/lib.rs.html b/src/interval_heap/lib.rs.html index 9b33416f..79b1f7ca 100644 --- a/src/interval_heap/lib.rs.html +++ b/src/interval_heap/lib.rs.html @@ -282,6 +282,22 @@ 248 249 250 +251 +252 +253 +254 +255 +256 +257 +258 +259 +260 +261 +262 +263 +264 +265 +266

    //! # Interval Heaps
     //!
     //! van Leeuwen, Jan, and Derick Wood. "Interval heaps." The Computer Journal 36.3 (1993): 209-216.
    @@ -364,13 +380,35 @@
             Self { values: Vec::new() }
         }
     }
    -impl<T: Ord + std::fmt::Debug> From<Vec<T>> for IntervalHeap<T> {
    +impl<T: Ord> From<Vec<T>> for IntervalHeap<T> {
         fn from(values: Vec<T>) -> Self {
    -        let mut result = Self::new();
    +        let mut ret = Self::new();
             for x in values {
    -            result.push(x);
    +            ret.push(x);
             }
    -        result
    +        ret
    +    }
    +}
    +impl<T: Ord> Extend<T> for IntervalHeap<T> {
    +    fn extend<I: IntoIterator<Item = T>>(&mut self, iter: I) {
    +        for x in iter {
    +            self.push(x);
    +        }
    +    }
    +}
    +impl<T: Ord> IntoIterator for IntervalHeap<T> {
    +    type IntoIter = std::vec::IntoIter<T>;
    +    type Item = T;
    +
    +    fn into_iter(self) -> Self::IntoIter {
    +        self.values.into_iter()
    +    }
    +}
    +impl<T: Ord> std::iter::FromIterator<T> for IntervalHeap<T> {
    +    fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self {
    +        let mut ret = Self::new();
    +        ret.extend(iter);
    +        ret
         }
     }
     
    @@ -486,19 +524,17 @@
         fn test_interval_heap() {
             let mut rng = StdRng::seed_from_u64(42);
             for _ in 0..100 {
    -            let n = rng.gen_range(0..4);
    +            let n = rng.gen_range(0..10);
                 let q = rng.gen_range(10..100);
                 let lim = rng.gen_range(1..=n + q + 10);
                 let mut vec = (0..n).map(|_| rng.gen_range(0..lim)).collect::<Vec<_>>();
                 let mut interval_heap = IntervalHeap::from(vec.clone());
                 vec.sort_unstable();
    -            eprintln!("vec = {:?}", vec);
                 for _ in 0..q {
                     match rng.gen_range(0..3) {
                         // push
                         0 => {
                             let x = rng.gen_range(0..lim);
    -                        eprintln!("push {}", x);
                             interval_heap.push(x);
                             let i = vec.binary_search(&x).unwrap_or_else(|x| x);
                             vec.insert(i, x);
    @@ -506,7 +542,6 @@
                         }
                         // pop_min
                         1 => {
    -                        eprintln!("pop_min");
                             if let Some(x) = interval_heap.pop_min() {
                                 assert_eq!(x, vec.remove(0));
                                 validate_interval_heap(&interval_heap);
    @@ -516,7 +551,6 @@
                         }
                         // pop_max
                         2 => {
    -                        eprintln!("pop_max");
                             if let Some(x) = interval_heap.pop_max() {
                                 assert_eq!(x, vec.pop().unwrap());
                                 validate_interval_heap(&interval_heap);
    @@ -526,9 +560,7 @@
                         }
                         _ => unreachable!(),
                     }
    -                eprintln!("vec = {:?}", &vec);
                 }
    -            eprintln!("---");
             }
         }
     }