pub struct Problem<T> { /* private fields */ }Expand description
A QUBO model built by a Builder, with its variable names and constraints.
Implementations§
Source§impl<T: Coefficient> Problem<T>
impl<T: Coefficient> Problem<T>
Sourcepub fn constraints(&self) -> &[Constraint<T>]
pub fn constraints(&self) -> &[Constraint<T>]
The constraints, in the order they were added.
Sourcepub fn violations<'a>(
&'a self,
x: &'a [bool],
) -> impl Iterator<Item = &'a Constraint<T>>
pub fn violations<'a>( &'a self, x: &'a [bool], ) -> impl Iterator<Item = &'a Constraint<T>>
The constraints that the assignment x does not satisfy, in the order they were added.
The check uses the original variables only, not the penalty energy or slack bits.
§Panics
Panics if x.len() is not the number of variables.
Trait Implementations§
impl<T: PartialEq> StructuralPartialEq for Problem<T>
Auto Trait Implementations§
impl<T> Forget for Problem<T>
impl<T> Freeze for Problem<T>
impl<T> Move for Problem<T>
impl<T> RefUnwindSafe for Problem<T>
impl<T> Send for Problem<T>
impl<T> Sync for Problem<T>
impl<T> Unpin for Problem<T>
impl<T> UnsafeUnpin for Problem<T>
impl<T> UnwindSafe for Problem<T>
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