pub struct TensorTiling {
pub tiles: Vec<TensorTile>,
pub adjacency: Vec<(usize, usize, f64)>,
}Expand description
A complete tensor-valued tiling with adjacency information.
Fields§
§tiles: Vec<TensorTile>§adjacency: Vec<(usize, usize, f64)>(tile_i, tile_j, shared_edge_orientation in radians).
Implementations§
Source§impl TensorTiling
impl TensorTiling
Sourcepub fn new(tiles: Vec<TensorTile>) -> Self
pub fn new(tiles: Vec<TensorTile>) -> Self
Create a new tiling, auto-detecting adjacency from tile positions.
Two tiles are considered adjacent if their centres are within
2.0 units of each other (typical Penrose edge length ≈ 1.0).
Sourcepub fn apply_kernel<F>(&mut self, f: F)where
F: Fn(&mut TensorTile),
pub fn apply_kernel<F>(&mut self, f: F)where
F: Fn(&mut TensorTile),
Apply a function to every tile in the tiling.
Sourcepub fn constraint_check(&self) -> f32
pub fn constraint_check(&self) -> f32
Constraint check: sum of L1 border mismatches between adjacent tiles.
For each pair of adjacent tiles, compare the last row/first row (or last col/first col depending on orientation). The mismatch is the L1 distance between these border vectors.
Trait Implementations§
Source§impl Clone for TensorTiling
impl Clone for TensorTiling
Source§fn clone(&self) -> TensorTiling
fn clone(&self) -> TensorTiling
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TensorTiling
impl RefUnwindSafe for TensorTiling
impl Send for TensorTiling
impl Sync for TensorTiling
impl Unpin for TensorTiling
impl UnsafeUnpin for TensorTiling
impl UnwindSafe for TensorTiling
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