pub struct LayoutState {
pub pos: Vec<[f32; 2]>,
pub vel: Vec<[f32; 2]>,
}Expand description
The mutable layout state: one position + velocity per node (the ping-pong the GPU iterates in VRAM; here, the CPU mirror). Positions are the DATA a test reads.
Fields§
§pos: Vec<[f32; 2]>§vel: Vec<[f32; 2]>Implementations§
Source§impl LayoutState
impl LayoutState
Sourcepub fn seed(n: usize, scale: f32) -> Self
pub fn seed(n: usize, scale: f32) -> Self
The deterministic seed: a golden-angle (sunflower) spiral of radius scale,
zero velocity. No RNG ⇒ the whole sim is reproducible (FC-7).
Sourcepub fn kinetic_energy(&self) -> f32
pub fn kinetic_energy(&self) -> f32
Total kinetic energy Σ |vᵢ|² — the convergence metric: a settling layout’s
energy decays toward zero (read it as DATA to prove it converged).
Sourcepub fn total_edge_len(&self, g: &GraphCsr) -> f32
pub fn total_edge_len(&self, g: &GraphCsr) -> f32
Total edge length over g — the layout-quality metric the FDEB / structure
tests read (connected nodes pulled together shrink this).
Trait Implementations§
Source§impl Clone for LayoutState
impl Clone for LayoutState
Source§fn clone(&self) -> LayoutState
fn clone(&self) -> LayoutState
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 moreSource§impl Debug for LayoutState
impl Debug for LayoutState
Source§impl PartialEq for LayoutState
impl PartialEq for LayoutState
impl StructuralPartialEq for LayoutState
Auto Trait Implementations§
impl Freeze for LayoutState
impl RefUnwindSafe for LayoutState
impl Send for LayoutState
impl Sync for LayoutState
impl Unpin for LayoutState
impl UnsafeUnpin for LayoutState
impl UnwindSafe for LayoutState
Blanket Implementations§
impl<T> Allocation for T
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