pub type PrimalModuleSerialPtr = ArcManualSafeLock<PrimalModuleSerial>;Aliased Type§
pub struct PrimalModuleSerialPtr { /* private fields */ }Implementations§
Source§impl PrimalModuleSerialPtr
impl PrimalModuleSerialPtr
pub fn get_primal_node_internal_ptr_option( &self, dual_node_ptr: &DualNodePtr, ) -> Option<PrimalNodeInternalPtr>
pub fn get_primal_node_internal_ptr( &self, dual_node_ptr: &DualNodePtr, ) -> PrimalNodeInternalPtr
Sourcepub fn get_outer_node(
&self,
primal_node_internal_ptr: PrimalNodeInternalPtr,
) -> PrimalNodeInternalPtr
pub fn get_outer_node( &self, primal_node_internal_ptr: PrimalNodeInternalPtr, ) -> PrimalNodeInternalPtr
get the outer node in the most up-to-date cache
Sourcepub fn find_lowest_common_ancestor(
&self,
primal_node_internal_ptr_1: PrimalNodeInternalPtr,
primal_node_internal_ptr_2: PrimalNodeInternalPtr,
) -> (PrimalNodeInternalPtr, Vec<PrimalNodeInternalPtr>, Vec<PrimalNodeInternalPtr>)
pub fn find_lowest_common_ancestor( &self, primal_node_internal_ptr_1: PrimalNodeInternalPtr, primal_node_internal_ptr_2: PrimalNodeInternalPtr, ) -> (PrimalNodeInternalPtr, Vec<PrimalNodeInternalPtr>, Vec<PrimalNodeInternalPtr>)
find the lowest common ancestor (LCA) of two nodes in the alternating tree, return (LCA, path_1, path_2) where path includes leaf but exclude the LCA
Sourcepub fn match_subtree<D: DualModuleImpl>(
tree_node_internal_ptr: PrimalNodeInternalPtr,
interface_ptr: &DualModuleInterfacePtr,
dual_module: &mut D,
)
pub fn match_subtree<D: DualModuleImpl>( tree_node_internal_ptr: PrimalNodeInternalPtr, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )
for any - node, match the children by matching them with + node
Sourcepub fn augment_tree_given_matched<D: DualModuleImpl>(
tree_node_internal_ptr: PrimalNodeInternalPtr,
match_node_internal_ptr: PrimalNodeInternalPtr,
tree_touching_ptr: DualNodeWeak,
interface_ptr: &DualModuleInterfacePtr,
dual_module: &mut D,
)
pub fn augment_tree_given_matched<D: DualModuleImpl>( tree_node_internal_ptr: PrimalNodeInternalPtr, match_node_internal_ptr: PrimalNodeInternalPtr, tree_touching_ptr: DualNodeWeak, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )
for any + node, match it with another node will augment the whole tree, breaking out into several matched pairs;
tree_grandson_ptr is the grandson of tree_node_internal_ptr that touches match_node_internal_ptr
Sourcepub fn augment_tree_given_virtual_vertex<D: DualModuleImpl>(
&self,
tree_node_internal_ptr: PrimalNodeInternalPtr,
virtual_vertex_index: VertexIndex,
tree_touching_ptr: DualNodeWeak,
interface_ptr: &DualModuleInterfacePtr,
dual_module: &mut D,
)
pub fn augment_tree_given_virtual_vertex<D: DualModuleImpl>( &self, tree_node_internal_ptr: PrimalNodeInternalPtr, virtual_vertex_index: VertexIndex, tree_touching_ptr: DualNodeWeak, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )
for any + node, match it with virtual boundary will augment the whole tree, breaking out into several matched pairs
Sourcepub fn flatten_nodes(
&self,
flattened_nodes: &mut Vec<Option<PrimalNodeInternalPtr>>,
)
pub fn flatten_nodes( &self, flattened_nodes: &mut Vec<Option<PrimalNodeInternalPtr>>, )
DFS flatten the nodes
Sourcepub fn slow_fuse(&self, left: &Self, right: &Self)
pub fn slow_fuse(&self, left: &Self, right: &Self)
fuse two modules by copying the nodes in other into myself
Sourcepub fn fuse(&self, left: &Self, right: &Self)
pub fn fuse(&self, left: &Self, right: &Self)
fuse two modules by (virtually) copying the nodes in other into myself, with O(1) time complexity
Sourcepub fn sanity_check(&self) -> Result<Vec<Option<PrimalNodeInternalPtr>>, String>
pub fn sanity_check(&self) -> Result<Vec<Option<PrimalNodeInternalPtr>>, String>
do a sanity check of it’s tree structure and internal state
Sourcepub fn collapse_tree<D: DualModuleImpl>(
&self,
primal_node_internal_ptr: PrimalNodeInternalPtr,
interface_ptr: &DualModuleInterfacePtr,
dual_module: &mut D,
)
pub fn collapse_tree<D: DualModuleImpl>( &self, primal_node_internal_ptr: PrimalNodeInternalPtr, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )
collapse a tree into a single blossom, just like what union-find decoder does. No MWPM guarantee once this is called.