pub trait IteratorLisExt: Iterator {
// Provided methods
fn lis(self) -> Vec<Self::Item>
where Self: Sized,
Self::Item: Ord { ... }
fn lis_by<F>(self, is_less: F) -> Vec<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> bool { ... }
fn lis_by_key<K, F>(self, f: F) -> Vec<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item) -> K,
K: Ord { ... }
fn lis_by_cached_key<K, F>(self, f: F) -> Vec<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item) -> K,
K: Ord { ... }
fn lis_length(self) -> usize
where Self: Sized,
Self::Item: Ord { ... }
fn lis_length_by<F>(self, is_less: F) -> usize
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> bool { ... }
fn lis_length_by_key<K, F>(self, f: F) -> usize
where Self: Sized,
F: FnMut(&Self::Item) -> K,
K: Ord { ... }
fn lis_length_by_cached_key<K, F>(self, f: F) -> usize
where Self: Sized,
F: FnMut(&Self::Item) -> K,
K: Ord { ... }
}Expand description
Extension trait to compute longest monotonic subsequences on iterators.
Provided Methods§
Sourcefn lis(self) -> Vec<Self::Item>
fn lis(self) -> Vec<Self::Item>
Consumes the iterator and computes the values of the longest strictly increasing subsequence.
Sourcefn lis_by<F>(self, is_less: F) -> Vec<Self::Item>
fn lis_by<F>(self, is_less: F) -> Vec<Self::Item>
Consumes the iterator and computes the values based on a custom is_less closure.
Sourcefn lis_by_key<K, F>(self, f: F) -> Vec<Self::Item>
fn lis_by_key<K, F>(self, f: F) -> Vec<Self::Item>
Consumes the iterator and computes the values based on a key extraction closure.
Sourcefn lis_by_cached_key<K, F>(self, f: F) -> Vec<Self::Item>
fn lis_by_cached_key<K, F>(self, f: F) -> Vec<Self::Item>
Consumes the iterator and computes the values based on a cached key extraction closure.
Sourcefn lis_length(self) -> usize
fn lis_length(self) -> usize
Consumes the iterator and computes the length of the longest strictly increasing subsequence.
Sourcefn lis_length_by<F>(self, is_less: F) -> usize
fn lis_length_by<F>(self, is_less: F) -> usize
Consumes the iterator and computes the length based on a custom is_less closure.
Sourcefn lis_length_by_key<K, F>(self, f: F) -> usize
fn lis_length_by_key<K, F>(self, f: F) -> usize
Consumes the iterator and computes the length based on a key extraction closure.