Skip to main content

IteratorLisExt

Trait IteratorLisExt 

Source
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§

Source

fn lis(self) -> Vec<Self::Item>
where Self: Sized, Self::Item: Ord,

Consumes the iterator and computes the values of the longest strictly increasing subsequence.

Source

fn lis_by<F>(self, is_less: F) -> Vec<Self::Item>
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> bool,

Consumes the iterator and computes the values based on a custom is_less closure.

Source

fn lis_by_key<K, F>(self, f: F) -> Vec<Self::Item>
where Self: Sized, F: FnMut(&Self::Item) -> K, K: Ord,

Consumes the iterator and computes the values based on a key extraction closure.

Source

fn lis_by_cached_key<K, F>(self, f: F) -> Vec<Self::Item>
where Self: Sized, F: FnMut(&Self::Item) -> K, K: Ord,

Consumes the iterator and computes the values based on a cached key extraction closure.

Source

fn lis_length(self) -> usize
where Self: Sized, Self::Item: Ord,

Consumes the iterator and computes the length of the longest strictly increasing subsequence.

Source

fn lis_length_by<F>(self, is_less: F) -> usize
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> bool,

Consumes the iterator and computes the length based on a custom is_less closure.

Source

fn lis_length_by_key<K, F>(self, f: F) -> usize
where Self: Sized, F: FnMut(&Self::Item) -> K, K: Ord,

Consumes the iterator and computes the length based on a key extraction closure.

Source

fn lis_length_by_cached_key<K, F>(self, f: F) -> usize
where Self: Sized, F: FnMut(&Self::Item) -> K, K: Ord,

Consumes the iterator and computes the length based on a cached key extraction closure.

Implementors§