pub fn extent(&self) -> Interval<T> {
    if self.intervals.is_empty() {
      panic!("self.interval is empty!")
    }
    let first = self.intervals.get(0).unwrap();
    if self.intervals.len() == 1 {
      first.clone()
    } else {
      let mut lowers = self
        .intervals
        .iter()
        .map(|e| e.lower.clone())
        .collect::<Vec<IntervalLimit<T>>>();
      lowers.sort_by(|a, b| a.partial_cmp(&b).unwrap());
      let lower = lowers.get(0).unwrap();
      let mut uppers = self
        .intervals
        .iter()
        .map(|e| e.upper.clone())
        .collect::<Vec<IntervalLimit<T>>>();
      uppers.sort_by(|a, b| b.partial_cmp(&a).unwrap());
      let upper = uppers.get(0).unwrap();
      first.new_of_same_type(
        lower.as_value().clone(),
        lower.is_closed(),
        upper.as_value().clone(),
        upper.is_closed(),
      )
    }
  }
/// Return the smallest interval that encompasses all the element intervals.
///
/// - return: the smallest interval that encompasses all the elemental intervals.
/// - panic: if none of the elements are present
Return the smallest interval that encompasses all the element intervals.
return: the smallest interval that encompasses all the elemental intervals.
panic: if none of the elements are present
Return the smallest interval that encompasses all the element intervals . return : the smallest interval that encompasses all the elemental intervals . panic : if none of the elements are present
pub fn extent(&self) -> Interval<T> {
    if self.intervals.is_empty() {
      panic!("self.interval is empty!")
    }
    let first = self.intervals.get(0).unwrap();
    if self.intervals.len() == 1 {
      first.clone()
    } else {
      let mut lowers = self
        .intervals
        .iter()
        .map(|e| e.lower.clone())
        .collect::<Vec<IntervalLimit<T>>>();
      lowers.sort_by(|a, b| a.partial_cmp(&b).unwrap());
      let lower = lowers.get(0).unwrap();
      let mut uppers = self
        .intervals
        .iter()
        .map(|e| e.upper.clone())
        .collect::<Vec<IntervalLimit<T>>>();
      uppers.sort_by(|a, b| b.partial_cmp(&a).unwrap());
      let upper = uppers.get(0).unwrap();
      first.new_of_same_type(
        lower.as_value().clone(),
        lower.is_closed(),
        upper.as_value().clone(),
        upper.is_closed(),
      )
    }
  }
pub fn extent ( & self ) -> Interval < T > { if self . intervals . is_empty ( ) { panic ! ( " " ) } let first = self . intervals . get ( 0 ) . unwrap ( ) ; if self . intervals . len ( ) == 1 { first . clone ( ) } else { let mut lowers = self . intervals . iter ( ) . map ( | e | e . lower . clone ( ) ) . collect :: < Vec < IntervalLimit < T > > > ( ) ; lowers . sort_by ( | a , b | a . partial_cmp ( & b ) . unwrap ( ) ) ; let lower = lowers . get ( 0 ) . unwrap ( ) ; let mut uppers = self . intervals . iter ( ) . map ( | e | e . upper . clone ( ) ) . collect :: < Vec < IntervalLimit < T > > > ( ) ; uppers . sort_by ( | a , b | b . partial_cmp ( & a ) . unwrap ( ) ) ; let upper = uppers . get ( 0 ) . unwrap ( ) ; first . new_of_same_type ( lower . as_value ( ) . clone ( ) , lower . is_closed ( ) , upper . as_value ( ) . clone ( ) , upper . is_closed ( ) , ) } }
Return the smallest interval that encompasses all the element intervals.
Return the smallest interval that encompasses all the element intervals .
&self