pub struct BoundaryFeatures {
pub distances: Vec<f32>,
pub boundary_types: Vec<u8>,
pub weights: Vec<f32>,
}Expand description
Boundary proximity features
Fields§
§distances: Vec<f32>Distance from each node to nearest boundary
boundary_types: Vec<u8>Boundary type for each node (0=inner, 1=X-boundary, 2=Z-boundary)
weights: Vec<f32>Normalized boundary weights
Implementations§
Source§impl BoundaryFeatures
impl BoundaryFeatures
Sourcepub fn compute(positions: &[(f32, f32)], grid_size: usize) -> Self
pub fn compute(positions: &[(f32, f32)], grid_size: usize) -> Self
Compute boundary features from node positions
§Arguments
positions- (x, y) coordinates for each nodegrid_size- Size of the syndrome grid
Sourcepub fn to_features(&self, feature_dim: usize) -> Array2<f32>
pub fn to_features(&self, feature_dim: usize) -> Array2<f32>
Convert to feature matrix
Trait Implementations§
Source§impl Clone for BoundaryFeatures
impl Clone for BoundaryFeatures
Source§fn clone(&self) -> BoundaryFeatures
fn clone(&self) -> BoundaryFeatures
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 BoundaryFeatures
impl RefUnwindSafe for BoundaryFeatures
impl Send for BoundaryFeatures
impl Sync for BoundaryFeatures
impl Unpin for BoundaryFeatures
impl UnwindSafe for BoundaryFeatures
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
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>
Converts
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>
Converts
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