pub struct VecAssignment { /* private fields */ }Expand description
An implementation of Assignment using a Vec<VarState>.
This implementation is efficient for dense sets of variables, where variable IDs
are contiguous and start from 0 (i.e. 0, 1, ..., n-1).
Indexing with a usize value greater than or equal to the number of variables
will result in a panic.
Trait Implementations§
Source§impl Assignment for VecAssignment
impl Assignment for VecAssignment
Source§fn new(n_vars: usize) -> Self
fn new(n_vars: usize) -> Self
Creates a new VecAssignment for n_vars variables.
Variables are indexed from 0 to n_vars - 1.
Source§fn num_vars(&self) -> usize
fn num_vars(&self) -> usize
Returns the total number of variables this assignment manager is configured for.
Source§fn get_solutions(&self) -> Solutions
fn get_solutions(&self) -> Solutions
Retrieves the current set of assigned variables as a
Solutions object. Read moreSource§fn all_assigned(&self) -> bool
fn all_assigned(&self) -> bool
Checks if all variables managed by this assignment are currently assigned. Read more
Source§fn assign(&mut self, l: impl Literal)
fn assign(&mut self, l: impl Literal)
Assigns a truth value to a variable based on a literal. Read more
Source§fn is_assigned(&self, var: Variable) -> bool
fn is_assigned(&self, var: Variable) -> bool
Checks if a specific variable is assigned a truth value. Read more
Source§fn var_value(&self, var: Variable) -> Option<bool>
fn var_value(&self, var: Variable) -> Option<bool>
Gets the truth value of a variable, if assigned. Read more
Source§impl Clone for VecAssignment
impl Clone for VecAssignment
Source§fn clone(&self) -> VecAssignment
fn clone(&self) -> VecAssignment
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 Debug for VecAssignment
impl Debug for VecAssignment
Source§impl Default for VecAssignment
impl Default for VecAssignment
Source§fn default() -> VecAssignment
fn default() -> VecAssignment
Returns the “default value” for a type. Read more
Source§impl Index<usize> for VecAssignment
impl Index<usize> for VecAssignment
Source§impl IndexMut<usize> for VecAssignment
impl IndexMut<usize> for VecAssignment
Source§impl PartialEq for VecAssignment
impl PartialEq for VecAssignment
impl Eq for VecAssignment
impl StructuralPartialEq for VecAssignment
Auto Trait Implementations§
impl Freeze for VecAssignment
impl RefUnwindSafe for VecAssignment
impl Send for VecAssignment
impl Sync for VecAssignment
impl Unpin for VecAssignment
impl UnwindSafe for VecAssignment
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> 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