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) -> HeightStats
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 = HeightSegment<I>> + '_
pub fn iter_height_segments( &self, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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 = HeightSegment<I>> + '_
pub fn iter_height_segments_at_least( &self, min_height: usize, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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 = HeightSegment<I>> + '_
pub fn iter_height_segments_at_most( &self, max_height: usize, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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 = HeightSegment<I>> + '_
pub fn iter_height_segments_exactly( &self, target_height: usize, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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 = HeightSegment<I>> + '_
pub fn iter_height_segments_between( &self, min_height: usize, max_height: usize, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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 = HeightSegment<I>> + '_
pub fn iter_peak_height_segments( &self, ) -> impl Iterator<Item = HeightSegment<I>> + '_
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())Source§impl<I> IntCOStack<I>
impl<I> IntCOStack<I>
Sourcepub fn iter_windows(
&self,
from: I::CoordType,
to: I::CoordType,
len: I::MeasureType,
) -> impl DoubleEndedIterator<Item = StackWindow<'_, I>> + ExactSizeIterator
pub fn iter_windows( &self, from: I::CoordType, to: I::CoordType, len: I::MeasureType, ) -> impl DoubleEndedIterator<Item = StackWindow<'_, I>> + ExactSizeIterator
Iterates over all fixed-length windows fully contained in [from, to).
Window starts advance by one coordinate unit:
[from, from + len)
[from + 1, from + 1 + len)
...Returns an empty iterator when:
from >= to;len == 0;lenis greater than the measure of[from, to);- the window count cannot be represented as
usize.
Sourcepub fn par_iter_windows(
&self,
from: I::CoordType,
to: I::CoordType,
len: I::MeasureType,
) -> impl IndexedParallelIterator<Item = StackWindow<'_, I>>
pub fn par_iter_windows( &self, from: I::CoordType, to: I::CoordType, len: I::MeasureType, ) -> impl IndexedParallelIterator<Item = StackWindow<'_, I>>
Iterates in parallel over all fixed-length windows fully contained in
[from, to).
The valid window-start range is represented as an indexed integer
range, allowing Rayon to split the work directly without a serial
producer or par_bridge.
Trait Implementations§
Source§impl<I> Clone for IntCOStack<I>where
I: IntCO,
impl<I> Clone for IntCOStack<I>where
I: IntCO,
Source§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>where
I: IntCO,
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 not built during construction. It is a derived cache and is initialized lazily when the covered view is first requested.
Source§impl<I> PartialEq for IntCOStack<I>where
I: IntCO,
impl<I> PartialEq 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