PrimalModuleImpl

Trait PrimalModuleImpl 

Source
pub trait PrimalModuleImpl {
Show 13 methods // Required methods fn new_empty(solver_initializer: &SolverInitializer) -> Self; fn clear(&mut self); fn load_defect_dual_node(&mut self, dual_node_ptr: &DualNodePtr); fn resolve<D: DualModuleImpl>( &mut self, group_max_update_length: GroupMaxUpdateLength, interface: &DualModuleInterfacePtr, dual_module: &mut D, ); fn intermediate_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> IntermediateMatching; // Provided methods fn load_defect<D: DualModuleImpl>( &mut self, defect_vertex: VertexIndex, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, ) { ... } fn load(&mut self, interface_ptr: &DualModuleInterfacePtr) { ... } fn perfect_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> PerfectMatching { ... } fn solve<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, ) { ... } fn solve_visualizer<D: DualModuleImpl + FusionVisualizer>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, visualizer: Option<&mut Visualizer>, ) where Self: FusionVisualizer + Sized { ... } fn solve_step_callback<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, callback: F, ) where F: FnMut(&DualModuleInterfacePtr, &mut D, &mut Self, &GroupMaxUpdateLength) { ... } fn solve_step_callback_interface_loaded<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, callback: F, ) where F: FnMut(&DualModuleInterfacePtr, &mut D, &mut Self, &GroupMaxUpdateLength) { ... } fn generate_profiler_report(&self) -> Value { ... }
}
Expand description

common trait that must be implemented for each implementation of primal module

Required Methods§

Source

fn new_empty(solver_initializer: &SolverInitializer) -> Self

create a primal module given the dual module

Source

fn clear(&mut self)

clear all states; however this method is not necessarily called when load a new decoding problem, so you need to call it yourself

Source

fn load_defect_dual_node(&mut self, dual_node_ptr: &DualNodePtr)

Source

fn resolve<D: DualModuleImpl>( &mut self, group_max_update_length: GroupMaxUpdateLength, interface: &DualModuleInterfacePtr, dual_module: &mut D, )

analyze the reason why dual module cannot further grow, update primal data structure (alternating tree, temporary matches, etc) and then tell dual module what to do to resolve these conflicts; note that this function doesn’t necessarily resolve all the conflicts, but can return early if some major change is made. when implementing this function, it’s recommended that you resolve as many conflicts as possible.

Source

fn intermediate_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> IntermediateMatching

return a matching that can possibly include blossom nodes: this does not affect dual module

Provided Methods§

Source

fn load_defect<D: DualModuleImpl>( &mut self, defect_vertex: VertexIndex, interface_ptr: &DualModuleInterfacePtr, dual_module: &mut D, )

load a single syndrome and update the dual module and the interface

Source

fn load(&mut self, interface_ptr: &DualModuleInterfacePtr)

load a new decoding problem given dual interface: note that all nodes MUST be syndrome node

Source

fn perfect_matching<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, ) -> PerfectMatching

break down the blossoms to find the final matching; this function will take more time on the dual module

Source

fn solve<D: DualModuleImpl>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, )

Source

fn solve_visualizer<D: DualModuleImpl + FusionVisualizer>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, visualizer: Option<&mut Visualizer>, )
where Self: FusionVisualizer + Sized,

Source

fn solve_step_callback<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, syndrome_pattern: &SyndromePattern, dual_module: &mut D, callback: F, )

Source

fn solve_step_callback_interface_loaded<D: DualModuleImpl, F>( &mut self, interface: &DualModuleInterfacePtr, dual_module: &mut D, callback: F, )

Source

fn generate_profiler_report(&self) -> Value

performance profiler report

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§