pub(crate) fn last_invalid_points(
        &self,
        n: usize,
        comparator: &Box<dyn Fn(f64) -> bool>,
    ) -> Vec<&DataPoint> {
        self.points
            .iter()
            .rev()
            .filter(|p| p.val.is_some())
            .take(n)
            .filter(|p| p.val.map_or(false, |v| comparator(v)))
            .collect()
    }
/// Get only invalid points from the end of the list
// comparator is a box closure, which is not allows in map_or
Get only invalid points from the end of the list
comparator is a box closure, which is not allows in map_or
Get only invalid points from the end of the list comparator is a box closure which is not allows in map_or
pub(crate) fn last_invalid_points(
        &self,
        n: usize,
        comparator: &Box<dyn Fn(f64) -> bool>,
    ) -> Vec<&DataPoint> {
        self.points
            .iter()
            .rev()
            .filter(|p| p.val.is_some())
            .take(n)
            .filter(|p| p.val.map_or(false, |v| comparator(v)))
            .collect()
    }
pub ( crate ) fn last_invalid_points ( & self , n : usize , comparator : & Box < dyn Fn ( f64 ) -> bool > , ) -> Vec < & DataPoint > { self . points . iter ( ) . rev ( ) . filter ( | p | p . val . is_some ( ) ) . take ( n ) . filter ( | p | p . val . map_or ( false , | v | comparator ( v ) ) ) . collect ( ) }
Get only invalid points from the end of the list
comparator is a box closure, which is not allows in map_or
Get only invalid points from the end of the list comparator is a box closure which is not allows in map_or
&self
n
usize
comparator
&Box<dyn Fn(f64) -> bool>
&self
n
usize
comparator
&Box<dyn Fn(f64) -> bool>