pumpkin_solver::variables

Struct AffineView

source
pub struct AffineView<Inner> { /* private fields */ }
Expand description

Models the constraint y = ax + b, by expressing the domain of y as a transformation of the domain of x.

Implementations§

source§

impl<Inner> AffineView<Inner>

source

pub fn new(inner: Inner, scale: i32, offset: i32) -> Self

Trait Implementations§

source§

impl<Inner: Clone> Clone for AffineView<Inner>

source§

fn clone(&self) -> AffineView<Inner>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Var: Debug> Debug for AffineView<Var>

source§

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

Formats the value using the given formatter. Read more
source§

impl From<DomainId> for AffineView<DomainId>

source§

fn from(value: DomainId) -> Self

Converts to this type from the input type.
source§

impl<Inner: Hash> Hash for AffineView<Inner>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<View> IntegerVariable for AffineView<View>
where View: IntegerVariable,

source§

type AffineView = AffineView<View>

source§

fn lower_bound(&self, assignment: &AssignmentsInteger) -> i32

Get the lower bound of the variable.
source§

fn upper_bound(&self, assignment: &AssignmentsInteger) -> i32

Get the upper bound of the variable.
source§

fn contains(&self, assignment: &AssignmentsInteger, value: i32) -> bool

Determine whether the value is in the domain of this variable.
source§

fn describe_domain(&self, assignment: &AssignmentsInteger) -> Vec<Predicate>

Get a predicate description (bounds + holes) of the domain of this variable. N.B. can be very expensive with large domains, and very large with holey domains Read more
source§

fn remove( &self, assignment: &mut AssignmentsInteger, value: i32, reason: Option<ReasonRef>, ) -> Result<(), EmptyDomain>

Remove a value from the domain of this variable.
source§

fn set_lower_bound( &self, assignment: &mut AssignmentsInteger, value: i32, reason: Option<ReasonRef>, ) -> Result<(), EmptyDomain>

Tighten the lower bound of the domain of this variable.
source§

fn set_upper_bound( &self, assignment: &mut AssignmentsInteger, value: i32, reason: Option<ReasonRef>, ) -> Result<(), EmptyDomain>

Tighten the upper bound of the domain of this variable.
source§

fn watch_all( &self, watchers: &mut Watchers<'_>, events: EnumSet<IntDomainEvent>, )

Register a watch for this variable on the given domain events.
source§

fn watch_all_backtrack( &self, watchers: &mut Watchers<'_>, events: EnumSet<IntDomainEvent>, )

source§

fn unpack_event(&self, event: OpaqueDomainEvent) -> IntDomainEvent

Decode a domain event for this variable.
source§

impl<Inner: PartialEq> PartialEq for AffineView<Inner>

source§

fn eq(&self, other: &AffineView<Inner>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Var: PredicateConstructor<Value = i32>> PredicateConstructor for AffineView<Var>

source§

type Value = <Var as PredicateConstructor>::Value

The value used to represent a bound.
source§

fn lower_bound_predicate(&self, bound: Self::Value) -> Predicate

Creates a lower-bound predicate (e.g. [x >= v]).
source§

fn upper_bound_predicate(&self, bound: Self::Value) -> Predicate

Creates an upper-bound predicate (e.g. [x <= v]).
source§

fn equality_predicate(&self, bound: Self::Value) -> Predicate

Creates an equality predicate (e.g. [x == v]).
source§

fn disequality_predicate(&self, bound: Self::Value) -> Predicate

Creates a disequality predicate (e.g. [x != v]).
source§

impl TransformableVariable<AffineView<DomainId>> for DomainId

source§

fn scaled(&self, scale: i32) -> AffineView<DomainId>

Get a variable which domain is scaled compared to the domain of self. Read more
source§

fn offset(&self, offset: i32) -> AffineView<DomainId>

Get a variable which domain has a constant offset to the domain of self.
source§

impl<View> TransformableVariable<AffineView<View>> for AffineView<View>
where View: IntegerVariable,

source§

fn scaled(&self, scale: i32) -> AffineView<View>

Get a variable which domain is scaled compared to the domain of self. Read more
source§

fn offset(&self, offset: i32) -> AffineView<View>

Get a variable which domain has a constant offset to the domain of self.
source§

impl<Inner: Copy> Copy for AffineView<Inner>

source§

impl<Inner: Eq> Eq for AffineView<Inner>

source§

impl<Inner> StructuralPartialEq for AffineView<Inner>

Auto Trait Implementations§

§

impl<Inner> Freeze for AffineView<Inner>
where Inner: Freeze,

§

impl<Inner> RefUnwindSafe for AffineView<Inner>
where Inner: RefUnwindSafe,

§

impl<Inner> Send for AffineView<Inner>
where Inner: Send,

§

impl<Inner> Sync for AffineView<Inner>
where Inner: Sync,

§

impl<Inner> Unpin for AffineView<Inner>
where Inner: Unpin,

§

impl<Inner> UnwindSafe for AffineView<Inner>
where Inner: 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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V