pub struct RephasingManager { /* private fields */ }Expand description
Rephasing manager
Manages periodic rephasing of variable polarities to help escape local minima and improve overall solver performance.
Implementations§
Source§impl RephasingManager
impl RephasingManager
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new rephasing manager with default settings
Default settings:
- Initial interval: 1000 conflicts
- Multiplier: 1.1 (geometric increase)
- Max interval: 1_000_000 conflicts
Sourcepub fn with_interval(initial: u64, multiplier: f64, max: u64) -> Self
pub fn with_interval(initial: u64, multiplier: f64, max: u64) -> Self
Create with custom interval settings
Sourcepub fn stats(&self) -> &RephasingStats
pub fn stats(&self) -> &RephasingStats
Get statistics
Sourcepub fn should_rephase(&self, conflicts: u64) -> bool
pub fn should_rephase(&self, conflicts: u64) -> bool
Check if rephasing should occur at this conflict count
Sourcepub fn update_best_assignment(&mut self, assignment: &[bool])
pub fn update_best_assignment(&mut self, assignment: &[bool])
Update best assignment for Best strategy
Sourcepub fn rephase(
&mut self,
strategy: RephasingStrategy,
num_vars: usize,
current_phases: &[bool],
conflicts: u64,
) -> Vec<bool>
pub fn rephase( &mut self, strategy: RephasingStrategy, num_vars: usize, current_phases: &[bool], conflicts: u64, ) -> Vec<bool>
Perform rephasing with the given strategy
Returns new phase values for all variables
Sourcepub fn next_strategy(&self) -> RephasingStrategy
pub fn next_strategy(&self) -> RephasingStrategy
Get the next recommended rephasing strategy
Uses a cyclic pattern: Original -> Inverted -> Random -> False -> Best
Trait Implementations§
Source§impl Debug for RephasingManager
impl Debug for RephasingManager
Auto Trait Implementations§
impl Freeze for RephasingManager
impl RefUnwindSafe for RephasingManager
impl Send for RephasingManager
impl Sync for RephasingManager
impl Unpin for RephasingManager
impl UnsafeUnpin for RephasingManager
impl UnwindSafe for RephasingManager
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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