Skip to main content

FF

Struct FF 

Source
pub struct FF<const p: i32>(/* private fields */);
Expand description

An element of ๐”ฝ_p, stored as a representative in 0 .. p.

Implementationsยง

Sourceยง

impl<const p: i32> FF<p>

Source

pub fn new(a: i32) -> Self

Source

pub fn rep(&self) -> &i32

Trait Implementationsยง

Sourceยง

impl<const p: i32> Add for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: FF<p>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<const p: i32> Add<&FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: &FF<p>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<const p: i32> Add<&FF<p>> for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: &FF<p>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<const p: i32> Add<FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the + operator.
Sourceยง

fn add(self, rhs: FF<p>) -> Self::Output

Performs the + operation. Read more
Sourceยง

impl<const p: i32> AddAssign for FF<p>

Sourceยง

fn add_assign(&mut self, rhs: FF<p>)

Performs the += operation. Read more
Sourceยง

impl<const p: i32> AddAssign<&FF<p>> for FF<p>

Sourceยง

fn add_assign(&mut self, rhs: &FF<p>)

Performs the += operation. Read more
Sourceยง

impl<const p: i32> AddGrp for FF<p>

Sourceยง

impl<const p: i32> AddGrpOps for FF<p>

Sourceยง

impl<const p: i32> AddGrpOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> AddMon for FF<p>

Sourceยง

fn sum<A, I>(itr: I) -> Self
where Self: AddAssign<A>, I: IntoIterator<Item = A>,

Sum an iterator into Self, folding with +=. Read more
Sourceยง

impl<const p: i32> AddMonOps for FF<p>

Sourceยง

impl<const p: i32> AddMonOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> Clone for FF<p>

Sourceยง

fn clone(&self) -> FF<p>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<const p: i32> Copy for FF<p>

Sourceยง

impl<const p: i32> Debug for FF<p>

Sourceยง

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<const p: i32> Default for FF<p>

Sourceยง

fn default() -> FF<p>

Returns the โ€œdefault valueโ€ for a type. Read more
Sourceยง

impl<const p: i32> Display for FF<p>

Sourceยง

fn fmt(&self, __derive_more_f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Sourceยง

impl<const p: i32> Div for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: FF<p>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<const p: i32> Div<&FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: &FF<p>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<const p: i32> Div<&FF<p>> for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: &FF<p>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<const p: i32> Div<FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the / operator.
Sourceยง

fn div(self, rhs: FF<p>) -> Self::Output

Performs the / operation. Read more
Sourceยง

impl<const p: i32> DivAssign for FF<p>

Sourceยง

fn div_assign(&mut self, rhs: FF<p>)

Performs the /= operation. Read more
Sourceยง

impl<const p: i32> DivAssign<&FF<p>> for FF<p>

Sourceยง

fn div_assign(&mut self, rhs: &FF<p>)

Performs the /= operation. Read more
Sourceยง

impl<const p: i32> Eq for FF<p>

Sourceยง

impl<const p: i32> EucRing for FF<p>

Sourceยง

fn divides(&self, y: &Self) -> bool

true iff self divides y (and self โ‰  0).
Sourceยง

fn gcd(x: &Self, y: &Self) -> Self

Greatest common divisor, returned in normalized form. Read more
Sourceยง

fn gcdx(x: &Self, y: &Self) -> (Self, Self, Self)

Extended gcd: returns (d, s, t) such that d = gcd(x, y) = sยทx + tยทy, with d normalized. Read more
Sourceยง

fn lcm(x: &Self, y: &Self) -> Self

Least common multiple, returned in normalized form.
Sourceยง

impl<const p: i32> EucRingOps for FF<p>

Sourceยง

impl<const p: i32> EucRingOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> Field for FF<p>

Sourceยง

impl<const p: i32> FieldOps for FF<p>

Sourceยง

impl<const p: i32> FieldOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> From<i32> for FF<p>

Sourceยง

fn from(a: i32) -> Self

Converts to this type from the input type.
Sourceยง

impl<const p: i32> FromStr for FF<p>

Sourceยง

type Err = ParseErr

The associated error which can be returned from parsing.
Sourceยง

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Sourceยง

impl<const p: i32> MathType for FF<p>

Sourceยง

impl<const p: i32> Mon for FF<p>

Sourceยง

fn product<A, I>(itr: I) -> Self
where Self: MulAssign<A>, I: IntoIterator<Item = A>,

Multiply an iterator of factors into Self, folding with *=. Read more
Sourceยง

impl<const p: i32> MonOps for FF<p>

Sourceยง

impl<const p: i32> MonOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> Mul for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: FF<p>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<const p: i32> Mul<&FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &FF<p>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<const p: i32> Mul<&FF<p>> for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: &FF<p>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<const p: i32> Mul<FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the * operator.
Sourceยง

fn mul(self, rhs: FF<p>) -> Self::Output

Performs the * operation. Read more
Sourceยง

impl<const p: i32> MulAssign for FF<p>

Sourceยง

fn mul_assign(&mut self, rhs: FF<p>)

Performs the *= operation. Read more
Sourceยง

impl<const p: i32> MulAssign<&FF<p>> for FF<p>

Sourceยง

fn mul_assign(&mut self, rhs: &FF<p>)

Performs the *= operation. Read more
Sourceยง

impl<const p: i32> Neg for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Sourceยง

impl<const p: i32> Neg for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Sourceยง

impl<const p: i32> One for FF<p>

Sourceยง

fn one() -> Self

Returns the multiplicative identity element of Self, 1. Read more
Sourceยง

fn is_one(&self) -> bool

Returns true if self is equal to the multiplicative identity. Read more
Sourceยง

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Sourceยง

impl<const p: i32> PartialEq for FF<p>

Sourceยง

fn eq(&self, other: &FF<p>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) ยท Sourceยง

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Sourceยง

impl<const p: i32> Rem for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the % operator.
Sourceยง

fn rem(self, rhs: FF<p>) -> Self::Output

Performs the % operation. Read more
Sourceยง

impl<const p: i32> Rem<&FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the % operator.
Sourceยง

fn rem(self, rhs: &FF<p>) -> Self::Output

Performs the % operation. Read more
Sourceยง

impl<const p: i32> Rem<&FF<p>> for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the % operator.
Sourceยง

fn rem(self, rhs: &FF<p>) -> Self::Output

Performs the % operation. Read more
Sourceยง

impl<const p: i32> Rem<FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the % operator.
Sourceยง

fn rem(self, rhs: FF<p>) -> Self::Output

Performs the % operation. Read more
Sourceยง

impl<const p: i32> RemAssign for FF<p>

Sourceยง

fn rem_assign(&mut self, rhs: FF<p>)

Performs the %= operation. Read more
Sourceยง

impl<const p: i32> RemAssign<&FF<p>> for FF<p>

Sourceยง

fn rem_assign(&mut self, rhs: &FF<p>)

Performs the %= operation. Read more
Sourceยง

impl<const p: i32> Ring for FF<p>

Sourceยง

fn inv(&self) -> Option<Self>

Multiplicative inverse, if this element is a unit; otherwise None.
Sourceยง

fn is_unit(&self) -> bool

true iff this element is a unit (has a multiplicative inverse). Read more
Sourceยง

fn normalizing_unit(&self) -> Self

A unit u such that self * u is the chosen canonical associate of self. Read more
Sourceยง

fn from_sign(s: Sign) -> Self

+1 if s is positive, -1 otherwise.
Sourceยง

fn normalized(&self) -> Self

The canonical associate of self (i.e. self * self.normalizing_unit()).
Sourceยง

fn into_normalized(self) -> Self

Like normalized, but consuming.
Sourceยง

fn is_pm_one(&self) -> bool

true iff self is +1 or -1.
Sourceยง

fn c_weight(&self) -> f64

Heuristic cost of working with this element, used by chain-reduction pivot selection. Default: 0.0 for zero, 1.0 otherwise.
Sourceยง

impl<const p: i32> RingOps for FF<p>

Sourceยง

impl<const p: i32> RingOps<FF<p>> for &FF<p>

Sourceยง

impl<const p: i32> StructuralPartialEq for FF<p>

Sourceยง

impl<const p: i32> Sub for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: FF<p>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<const p: i32> Sub<&FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: &FF<p>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<const p: i32> Sub<&FF<p>> for FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: &FF<p>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<const p: i32> Sub<FF<p>> for &FF<p>

Sourceยง

type Output = FF<p>

The resulting type after applying the - operator.
Sourceยง

fn sub(self, rhs: FF<p>) -> Self::Output

Performs the - operation. Read more
Sourceยง

impl<const p: i32> SubAssign for FF<p>

Sourceยง

fn sub_assign(&mut self, rhs: FF<p>)

Performs the -= operation. Read more
Sourceยง

impl<const p: i32> SubAssign<&FF<p>> for FF<p>

Sourceยง

fn sub_assign(&mut self, rhs: &FF<p>)

Performs the -= operation. Read more
Sourceยง

impl<const p: i32> TeX for FF<p>

Sourceยง

impl<const p: i32> Zero for FF<p>

Sourceยง

fn zero() -> Self

Returns the additive identity element of Self, 0. Read more
Sourceยง

fn is_zero(&self) -> bool

Returns true if self is equal to the additive identity.
Sourceยง

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.

Auto Trait Implementationsยง

ยง

impl<const p: i32> Freeze for FF<p>

ยง

impl<const p: i32> RefUnwindSafe for FF<p>

ยง

impl<const p: i32> Send for FF<p>

ยง

impl<const p: i32> Sync for FF<p>

ยง

impl<const p: i32> Unpin for FF<p>

ยง

impl<const p: i32> UnsafeUnpin for FF<p>

ยง

impl<const p: i32> UnwindSafe for FF<p>

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> CloneAnd for T
where T: Clone,

Sourceยง

fn clone_and<F>(&self, f: F) -> Self
where F: FnOnce(&mut Self),

Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Sourceยง

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Sourceยง

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self> โ“˜

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

impl<T, Rhs> NumAssignOps<Rhs> for T
where T: AddAssign<Rhs> + SubAssign<Rhs> + MulAssign<Rhs> + DivAssign<Rhs> + RemAssign<Rhs>,

Sourceยง

impl<T, Rhs, Output> NumOps<Rhs, Output> for T
where T: Sub<Rhs, Output = Output> + Mul<Rhs, Output = Output> + Div<Rhs, Output = Output> + Add<Rhs, Output = Output> + Rem<Rhs, Output = Output>,

Sourceยง

impl<T, Base> RefNum<Base> for T
where T: NumOps<Base, Base> + for<'r> NumOps<&'r Base, Base>,

Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T> ToString for T
where T: Display + ?Sized,

Sourceยง

fn to_string(&self) -> String

Converts the given value to a String. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.