18.17.8.3.1. Ordering-Based Queries
🔗defStd.TreeMap.entryAtIdx.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (n : Nat)
(h : n < t.size) : α × β Std.TreeMap.entryAtIdx.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (n : Nat)
(h : n < t.size) : α × β
Returns the key-value pair with the n
-th smallest key.
🔗def
Returns the key-value pair with the n
-th smallest key, or panics if n
is at least t.size
.
🔗def
Returns the key-value pair with the n
-th smallest key, or none
if n
is at least t.size
.
🔗defStd.TreeMap.entryAtIdxD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (n : Nat)
(fallback : α × β) : α × β Std.TreeMap.entryAtIdxD.{u, v}
{α : Type u} {β : Type v}
{cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (n : Nat)
(fallback : α × β) : α × β
Returns the key-value pair with the n
-th smallest key, or fallback
if n
is at least t.size
.
🔗defStd.TreeMap.getEntryGE.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ (cmp a k).isGE = true) : α × β Std.TreeMap.getEntryGE.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isGE = true) :
α × β
Given a proof that such a mapping exists, retrieves the key-value pair with the smallest key that is
greater than or equal to the given key.
🔗def
Tries to retrieve the key-value pair with the smallest key that is greater than or equal to the
given key, panicking if no such pair exists.
🔗def
Tries to retrieve the key-value pair with the smallest key that is greater than or equal to the
given key, returning none
if no such pair exists.
🔗defStd.TreeMap.getEntryGED.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β Std.TreeMap.getEntryGED.{u, v}
{α : Type u} {β : Type v}
{cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the smallest key that is greater than or equal to the
given key, returning fallback
if no such pair exists.
🔗defStd.TreeMap.getEntryGT.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ cmp a k = Ordering.gt) : α × β Std.TreeMap.getEntryGT.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ cmp a k = Ordering.gt) :
α × β
Given a proof that such a mapping exists, retrieves the key-value pair with the smallest key that is
greater than the given key.
🔗def
Tries to retrieve the key-value pair with the smallest key that is greater than the given key,
panicking if no such pair exists.
🔗def
Tries to retrieve the key-value pair with the smallest key that is greater than the given key,
returning none
if no such pair exists.
🔗defStd.TreeMap.getEntryGTD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β Std.TreeMap.getEntryGTD.{u, v}
{α : Type u} {β : Type v}
{cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the smallest key that is greater than the given key,
returning fallback
if no such pair exists.
🔗defStd.TreeMap.getEntryLE.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ (cmp a k).isLE = true) : α × β Std.TreeMap.getEntryLE.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isLE = true) :
α × β
Given a proof that such a mapping exists, retrieves the key-value pair with the largest key that is
less than or equal to the given key.
🔗def
Tries to retrieve the key-value pair with the largest key that is less than or equal to the
given key, panicking if no such pair exists.
🔗def
Tries to retrieve the key-value pair with the largest key that is less than or equal to the
given key, returning none
if no such pair exists.
🔗defStd.TreeMap.getEntryLED.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β Std.TreeMap.getEntryLED.{u, v}
{α : Type u} {β : Type v}
{cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the largest key that is less than or equal to the
given key, returning fallback
if no such pair exists.
🔗defStd.TreeMap.getEntryLT.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ cmp a k = Ordering.lt) : α × β Std.TreeMap.getEntryLT.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ cmp a k = Ordering.lt) :
α × β
Given a proof that such a mapping exists, retrieves the key-value pair with the smallest key that is
less than the given key.
🔗def
Tries to retrieve the key-value pair with the smallest key that is less than the given key,
panicking if no such pair exists.
🔗def
Tries to retrieve the key-value pair with the smallest key that is less than the given key,
returning none
if no such pair exists.
🔗defStd.TreeMap.getEntryLTD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β Std.TreeMap.getEntryLTD.{u, v}
{α : Type u} {β : Type v}
{cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (k : α)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the smallest key that is less than the given key,
returning fallback
if no such pair exists.
🔗defStd.TreeMap.getGE.{u} {α : Type u} {cmp : α → α → Ordering}
[Std.TransCmp cmp] (t : Std.TreeSet α cmp) (k : α)
(h : ∃ a, a ∈ t ∧ (cmp a k).isGE = true) : α Std.TreeMap.getGE.{u} {α : Type u}
{cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeSet α cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isGE = true) :
α
Given a proof that such an element exists, retrieves the smallest element that is
greater than or equal to the given element.
🔗def
Given a proof that such an element exists, retrieves the smallest element that is
greater than the given element.
🔗defStd.TreeMap.getKeyGE.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ (cmp a k).isGE = true) : α Std.TreeMap.getKeyGE.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isGE = true) :
α
Given a proof that such a mapping exists, retrieves the smallest key that is
greater than or equal to the given key.
🔗def
Tries to retrieve the smallest key that is greater than or equal to the
given key, panicking if no such key exists.
🔗def
Tries to retrieve the smallest key that is greater than or equal to the
given key, returning none
if no such key exists.
🔗defStd.TreeMap.getKeyGED.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k fallback : α) :
α Std.TreeMap.getKeyGED.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(k fallback : α) : α
Tries to retrieve the smallest key that is greater than or equal to the
given key, returning fallback
if no such key exists.
🔗defStd.TreeMap.getKeyGT.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ cmp a k = Ordering.gt) : α Std.TreeMap.getKeyGT.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ cmp a k = Ordering.gt) :
α
Given a proof that such a mapping exists, retrieves the smallest key that is
greater than the given key.
🔗def
Tries to retrieve the smallest key that is greater than the given key,
panicking if no such key exists.
🔗def
Tries to retrieve the smallest key that is greater than the given key,
returning none
if no such key exists.
🔗defStd.TreeMap.getKeyGTD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k fallback : α) :
α Std.TreeMap.getKeyGTD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(k fallback : α) : α
Tries to retrieve the smallest key that is greater than the given key,
returning fallback
if no such key exists.
🔗defStd.TreeMap.getKeyLE.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ (cmp a k).isLE = true) : α Std.TreeMap.getKeyLE.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isLE = true) :
α
Given a proof that such a mapping exists, retrieves the largest key that is
less than or equal to the given key.
🔗def
Tries to retrieve the largest key that is less than or equal to the
given key, panicking if no such key exists.
🔗def
Tries to retrieve the largest key that is less than or equal to the
given key, returning none
if no such key exists.
🔗defStd.TreeMap.getKeyLED.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k fallback : α) :
α Std.TreeMap.getKeyLED.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(k fallback : α) : α
Tries to retrieve the largest key that is less than or equal to the
given key, returning fallback
if no such key exists.
🔗defStd.TreeMap.getKeyLT.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} [Std.TransCmp cmp] (t : Std.TreeMap α β cmp)
(k : α) (h : ∃ a, a ∈ t ∧ cmp a k = Ordering.lt) : α Std.TreeMap.getKeyLT.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeMap α β cmp) (k : α)
(h :
∃ a, a ∈ t ∧ cmp a k = Ordering.lt) :
α
Given a proof that such a mapping exists, retrieves the smallest key that is
less than the given key.
🔗def
Tries to retrieve the smallest key that is less than the given key,
panicking if no such key exists.
🔗def
Tries to retrieve the smallest key that is less than the given key,
returning none
if no such key exists.
🔗defStd.TreeMap.getKeyLTD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (k fallback : α) :
α Std.TreeMap.getKeyLTD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(k fallback : α) : α
Tries to retrieve the smallest key that is less than the given key,
returning fallback
if no such key exists.
🔗defStd.TreeMap.getLE.{u} {α : Type u} {cmp : α → α → Ordering}
[Std.TransCmp cmp] (t : Std.TreeSet α cmp) (k : α)
(h : ∃ a, a ∈ t ∧ (cmp a k).isLE = true) : α Std.TreeMap.getLE.{u} {α : Type u}
{cmp : α → α → Ordering}
[Std.TransCmp cmp]
(t : Std.TreeSet α cmp) (k : α)
(h :
∃ a, a ∈ t ∧ (cmp a k).isLE = true) :
α
Given a proof that such an element exists, retrieves the largest element that is
less than or equal to the given element.
🔗def
Given a proof that such an element exists, retrieves the smallest element that is
less than the given element.
🔗defStd.TreeMap.keyAtIdx.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (n : Nat)
(h : n < t.size) : α Std.TreeMap.keyAtIdx.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (n : Nat)
(h : n < t.size) : α
Returns the n
-th smallest key.
🔗def
Returns the n
-th smallest key, or panics if n
is at least t.size
.
🔗def
Returns the n
-th smallest key, or none
if n
is at least t.size
.
🔗defStd.TreeMap.keyAtIdxD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (n : Nat)
(fallback : α) : α Std.TreeMap.keyAtIdxD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp) (n : Nat)
(fallback : α) : α
Returns the n
-th smallest key, or fallback
if n
is at least t.size
.
🔗def
Given a proof that the tree map is not empty, retrieves the key-value pair with the smallest key.
🔗def
Tries to retrieve the key-value pair with the smallest key in the tree map, panicking if the map is
empty.
🔗def
Tries to retrieve the key-value pair with the smallest key in the tree map, returning none
if the
map is empty.
🔗defStd.TreeMap.minEntryD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp)
(fallback : α × β) : α × β Std.TreeMap.minEntryD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the smallest key in the tree map, returning fallback
if
the tree map is empty.
🔗def
Given a proof that the tree map is not empty, retrieves the smallest key.
🔗def
Tries to retrieve the smallest key in the tree map, panicking if the map is empty.
🔗def
Tries to retrieve the smallest key in the tree map, returning none
if the map is empty.
🔗defStd.TreeMap.minKeyD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (fallback : α) : α Std.TreeMap.minKeyD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(fallback : α) : α
Tries to retrieve the smallest key in the tree map, returning fallback
if the tree map is empty.
🔗def
Given a proof that the tree map is not empty, retrieves the key-value pair with the largest key.
🔗def
Tries to retrieve the key-value pair with the largest key in the tree map, panicking if the map is
empty.
🔗def
Tries to retrieve the key-value pair with the largest key in the tree map, returning none
if the
map is empty.
🔗defStd.TreeMap.maxEntryD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp)
(fallback : α × β) : α × β Std.TreeMap.maxEntryD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(fallback : α × β) : α × β
Tries to retrieve the key-value pair with the largest key in the tree map, returning fallback
if
the tree map is empty.
🔗def
Given a proof that the tree map is not empty, retrieves the largest key.
🔗def
Tries to retrieve the largest key in the tree map, panicking if the map is empty.
🔗def
Tries to retrieve the largest key in the tree map, returning none
if the map is empty.
🔗defStd.TreeMap.maxKeyD.{u, v} {α : Type u} {β : Type v}
{cmp : α → α → Ordering} (t : Std.TreeMap α β cmp) (fallback : α) : α Std.TreeMap.maxKeyD.{u, v} {α : Type u}
{β : Type v} {cmp : α → α → Ordering}
(t : Std.TreeMap α β cmp)
(fallback : α) : α
Tries to retrieve the largest key in the tree map, returning fallback
if the tree map is empty.