pub enum IndexFn {
Lattice {
axis_sizes: Vec<u64>,
},
Lockstep {
length: u64,
},
Modular {
axis_sizes: Vec<u64>,
},
Concatenation {
segment_sizes: Vec<u64>,
},
Continuous {
intervals: Vec<Interval>,
measure: ProductMeasure,
},
Hybrid {
discrete_axes: Vec<u64>,
continuous_axes: Vec<Interval>,
measure: ProductMeasure,
},
}Expand description
Closed-form addressing schemes — spec §10.7.1.
Six variants. Each describes the bijection from a
0..cardinality index range to the node’s tuple shape.
Continuous and Hybrid carry the cardinality’s
interval+measure descriptors directly so the R2 push-down
rules (Phase 6) can dispatch on them without recomputing.
Variants§
Lattice
Discrete cartesian. axis_sizes[i] is the i-th axis’s
element count. Multi-index (i₀, i₁, …) maps to the
per-axis tuple at those positions.
Lockstep
Zip Strict / Truncate. One index i ∈ 0..length maps
to the per-child tuple at position i.
Modular
Zip Cycle. Modular addressing — index i maps to each
child at i mod child.cardinality. At least one child
must be bounded (the cycling target).
Concatenation
Union of index-addressable children. Index i ∈ 0..Σsegment_sizes maps to segment k where k is the
smallest such that Σ₀^k segment_sizes > i, position
i - Σ₀^{k-1} segment_sizes within that segment.
Continuous
Continuous K-D box. Strategy push-down rules (Halton / Sobol / Lhs / Extrema on Continuous) draw from this directly; the discrete-to-continuous mapping is strategy-specific.
Fields
measure: ProductMeasureThe measure drawn from.
Hybrid
Mixed discrete × continuous cartesian. Discrete axes get integer indexing; continuous axes get measure-weighted sampling. Strategy push-down dispatches per-axis.
Implementations§
Source§impl IndexFn
impl IndexFn
Sourcepub fn has_continuous_axis(&self) -> bool
pub fn has_continuous_axis(&self) -> bool
true if this index function carries any continuous
axis. Used by per-strategy V4 checks to reject
strategies that don’t accept continuous inputs.
Sourcepub fn is_multi_axis_lattice(&self) -> bool
pub fn is_multi_axis_lattice(&self) -> bool
true if this index function is a multi-axis Lattice
(discrete cartesian with ≥2 axes). Required by
lattice-geometric strategies (Extrema / Shells /
Diagonal / Antidiagonal) for non-degenerate behavior.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for IndexFn
impl<'de> Deserialize<'de> for IndexFn
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexFn, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<IndexFn, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for IndexFn
impl Serialize for IndexFn
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for IndexFn
Auto Trait Implementations§
impl Freeze for IndexFn
impl RefUnwindSafe for IndexFn
impl Send for IndexFn
impl Sync for IndexFn
impl Unpin for IndexFn
impl UnsafeUnpin for IndexFn
impl UnwindSafe for IndexFn
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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