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>
impl<Inner> AffineView<Inner>
pub fn new(inner: Inner, scale: i32, offset: i32) -> AffineView<Inner>
Trait Implementations§
Source§impl<Inner> Clone for AffineView<Inner>where
Inner: Clone,
impl<Inner> Clone for AffineView<Inner>where
Inner: Clone,
Source§fn clone(&self) -> AffineView<Inner>
fn clone(&self) -> AffineView<Inner>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Var> Debug for AffineView<Var>where
Var: Debug,
impl<Var> Debug for AffineView<Var>where
Var: Debug,
Source§impl<Inner> Hash for AffineView<Inner>where
Inner: Hash,
impl<Inner> Hash for AffineView<Inner>where
Inner: Hash,
Source§impl<View> IntegerVariable for AffineView<View>where
View: IntegerVariable,
impl<View> IntegerVariable for AffineView<View>where
View: IntegerVariable,
type AffineView = AffineView<View>
Source§fn lower_bound(&self, assignment: &Assignments) -> i32
fn lower_bound(&self, assignment: &Assignments) -> i32
Get the lower bound of the variable.
Source§fn lower_bound_at_trail_position(
&self,
assignment: &Assignments,
trail_position: usize,
) -> i32
fn lower_bound_at_trail_position( &self, assignment: &Assignments, trail_position: usize, ) -> i32
Get the lower bound of the variable at the given trail position.
Source§fn upper_bound(&self, assignment: &Assignments) -> i32
fn upper_bound(&self, assignment: &Assignments) -> i32
Get the upper bound of the variable.
Source§fn upper_bound_at_trail_position(
&self,
assignment: &Assignments,
trail_position: usize,
) -> i32
fn upper_bound_at_trail_position( &self, assignment: &Assignments, trail_position: usize, ) -> i32
Get the upper bound of the variable at the given trail position.
Source§fn contains(&self, assignment: &Assignments, value: i32) -> bool
fn contains(&self, assignment: &Assignments, value: i32) -> bool
Determine whether the value is in the domain of this variable.
Source§fn contains_at_trail_position(
&self,
assignment: &Assignments,
value: i32,
trail_position: usize,
) -> bool
fn contains_at_trail_position( &self, assignment: &Assignments, value: i32, trail_position: usize, ) -> bool
Determine whether the value is in the domain of this variable at the given trail position.
Source§fn iterate_domain(&self, assignment: &Assignments) -> impl Iterator<Item = i32>
fn iterate_domain(&self, assignment: &Assignments) -> impl Iterator<Item = i32>
Iterate over the values of the domain.
Source§fn watch_all(&self, watchers: &mut Watchers<'_>, events: EnumSet<DomainEvent>)
fn watch_all(&self, watchers: &mut Watchers<'_>, events: EnumSet<DomainEvent>)
Register a watch for this variable on the given domain events.
fn watch_all_backtrack( &self, watchers: &mut Watchers<'_>, events: EnumSet<DomainEvent>, )
Source§fn unpack_event(&self, event: OpaqueDomainEvent) -> DomainEvent
fn unpack_event(&self, event: OpaqueDomainEvent) -> DomainEvent
Decode a domain event for this variable.
Source§fn get_holes_on_current_decision_level(
&self,
assignments: &Assignments,
) -> impl Iterator<Item = i32>
fn get_holes_on_current_decision_level( &self, assignments: &Assignments, ) -> impl Iterator<Item = i32>
Returns all of the holes in the domain which were created at the current decision level
Source§impl<Inner> PartialEq for AffineView<Inner>where
Inner: PartialEq,
impl<Inner> PartialEq for AffineView<Inner>where
Inner: PartialEq,
Source§impl<Var> PredicateConstructor for AffineView<Var>where
Var: PredicateConstructor<Value = i32>,
impl<Var> PredicateConstructor for AffineView<Var>where
Var: PredicateConstructor<Value = i32>,
Source§type Value = <Var as PredicateConstructor>::Value
type Value = <Var as PredicateConstructor>::Value
The value used to represent a bound.
Source§fn lower_bound_predicate(
&self,
bound: <AffineView<Var> as PredicateConstructor>::Value,
) -> Predicate
fn lower_bound_predicate( &self, bound: <AffineView<Var> as PredicateConstructor>::Value, ) -> Predicate
Creates a lower-bound predicate (e.g.
[x >= v]).Source§fn upper_bound_predicate(
&self,
bound: <AffineView<Var> as PredicateConstructor>::Value,
) -> Predicate
fn upper_bound_predicate( &self, bound: <AffineView<Var> as PredicateConstructor>::Value, ) -> Predicate
Creates an upper-bound predicate (e.g.
[x <= v]).Source§fn equality_predicate(
&self,
bound: <AffineView<Var> as PredicateConstructor>::Value,
) -> Predicate
fn equality_predicate( &self, bound: <AffineView<Var> as PredicateConstructor>::Value, ) -> Predicate
Creates an equality predicate (e.g.
[x == v]).Source§fn disequality_predicate(
&self,
bound: <AffineView<Var> as PredicateConstructor>::Value,
) -> Predicate
fn disequality_predicate( &self, bound: <AffineView<Var> as PredicateConstructor>::Value, ) -> Predicate
Creates a disequality predicate (e.g.
[x != v]).Source§impl TransformableVariable<AffineView<DomainId>> for DomainId
impl TransformableVariable<AffineView<DomainId>> for DomainId
Source§impl TransformableVariable<AffineView<Literal>> for Literal
impl TransformableVariable<AffineView<Literal>> for Literal
Source§impl<View> TransformableVariable<AffineView<View>> for AffineView<View>where
View: IntegerVariable,
impl<View> TransformableVariable<AffineView<View>> for AffineView<View>where
View: IntegerVariable,
impl<Inner> Copy for AffineView<Inner>where
Inner: Copy,
impl<Inner> Eq for AffineView<Inner>where
Inner: Eq,
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> 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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