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.