pub struct Factor { /* private fields */ }Expand description
A term contributing -weight * prod(s_v for v in vars) to the energy.
Implementations§
Source§impl Factor
impl Factor
Sourcepub fn new(vars: &[usize], weight: f64, n: usize) -> Result<Factor, FactorError>
pub fn new(vars: &[usize], weight: f64, n: usize) -> Result<Factor, FactorError>
Build a factor, rejecting everything that would make it silently not what was written.
pub fn vars(&self) -> impl Iterator<Item = usize> + '_
pub fn arity(&self) -> usize
pub fn weight(&self) -> f64
Trait Implementations§
impl StructuralPartialEq for Factor
Auto Trait Implementations§
impl Freeze for Factor
impl RefUnwindSafe for Factor
impl Send for Factor
impl Sync for Factor
impl Unpin for Factor
impl UnsafeUnpin for Factor
impl UnwindSafe for Factor
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