pub struct Builder { /* private fields */ }Expand description
A builder for samplers.
See Sampler::builder for more details.
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn variable_degree(&mut self, degree: usize) -> &mut Self
pub fn variable_degree(&mut self, degree: usize) -> &mut Self
Fixes the variable’s degree. Default is 0.
Sourcepub fn constraint_degree(&mut self, degree: usize) -> &mut Self
pub fn constraint_degree(&mut self, degree: usize) -> &mut Self
Fixes the constraint’s degree. Default is 0.
Sourcepub fn number_of_variables(&mut self, n: usize) -> &mut Self
pub fn number_of_variables(&mut self, n: usize) -> &mut Self
Fixes the number of variables. Default is 0.
Sourcepub fn number_of_constraints(&mut self, n: usize) -> &mut Self
pub fn number_of_constraints(&mut self, n: usize) -> &mut Self
Fixes the number of constraints. Default is 0.
Sourcepub fn build(&self) -> Result<Sampler, InvalidParameters>
pub fn build(&self) -> Result<Sampler, InvalidParameters>
Build a sampler or returns an error if the number of variables times their degree is not the same as the number of constraints times their degree.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
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