Skip to main content

WindowedIterRealData

Struct WindowedIterRealData 

Source
pub struct WindowedIterRealData<I: Iterator<Item = f64>> {
    state: WindowedIterState<I, f64>,
}
Expand description

Windowed iterator-backed real (f64) vector data.

Like super::IterRealData, but only keeps a sliding window of elements in memory. Sequential forward access within the window is O(1). Access outside the window triggers full materialization.

Fields§

§state: WindowedIterState<I, f64>

Implementations§

Source§

impl<I: Iterator<Item = f64>> WindowedIterRealData<I>

Source

pub fn from_iter(iter: I, len: usize, window_size: usize) -> Self

Create from an iterator with explicit length and window size.

Source§

impl<I: ExactSizeIterator<Item = f64>> WindowedIterRealData<I>

Source

pub fn from_exact_iter(iter: I, window_size: usize) -> Self

Create from an ExactSizeIterator with window size (length auto-detected).

Trait Implementations§

Source§

impl<I: Iterator<Item = f64> + 'static> AltReal for WindowedIterRealData<I>

Source§

const HAS_ELT: bool = true

Set to true to register elt.
Source§

const HAS_GET_REGION: bool = true

Set to true to register get_region.
Source§

fn elt(x: SEXP, i: R_xlen_t) -> f64

Get element at index.
Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [f64], ) -> R_xlen_t

Bulk read elements into buffer.
Source§

const HAS_IS_SORTED: bool = false

Set to true to register is_sorted.
Source§

fn is_sorted(_x: SEXP) -> i32

Sortedness hint.
Source§

const HAS_NO_NA: bool = false

Set to true to register no_na.
Source§

fn no_na(_x: SEXP) -> i32

NA-free hint.
Source§

const HAS_SUM: bool = false

Set to true to register sum.
Source§

fn sum(_x: SEXP, _narm: bool) -> SEXP

Optimized sum.
Source§

const HAS_MIN: bool = false

Set to true to register min.
Source§

fn min(_x: SEXP, _narm: bool) -> SEXP

Optimized min.
Source§

const HAS_MAX: bool = false

Set to true to register max.
Source§

fn max(_x: SEXP, _narm: bool) -> SEXP

Optimized max.
Source§

impl<I: Iterator<Item = f64>> AltRealData for WindowedIterRealData<I>

Source§

fn elt(&self, i: usize) -> f64

Get the real element at index i.
Source§

fn as_slice(&self) -> Option<&[f64]>

Optional: return a pointer to contiguous data if available.
Source§

fn get_region(&self, start: usize, len: usize, buf: &mut [f64]) -> usize

Optional: bulk read into buffer (clamped to available data).
Source§

fn is_sorted(&self) -> Option<Sortedness>

Optional: sortedness hint.
Source§

fn no_na(&self) -> Option<bool>

Optional: does this vector contain any NA values?
Source§

fn sum(&self, _na_rm: bool) -> Option<f64>

Optional: optimized sum.
Source§

fn min(&self, _na_rm: bool) -> Option<f64>

Optional: optimized min.
Source§

fn max(&self, _na_rm: bool) -> Option<f64>

Optional: optimized max.
Source§

impl<I: Iterator<Item = f64> + 'static> AltVec for WindowedIterRealData<I>

Source§

const HAS_DATAPTR: bool = false

Set to true to register dataptr.
Source§

fn dataptr(_x: SEXP, _writable: bool) -> *mut c_void

Get raw data pointer.
Source§

const HAS_DATAPTR_OR_NULL: bool = false

Set to true to register dataptr_or_null.
Source§

fn dataptr_or_null(_x: SEXP) -> *const c_void

Get data pointer without forcing materialization.
Source§

const HAS_EXTRACT_SUBSET: bool = false

Set to true to register extract_subset.
Source§

fn extract_subset(_x: SEXP, _indx: SEXP, _call: SEXP) -> SEXP

Optimized subsetting.
Source§

impl<I: Iterator<Item = f64> + 'static> Altrep for WindowedIterRealData<I>

Source§

fn length(x: SEXP) -> R_xlen_t

Returns the length of the ALTREP vector. This is REQUIRED - R cannot determine vector length without it.
Source§

const GUARD: AltrepGuard = AltrepGuard::RUnwind

The guard mode for all ALTREP trampolines on this type. Read more
Source§

const HAS_SERIALIZED_STATE: bool = false

Set to true to register serialized_state.
Source§

fn serialized_state(_x: SEXP) -> SEXP

Return serialization state.
Source§

const HAS_UNSERIALIZE: bool = false

Set to true to register unserialize.
Source§

fn unserialize(_class: SEXP, _state: SEXP) -> SEXP

Reconstruct ALTREP from serialized state.
Source§

const HAS_UNSERIALIZE_EX: bool = false

Set to true to register unserialize_ex.
Source§

fn unserialize_ex( _class: SEXP, _state: SEXP, _attr: SEXP, _objf: i32, _levs: i32, ) -> SEXP

Extended unserialization with attributes.
Source§

const HAS_DUPLICATE: bool = false

Set to true to register duplicate.
Source§

fn duplicate(_x: SEXP, _deep: bool) -> SEXP

Duplicate the ALTREP object.
Source§

const HAS_DUPLICATE_EX: bool = false

Set to true to register duplicate_ex.
Source§

fn duplicate_ex(_x: SEXP, _deep: bool) -> SEXP

Extended duplication.
Source§

const HAS_COERCE: bool = false

Set to true to register coerce.
Source§

fn coerce(_x: SEXP, _to_type: SEXPTYPE) -> SEXP

Coerce to another type.
Source§

const HAS_INSPECT: bool = false

Set to true to register inspect.
Source§

fn inspect( _x: SEXP, _pre: i32, _deep: i32, _pvec: i32, _inspect_subtree: Option<unsafe extern "C-unwind" fn(SEXP, i32, i32, i32)>, ) -> bool

Custom inspection for .Internal(inspect()).
Source§

impl<I: Iterator<Item = f64>> AltrepLen for WindowedIterRealData<I>

Source§

fn len(&self) -> usize

Returns the length of this ALTREP vector.
Source§

fn is_empty(&self) -> bool

Returns true if the vector is empty.
Source§

impl<I: Iterator<Item = f64> + 'static> InferBase for WindowedIterRealData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Real

The inferred R base type.
Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Create the ALTREP class handle. Read more
Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Install ALTREP methods on the class. Read more
Source§

impl<I: Iterator<Item = f64> + 'static> TypedExternal for WindowedIterRealData<I>

Source§

const TYPE_NAME: &'static str = "WindowedIterRealData"

The type name as a static string (for debugging and display)
Source§

const TYPE_NAME_CSTR: &'static [u8] = b"WindowedIterRealData\0"

The type name as a null-terminated C string (for R tag display)
Source§

const TYPE_ID_CSTR: &'static [u8] = b"miniextendr_api::altrep::WindowedIterRealData\0"

Namespaced type ID as a null-terminated C string (for type checking). Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AltrepExtract for T
where T: TypedExternal,

Source§

unsafe fn altrep_extract_ref(x: SEXP) -> &'static T

Extract a shared reference from the ALTREP data1 slot. Read more
Source§

unsafe fn altrep_extract_mut(x: SEXP) -> &'static mut T

Extract a mutable reference from the ALTREP data1 slot. Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.