pub struct RegionPlan { /* private fields */ }Expand description
Compiled region plan — precomputed for O(1) lookups during tick execution.
Created by Space::compile_region.
Fields are pub(crate) — use accessor methods from outside the crate.
Implementations§
Source§impl RegionPlan
impl RegionPlan
Sourcepub fn cell_count(&self) -> usize
pub fn cell_count(&self) -> usize
Number of valid cells in the region (derived from coords.len()).
Sourcepub fn tensor_indices(&self) -> &[usize]
pub fn tensor_indices(&self) -> &[usize]
Mapping: coords[i] -> flat tensor index for observation output.
Sourcepub fn valid_mask(&self) -> &[u8] ⓘ
pub fn valid_mask(&self) -> &[u8] ⓘ
Validity mask: 1 = valid cell, 0 = padding.
Sourcepub fn take_valid_mask(&mut self) -> Vec<u8> ⓘ
pub fn take_valid_mask(&mut self) -> Vec<u8> ⓘ
Take ownership of the valid mask, replacing it with an empty vec.
Sourcepub fn bounding_shape(&self) -> &BoundingShape
pub fn bounding_shape(&self) -> &BoundingShape
Shape of the bounding tensor that contains this region.
Sourcepub fn valid_ratio(&self) -> f64
pub fn valid_ratio(&self) -> f64
Fraction of tensor elements that are valid (non-padding).
Trait Implementations§
Source§impl Clone for RegionPlan
impl Clone for RegionPlan
Source§fn clone(&self) -> RegionPlan
fn clone(&self) -> RegionPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RegionPlan
impl RefUnwindSafe for RegionPlan
impl Send for RegionPlan
impl Sync for RegionPlan
impl Unpin for RegionPlan
impl UnsafeUnpin for RegionPlan
impl UnwindSafe for RegionPlan
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
Mutably borrows from an owned value. Read more