pub struct Solver {
pub constraints: SudokuConstraints,
pub techniques: Vec<Rc<dyn Technique>>,
pub grid: Grid,
pub solution: Option<Grid>,
/* private fields */
}Fields§
§constraints: SudokuConstraints§techniques: Vec<Rc<dyn Technique>>§grid: Grid§solution: Option<Grid>Implementations§
Source§impl Solver
impl Solver
pub fn check_solved(&self) -> (bool, Option<InvalidStateReason>)
pub fn check_partially_solved(&self) -> (bool, Option<InvalidStateReason>)
Source§impl Solver
impl Solver
pub fn detect_invalid_sum_candidates( &self, cells: &Vec<CellPosition>, sum: u32, ) -> Vec<(CellPosition, Vec<u32>)>
Source§impl Solver
impl Solver
pub fn eliminate_combinations( &self, combinations: &Vec<Vec<u32>>, cells: &Vec<CellPosition>, ) -> CellEliminationsResult
Source§impl Solver
impl Solver
pub fn logical_solve(&mut self) -> SudokulogicalSolveResult
pub fn find_candidate_validity_update_steps(&self) -> Vec<SolutionStep>
pub fn find_grid_steps(&self) -> Vec<SolutionStep>
pub fn apply_rule( &mut self, step: &SolutionStep, ) -> (bool, Option<InvalidStateReason>)
pub fn apply_rules(&mut self, steps: &Vec<SolutionStep>)
pub fn cell_candidates_diff( &self, cells: &Vec<CellPosition>, valid_candidates: Vec<HashSet<u32>>, ) -> Vec<(CellPosition, Vec<u32>)>
Source§impl Solver
impl Solver
pub fn brute_solve(&mut self, use_logical: bool) -> SudokuBruteSolveResult
pub fn recursive_check( &mut self, solution_count: &mut u32, use_logical: bool, depth: u32, )
Source§impl Solver
impl Solver
pub fn new( constraints: SudokuConstraints, input_grid: Option<SudokuGrid>, ) -> Solver
pub fn with_hint_mode(self, flag: bool) -> Self
pub fn with_step_count_limit(self, step_count_limit: usize) -> Self
pub fn default_techniques() -> Vec<Rc<dyn Technique>>
pub fn with_techniques(self, techniques: Vec<Rc<dyn Technique>>) -> Self
pub fn without_techniques(self, techniques: Vec<Rc<dyn Technique>>) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Solver
impl !RefUnwindSafe for Solver
impl !Send for Solver
impl !Sync for Solver
impl Unpin for Solver
impl !UnwindSafe for Solver
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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