#[repr(C, align(8))]pub struct ShardEdge {
pub source: TileVertexId,
pub target: TileVertexId,
pub weight: FixedWeight,
pub flags: u16,
}Expand description
Compact edge in shard storage
Size: 8 bytes, cache-friendly for sequential iteration
Fields§
§source: TileVertexIdSource vertex (tile-local)
target: TileVertexIdTarget vertex (tile-local)
weight: FixedWeightEdge weight (fixed-point)
flags: u16Edge flags
Implementations§
Source§impl ShardEdge
impl ShardEdge
Sourcepub const FLAG_ACTIVE: u16 = 1u16
pub const FLAG_ACTIVE: u16 = 1u16
Edge is active
Sourcepub const FLAG_IN_CUT: u16 = 2u16
pub const FLAG_IN_CUT: u16 = 2u16
Edge is in current cut
Sourcepub const FLAG_GHOST: u16 = 8u16
pub const FLAG_GHOST: u16 = 8u16
Edge crosses tile boundary (ghost edge)
Sourcepub const fn new(
source: TileVertexId,
target: TileVertexId,
weight: FixedWeight,
) -> Self
pub const fn new( source: TileVertexId, target: TileVertexId, weight: FixedWeight, ) -> Self
Create a new active edge
Sourcepub const fn is_active(&self) -> bool
pub const fn is_active(&self) -> bool
Check if edge is active
OPTIMIZATION: #[inline(always)] - called in every iteration of edge loops
Sourcepub const fn is_in_cut(&self) -> bool
pub const fn is_in_cut(&self) -> bool
Check if edge is in cut
OPTIMIZATION: #[inline(always)] - called in mincut algorithms
Sourcepub fn deactivate(&mut self)
pub fn deactivate(&mut self)
Mark edge as inactive (deleted)
Sourcepub fn mark_in_cut(&mut self)
pub fn mark_in_cut(&mut self)
Mark edge as in cut
Trait Implementations§
impl Copy for ShardEdge
Auto Trait Implementations§
impl Freeze for ShardEdge
impl RefUnwindSafe for ShardEdge
impl Send for ShardEdge
impl Sync for ShardEdge
impl Unpin for ShardEdge
impl UnwindSafe for ShardEdge
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