pub struct Graph {
pub nodes: Vec<Node>,
pub offsets: Vec<u32>,
pub edges: Vec<Edge>,
}Fields§
§nodes: Vec<Node>§offsets: Vec<u32>CSR: offsets[i]..offsets[i + 1] indexes into edges for node i. offsets.len() == nodes.len() + 1.
edges: Vec<Edge>Implementations§
Source§impl Graph
impl Graph
Sourcepub fn solve_cycle(&mut self) -> bool
pub fn solve_cycle(&mut self) -> bool
Exact weighted solution of a connected simple cycle with one anchor. A chain plus one root-to-last loop has this topology regardless of node/edge order. Reject other graphs and solutions outside Huber’s quadratic region (6px), leaving the general solver untouched.
Sourcepub fn pass(&mut self, reverse: bool) -> f64
pub fn pass(&mut self, reverse: bool) -> f64
One Gauss-Seidel sweep over every unpinned node with edges, mutating positions in place exactly as
optimize()’s per-node loop does: a neighbour update earlier in this same sweep is visible to a later one
in it (via self.nodes, not a snapshot). Returns the largest single-node displacement (maxChange).
Auto Trait Implementations§
impl Freeze for Graph
impl RefUnwindSafe for Graph
impl Send for Graph
impl Sync for Graph
impl Unpin for Graph
impl UnsafeUnpin for Graph
impl UnwindSafe for Graph
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> 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