pub struct PrimalModuleSerial {
pub unit_index: usize,
pub nodes: Vec<Option<PrimalNodeInternalPtr>>,
pub nodes_length: usize,
pub is_fusion: bool,
pub possible_break: Vec<NodeIndex>,
pub debug_resolve_only_one: bool,
pub parent: Option<PrimalModuleSerialWeak>,
pub index_bias: NodeIndex,
pub children: Option<((PrimalModuleSerialWeak, NodeNum), (PrimalModuleSerialWeak, NodeNum))>,
pub max_tree_size: usize,
}Fields§
§unit_index: usizeunit index of this interface, default to 0
nodes: Vec<Option<PrimalNodeInternalPtr>>nodes internal information
nodes_length: usizecurrent nodes length, to enable constant-time clear operation
is_fusion: boolallow pointer reuse will reduce the time of reallocation, but it’s unsafe if not owning it
possible_break: Vec<NodeIndex>the indices of primal nodes that is possibly matched to the mirrored vertex, and need to break when mirrored vertices are no longer mirrored
debug_resolve_only_one: booldebug mode: only resolve one conflict each time
parent: Option<PrimalModuleSerialWeak>the parent of this serial module, when fused
index_bias: NodeIndexwhen fused, this will indicate the relative bias given by the parent
children: Option<((PrimalModuleSerialWeak, NodeNum), (PrimalModuleSerialWeak, NodeNum))>the two children of this serial module, when fused; following the length of this child, given that fused children serial modules will not have new nodes anymore
max_tree_size: usizethe maximum number of children in a tree before it collapses to a union-find decoder
Implementations§
Source§impl PrimalModuleSerial
impl PrimalModuleSerial
Sourcepub fn nodes_count(&self) -> NodeNum
pub fn nodes_count(&self) -> NodeNum
return the count of all nodes including those of the children interfaces
Sourcepub fn get_node(
&self,
relative_node_index: NodeIndex,
) -> Option<PrimalNodeInternalPtr>
pub fn get_node( &self, relative_node_index: NodeIndex, ) -> Option<PrimalNodeInternalPtr>
get node ptr by index; if calling from the ancestor module, node_index is absolute, otherwise it’s relative
Sourcepub fn remove_node(&mut self, relative_node_index: NodeIndex)
pub fn remove_node(&mut self, relative_node_index: NodeIndex)
set the corresponding node index to None
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrimalModuleSerial
impl !RefUnwindSafe for PrimalModuleSerial
impl Send for PrimalModuleSerial
impl Sync for PrimalModuleSerial
impl Unpin for PrimalModuleSerial
impl !UnwindSafe for PrimalModuleSerial
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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>
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>
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