pub struct Equality { /* private fields */ }
Implementations§
Source§impl Equality
impl Equality
Sourcepub fn new(eqn: LinExpr) -> Self
pub fn new(eqn: LinExpr) -> Self
Allocate a new Equality constraint.
§Examples
let mut magic_square = puzzle_solver::Puzzle::new();
let vars = magic_square.new_vars_with_candidates_2d(3, 3,
&[1,2,3,4,5,6,7,8,9]);
puzzle_solver::constraint::Equality::new(
vars[0][0] + vars[0][1] + vars[0][2] - 15);
Trait Implementations§
Source§impl Constraint for Equality
impl Constraint for Equality
Source§fn vars<'a>(&'a self) -> Box<dyn Iterator<Item = &'a VarToken> + 'a>
fn vars<'a>(&'a self) -> Box<dyn Iterator<Item = &'a VarToken> + 'a>
An iterator over the variables that are involved in the constraint.
Source§fn on_assigned(
&self,
search: &mut PuzzleSearch<'_>,
_: VarToken,
_: Val,
) -> PsResult<()>
fn on_assigned( &self, search: &mut PuzzleSearch<'_>, _: VarToken, _: Val, ) -> PsResult<()>
Applied after a variable has been assigned.
Source§fn on_updated(&self, search: &mut PuzzleSearch<'_>) -> PsResult<()>
fn on_updated(&self, search: &mut PuzzleSearch<'_>) -> PsResult<()>
Applied after a variable’s candidates has been modified.
Source§fn substitute(
&self,
from: VarToken,
to: VarToken,
) -> PsResult<Rc<dyn Constraint>>
fn substitute( &self, from: VarToken, to: VarToken, ) -> PsResult<Rc<dyn Constraint>>
Substitute the “from” variable with the “to” variable. Read more
Auto Trait Implementations§
impl Freeze for Equality
impl RefUnwindSafe for Equality
impl Send for Equality
impl Sync for Equality
impl Unpin for Equality
impl UnwindSafe for Equality
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