pub struct IntCOStack<I>where
I: IntCO,{ /* private fields */ }Implementations§
Source§impl<I> IntCOStack<I>where
I: IntCO,
impl<I> IntCOStack<I>where
I: IntCO,
pub fn change_points(&self) -> &[ChangePoint<I::CoordType>]
pub fn covered(&self) -> &IntCOSet<I>
pub fn height_stats(&self) -> StackHeightStats
pub fn height_at(&self, x: I::CoordType) -> usize
Source§impl<I> IntCOStack<I>where
I: IntCO,
impl<I> IntCOStack<I>where
I: IntCO,
Sourcepub fn iter_height_segments(&self) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_height_segments(&self) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments.
Each item is a closed-open interval together with the stack height that applies throughout that interval.
If all positive-height regions have the same height, the segment intervals
are exactly the covered set intervals and the shared height is supplied
from height_stats. Otherwise, the height-preserving segmentation is
reconstructed from change points.
Sourcepub fn iter_height_segments_at_least(
&self,
min_height: usize,
) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_height_segments_at_least( &self, min_height: usize, ) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments whose height is at least
min_height.
Each item is a closed-open interval together with the stack height that applies throughout that interval.
This method uses height_stats for cheap fast paths:
- if
min_heightis greater than the observed maximum height, the iterator is empty; - if
min_heightis less than or equal to the observed minimum positive height, every positive-height segment matches anditer_height_segmentsis reused; - otherwise, canonical change points are scanned and filtered.
A min_height of zero is treated the same as requesting all positive-height
segments, because zero-height gaps are never yielded.
Sourcepub fn iter_height_segments_at_most(
&self,
max_height: usize,
) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_height_segments_at_most( &self, max_height: usize, ) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments whose height is at most
max_height.
Each item is a closed-open interval together with the stack height that applies throughout that interval.
This method uses height_stats for cheap fast paths:
- if
max_heightis zero, the iterator is empty because zero-height gaps are never yielded; - if
max_heightis smaller than the observed minimum positive height, the iterator is empty; - if
max_heightis greater than or equal to the observed maximum height, every positive-height segment matches anditer_height_segmentsis reused; - otherwise, canonical change points are scanned and filtered.
Sourcepub fn iter_height_segments_exactly(
&self,
target_height: usize,
) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_height_segments_exactly( &self, target_height: usize, ) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments whose height is exactly
target_height.
Each item is a closed-open interval together with the stack height that applies throughout that interval.
This method uses height_stats for cheap fast paths:
- if
target_heightis zero, the iterator is empty because zero-height gaps are never yielded; - if
target_heightis outside the observed positive-height range, the iterator is empty; - if all positive-height regions share the same height and
target_heightequals that height, the intervals are exactly the covered set intervals; - otherwise, canonical change points are scanned and filtered.
Sourcepub fn iter_height_segments_between(
&self,
min_height: usize,
max_height: usize,
) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_height_segments_between( &self, min_height: usize, max_height: usize, ) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments whose height is within
min_height..=max_height.
Each item is a closed-open interval together with the stack height that applies throughout that interval.
Zero-height gaps are never yielded. Therefore, a min_height of zero is
treated as if it included all positive heights.
This method uses height_stats for cheap fast paths:
- if
min_height > max_height, the iterator is empty; - if the stack has no positive-height segments, the iterator is empty;
- if the requested range does not overlap the observed positive-height range, the iterator is empty;
- if the requested range covers the full observed positive-height range,
every segment matches and
iter_height_segmentsis reused; - otherwise, canonical change points are scanned and filtered.
Sourcepub fn iter_peak_height_segments(&self) -> impl Iterator<Item = (I, usize)> + '_
pub fn iter_peak_height_segments(&self) -> impl Iterator<Item = (I, usize)> + '_
Iterates over positive-height stack segments whose height is the observed maximum stack height.
Each item is a closed-open interval together with the peak height that applies throughout that interval.
If the stack has no positive-height segments, the iterator is empty.
This is equivalent to:
iter_height_segments_exactly(height_stats.max_height())Trait Implementations§
Source§impl<I> Clone for IntCOStack<I>
impl<I> Clone for IntCOStack<I>
Source§fn clone(&self) -> IntCOStack<I>
fn clone(&self) -> IntCOStack<I>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<I> Debug for IntCOStack<I>
impl<I> Debug for IntCOStack<I>
Source§impl<I> Default for IntCOStack<I>where
I: IntCO,
impl<I> Default for IntCOStack<I>where
I: IntCO,
impl<I> Eq for IntCOStack<I>
Source§impl<I> FromIterator<I> for IntCOStack<I>
impl<I> FromIterator<I> for IntCOStack<I>
Source§fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = I>,
fn from_iter<T>(iter: T) -> Selfwhere
T: IntoIterator<Item = I>,
Source§impl<I> FromParallelIterator<I> for IntCOStack<I>
impl<I> FromParallelIterator<I> for IntCOStack<I>
Source§fn from_par_iter<T>(par_iter: T) -> Selfwhere
T: IntoParallelIterator<Item = I>,
fn from_par_iter<T>(par_iter: T) -> Selfwhere
T: IntoParallelIterator<Item = I>,
Builds a stack from intervals in parallel.
Each worker accumulates endpoint-derived stack parts locally. The final reduction merges those parts into one canonical height function.
The covered set is then projected from the final change points instead of being built from a second raw interval collection. This keeps the stack and its covered view derived from the same canonical height function and avoids retaining all input intervals during reduction.
Source§impl<I> PartialEq for IntCOStack<I>
impl<I> PartialEq for IntCOStack<I>
Source§fn eq(&self, other: &IntCOStack<I>) -> bool
fn eq(&self, other: &IntCOStack<I>) -> bool
self and other values to be equal, and is used by ==.impl<I> StructuralPartialEq for IntCOStack<I>where
I: IntCO,
Auto Trait Implementations§
impl<I> Freeze for IntCOStack<I>
impl<I> RefUnwindSafe for IntCOStack<I>
impl<I> Send for IntCOStack<I>
impl<I> Sync for IntCOStack<I>
impl<I> Unpin for IntCOStack<I>
impl<I> UnsafeUnpin for IntCOStack<I>
impl<I> UnwindSafe for IntCOStack<I>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more