pub struct GroupIntersection { /* private fields */ }Expand description
A value that group A must use, and can only take inside its overlap with group B, is
used by that overlap, so the rest of B cannot take it.
Sudoku players call this locked candidates: pointing (a block’s candidates for a digit
lie in one row) and claiming or box/line reduction (a row’s candidates lie in one
block). The default name is “group intersection”; GroupIntersection::with_name sets a
domain’s own term. It applies to any pair of all-different
groups that share at least two variables, such as irregular regions or extra diagonals.
Like ValueSubset, it only reasons from groups whose values must
all be used.
Implementations§
Source§impl GroupIntersection
impl GroupIntersection
Sourcepub fn new<G: IntoIterator<Item = Var>>(
cost: u32,
groups: impl IntoIterator<Item = G>,
) -> Self
pub fn new<G: IntoIterator<Item = Var>>( cost: u32, groups: impl IntoIterator<Item = G>, ) -> Self
The intersection rule over groups, costing cost.
Trait Implementations§
Source§impl Clone for GroupIntersection
impl Clone for GroupIntersection
Source§impl Debug for GroupIntersection
impl Debug for GroupIntersection
impl Eq for GroupIntersection
Source§impl PartialEq for GroupIntersection
impl PartialEq for GroupIntersection
Source§impl<D: Domain> Rule<D> for GroupIntersection
impl<D: Domain> Rule<D> for GroupIntersection
Source§fn cost(&self) -> u32
fn cost(&self) -> u32
How hard the technique is to apply; rules run cheapest first. The scale is the
caller’s: grading reports the highest cost a solve needed.
Source§fn apply(&self, domains: &mut Domains<D>) -> Result<(), Inconsistent>
fn apply(&self, domains: &mut Domains<D>) -> Result<(), Inconsistent>
Applies the technique wherever it finds it, removing values from
domains. Read moreSource§fn assumes_unique(&self) -> bool
fn assumes_unique(&self) -> bool
Returns
true if the rule is sound only for puzzles with exactly one solution, such as
Sudoku’s unique rectangle. Rules skips these unless asked to assume uniqueness.impl StructuralPartialEq for GroupIntersection
Auto Trait Implementations§
impl Forget for GroupIntersection
impl Freeze for GroupIntersection
impl Move for GroupIntersection
impl RefUnwindSafe for GroupIntersection
impl Send for GroupIntersection
impl Sync for GroupIntersection
impl Unpin for GroupIntersection
impl UnsafeUnpin for GroupIntersection
impl UnwindSafe for GroupIntersection
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