pub struct Polynom<C: Coef> { /* private fields */ }Expand description
Represents a polynomial. Contains additional data structures to allow for fast variable substitution.
Implementations§
Source§impl<C: Coef> Polynom<C>
impl<C: Coef> Polynom<C>
pub fn new(m: Mod) -> Self
pub fn with_max_mod() -> Self
pub fn from_monoms(m: Mod, monoms: impl Iterator<Item = (C, Term)>) -> Self
pub fn size(&self) -> usize
pub fn is_zero(&self) -> bool
pub fn get_mod(&self) -> Mod
Sourcepub fn change_mod(&mut self, new_m: Mod)
pub fn change_mod(&mut self, new_m: Mod)
Currently only allows for increating the mod coefficient!
pub fn sorted_monom_vec(&self) -> Vec<(C, Term)>
pub fn replace_var(&mut self, target: VarIndex, mons: &[(C, Term)])
Source§impl<C: Coef> Polynom<C>
Routines to replace specific gate types
impl<C: Coef> Polynom<C>
Routines to replace specific gate types
pub fn replace_and(&mut self, out: VarIndex, a: VarIndex, b: VarIndex)
pub fn replace_or(&mut self, out: VarIndex, a: VarIndex, b: VarIndex)
pub fn replace_xor(&mut self, out: VarIndex, a: VarIndex, b: VarIndex)
pub fn replace_not(&mut self, out: VarIndex, a: VarIndex)
pub fn replace_identity(&mut self, out: VarIndex, a: VarIndex)
pub fn replace_true(&mut self, out: VarIndex)
pub fn replace_false(&mut self, out: VarIndex)
Trait Implementations§
Source§impl<C: Coef> From<PhaseOptPolynom<C>> for Polynom<C>
impl<C: Coef> From<PhaseOptPolynom<C>> for Polynom<C>
Source§fn from(value: PhaseOptPolynom<C>) -> Self
fn from(value: PhaseOptPolynom<C>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl<C> Freeze for Polynom<C>
impl<C> RefUnwindSafe for Polynom<C>where
C: RefUnwindSafe,
impl<C> Send for Polynom<C>where
C: Send,
impl<C> Sync for Polynom<C>where
C: Sync,
impl<C> Unpin for Polynom<C>where
C: Unpin,
impl<C> UnsafeUnpin for Polynom<C>
impl<C> UnwindSafe for Polynom<C>where
C: UnwindSafe,
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