Skip to main content

AllDifferentExcept

Struct AllDifferentExcept 

Source
pub struct AllDifferentExcept<V: Clone + PartialEq + Debug> { /* private fields */ }
Expand description

All-different over the scope, except that the configured sentinel value may be assigned to any number of variables.

Non-sentinel assignments must remain pairwise distinct.

Implementations§

Source§

impl<V: Clone + PartialEq + Debug> AllDifferentExcept<V>

Source

pub fn new(vars: Vec<VarId>, sentinel: V) -> Self

Create a new all-different-except constraint over vars, treating sentinel as the escape value that may be reused without conflict.

Trait Implementations§

Source§

impl<D> Constraint<D> for AllDifferentExcept<D::Value>
where D: Domain, D::Value: PartialEq,

Source§

fn scope(&self) -> &[VarId]

The variables this constraint involves (its “scope”).
Source§

fn check(&self, assignment: &[Option<D::Value>]) -> bool

Check whether a full or partial assignment satisfies this constraint.
Source§

fn revise(&self, vars: &mut [Variable<D>], depth: usize) -> Revision

AC-3 style revision: prune unsupported values from domains.
Source§

impl<V: Debug + Clone + PartialEq + Debug> Debug for AllDifferentExcept<V>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<V> Freeze for AllDifferentExcept<V>
where V: Freeze,

§

impl<V> RefUnwindSafe for AllDifferentExcept<V>
where V: RefUnwindSafe,

§

impl<V> Send for AllDifferentExcept<V>
where V: Send,

§

impl<V> Sync for AllDifferentExcept<V>
where V: Sync,

§

impl<V> Unpin for AllDifferentExcept<V>
where V: Unpin,

§

impl<V> UnsafeUnpin for AllDifferentExcept<V>
where V: UnsafeUnpin,

§

impl<V> UnwindSafe for AllDifferentExcept<V>
where V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.