Enum satoxid::Lit [−][src]
pub enum Lit<V> { Pos(V), Neg(V), }
Expand description
Enum to define the polarity of variables.
By itself Lit
is a constraint, which requires that the variable it wraps is true
or false depending on the Variant Pos
and Neg
.
Example
encoder.add_constraint(Lit::Pos("a")); encoder.add_constraint(Lit::Neg("b")); let model = encoder.solve().unwrap(); assert!(model["a"]); assert!(!model["b"]);
Variants
Implementations
Trait Implementations
impl<V: Ord> Ord for Lit<V>
[src]
impl<V: Ord> Ord for Lit<V>
[src]impl<V: PartialOrd> PartialOrd<Lit<V>> for Lit<V>
[src]
impl<V: PartialOrd> PartialOrd<Lit<V>> for Lit<V>
[src]fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl<V: Copy> Copy for Lit<V>
[src]
impl<V: Eq> Eq for Lit<V>
[src]
impl<V> StructuralEq for Lit<V>
[src]
impl<V> StructuralPartialEq for Lit<V>
[src]
Auto Trait Implementations
impl<V> RefUnwindSafe for Lit<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<V> Send for Lit<V> where
V: Send,
V: Send,
impl<V> Sync for Lit<V> where
V: Sync,
V: Sync,
impl<V> Unpin for Lit<V> where
V: Unpin,
V: Unpin,
impl<V> UnwindSafe for Lit<V> where
V: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, L> ConstraintRepr<V> for L where
V: SatVar,
L: Debug + Clone + Into<VarType<V>>,
[src]
impl<V, L> ConstraintRepr<V> for L where
V: SatVar,
L: Debug + Clone + Into<VarType<V>>,
[src]pub fn encode_constraint_implies_repr<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]
pub fn encode_constraint_implies_repr<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]Encode if Self
is satisified, that repr
is true.
Otherwise repr
is not constrained and can be true or false. Read more
pub fn encode_constraint_equals_repr<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]
pub fn encode_constraint_equals_repr<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]Encode if and only if Self
is satisified, that repr
is true.
pub fn encode_constraint_repr_cheap<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]
pub fn encode_constraint_repr_cheap<B>(
Self,
Option<i32>,
&mut B,
&mut VarMap<V>
) -> i32 where
B: Backend,
[src]Encode that repr is true if the constraint is satisfied.
The implementation can decide if it has the semantics of
encode_constraint_implies_repr
or encode_constraint_equals_repr
,
depending on what is cheaper to encode. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V> SatVar for V where
V: Hash + Eq + Clone + Debug,
[src]
V: Hash + Eq + Clone + Debug,