pub struct IntegerDomain;Expand description
The integer domain.
§Example
use ocas_domain::{Domain, Integer, IntegerDomain};
let domain = IntegerDomain;
let a = Integer::from(3);
let b = Integer::from(5);
assert_eq!(domain.add(&a, &b), Integer::from(8));Trait Implementations§
Source§impl Clone for IntegerDomain
impl Clone for IntegerDomain
Source§fn clone(&self) -> IntegerDomain
fn clone(&self) -> IntegerDomain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for IntegerDomain
Source§impl Debug for IntegerDomain
impl Debug for IntegerDomain
Source§impl Domain for IntegerDomain
Available on non-crate feature gmp only.
impl Domain for IntegerDomain
Available on non-crate feature
gmp only.Source§fn inv(&self, a: &Self::Element) -> Option<Self::Element>
fn inv(&self, a: &Self::Element) -> Option<Self::Element>
Return the multiplicative inverse of
a. Read moreSource§fn is_zero(&self, a: &Self::Element) -> bool
fn is_zero(&self, a: &Self::Element) -> bool
Test whether an element is the additive identity.
Source§fn is_one(&self, a: &Self::Element) -> bool
fn is_one(&self, a: &Self::Element) -> bool
Test whether an element is the multiplicative identity.
Source§fn mul_assign(&self, a: &mut Self::Element, b: &Self::Element)
fn mul_assign(&self, a: &mut Self::Element, b: &Self::Element)
In-place multiply:
*a *= b. Read moreSource§fn sub_mul_assign(
&self,
a: &mut Self::Element,
b: &Self::Element,
c: &Self::Element,
)
fn sub_mul_assign( &self, a: &mut Self::Element, b: &Self::Element, c: &Self::Element, )
Fused subtract-multiply:
*a -= b * c. Read moreimpl Eq for IntegerDomain
Source§impl EuclideanDomain for IntegerDomain
Available on non-crate feature gmp only.
impl EuclideanDomain for IntegerDomain
Available on non-crate feature
gmp only.Source§impl PartialEq for IntegerDomain
impl PartialEq for IntegerDomain
impl StructuralPartialEq for IntegerDomain
Auto Trait Implementations§
impl Freeze for IntegerDomain
impl RefUnwindSafe for IntegerDomain
impl Send for IntegerDomain
impl Sync for IntegerDomain
impl Unpin for IntegerDomain
impl UnsafeUnpin for IntegerDomain
impl UnwindSafe for IntegerDomain
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