FactoringStructure

Struct FactoringStructure 

Source
pub struct FactoringStructure<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> { /* private fields */ }

Implementations§

Source§

impl<FS: FiniteFieldSignature, FSB: BorrowedStructure<FS>, FSPB: BorrowedStructure<PolynomialStructure<FS, FSB>>, NB: BorrowedStructure<NaturalCanonicalStructure>> FactoringStructure<PolynomialStructure<FS, FSB>, FSPB, NaturalCanonicalStructure, NB>

Source§

impl<ObjectB: BorrowedStructure<NaturalCanonicalStructure>, ExponentB: BorrowedStructure<NaturalCanonicalStructure>> FactoringStructure<NaturalCanonicalStructure, ObjectB, NaturalCanonicalStructure, ExponentB>

Source§

impl<PowersB: BorrowedStructure<NaturalCanonicalStructure>, ExponentB: BorrowedStructure<NaturalCanonicalStructure>> FactoringStructure<NaturalCanonicalStructure, PowersB, NaturalCanonicalStructure, ExponentB>

Source

pub fn is_primitive_root( &self, x: &Natural, n_factored: &Factored<Natural, Natural>, ) -> IsPrimitiveRootResult

Return whether x is a primitive root modulo the factorized value

Source§

impl<RS: FactoringMonoidSignature<FactoredExponent = NaturalCanonicalStructure> + EuclideanDomainSignature + GreatestCommonDivisorSignature, RSB: BorrowedStructure<RS>, RSQB: BorrowedStructure<EuclideanRemainderQuotientStructure<RS, RSB, true>>, RSQPB: BorrowedStructure<PolynomialStructure<EuclideanRemainderQuotientStructure<RS, RSB, true>, RSQB>>, NB: BorrowedStructure<NaturalCanonicalStructure>> FactoringStructure<PolynomialStructure<EuclideanRemainderQuotientStructure<RS, RSB, true>, RSQB>, RSQPB, NaturalCanonicalStructure, NB>

Source

pub fn into_hensel_factorization( &self, a: NonZeroFactored<Polynomial<RS::Set>, Natural>, h: Polynomial<RS::Set>, ) -> Option<HenselFactorization<true, RS>>

If the polynomial is squarefree return a hensel factorization, otherwise return None

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source

pub fn new(objects: ObjectB, exponents: ExponentB) -> Self

Source

pub fn objects(&self) -> &Object

Source

pub fn exponents(&self) -> &Exponent

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source

pub fn new_irreducible_unchecked( &self, p: Object::Set, ) -> Factored<Object::Set, Exponent::Set>

Source

pub fn new_unit_unchecked( &self, unit: Object::Set, ) -> Factored<Object::Set, Exponent::Set>

Source

pub fn new_powers_unchecked( &self, powers: Vec<(Object::Set, Exponent::Set)>, ) -> Factored<Object::Set, Exponent::Set>

Source

pub fn new_unit_and_powers_unchecked( &self, unit: Object::Set, powers: Vec<(Object::Set, Exponent::Set)>, ) -> Factored<Object::Set, Exponent::Set>

Source

pub fn gcd( &self, a: &Factored<Object::Set, Exponent::Set>, b: &Factored<Object::Set, Exponent::Set>, ) -> Factored<Object::Set, Exponent::Set>

Source

pub fn lcm( &self, a: &Factored<Object::Set, Exponent::Set>, b: &Factored<Object::Set, Exponent::Set>, ) -> Option<Factored<Object::Set, Exponent::Set>>

Source

pub fn is_irreducible(&self, a: &Factored<Object::Set, Exponent::Set>) -> bool

Source

pub fn expand(&self, a: &Factored<Object::Set, Exponent::Set>) -> Object::Set

Source

pub fn expand_squarefree( &self, a: &Factored<Object::Set, Exponent::Set>, ) -> Object::Set

Source

pub fn pow( &self, f: &Factored<Object::Set, Exponent::Set>, n: &Exponent::Set, ) -> Factored<Object::Set, Exponent::Set>

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = NaturalCanonicalStructure>, ObjectB: BorrowedStructure<Object>, ExponentB: BorrowedStructure<NaturalCanonicalStructure>> FactoringStructure<Object, ObjectB, NaturalCanonicalStructure, ExponentB>

Source

pub fn divisors<'a>( &'a self, a: &'a Factored<Object::Set, Natural>, ) -> Option<Box<dyn Iterator<Item = Object::Set> + 'a>>

Return an iterator over all divisors of a factorization

Source

pub fn count_divideisors( &self, a: &Factored<Object::Set, Natural>, ) -> Option<Natural>

The number of divisors of a factorization

Trait Implementations§

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> CancellativeMultiplicationSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn try_divide(&self, a: &Self::Set, b: &Self::Set) -> Option<Self::Set>

Source§

fn divisible(&self, a: &Self::Set, b: &Self::Set) -> bool

return true iff a is divisible by b
Source§

impl<Object: Clone + UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: Clone + BorrowedStructure<Object>, Exponent: Clone + SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: Clone + BorrowedStructure<Exponent>> Clone for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn clone(&self) -> FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<Object: Debug + UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: Debug + BorrowedStructure<Object>, Exponent: Debug + SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: Debug + BorrowedStructure<Exponent>> Debug for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> EqSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn equal(&self, a: &Self::Set, b: &Self::Set) -> bool

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> MultiplicationSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn mul(&self, a: &Self::Set, b: &Self::Set) -> Self::Set

Source§

fn mul_mut(&self, a: &mut Self::Set, b: &Self::Set)

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> MultiplicativeMonoidSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn product(&self, vals: Vec<impl Borrow<Self::Set>>) -> Self::Set

Source§

fn nat_pow(&self, a: &Self::Set, n: &Natural) -> Self::Set

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> OneSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn one(&self) -> Self::Set

Source§

impl<Object: PartialEq + UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: PartialEq + BorrowedStructure<Object>, Exponent: PartialEq + SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: PartialEq + BorrowedStructure<Exponent>> PartialEq for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn eq( &self, other: &FactoringStructure<Object, ObjectB, Exponent, ExponentB>, ) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> RinglikeSpecializationSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> SetSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

type Set = Factored<<Object as SetSignature>::Set, <Exponent as SetSignature>::Set>

Source§

fn is_element(&self, x: &Self::Set) -> Result<(), String>

Some instances of Self::Set may not be valid to represent elements of this set. Return true if x is a valid element and false if not.
Source§

impl<PowersB: BorrowedStructure<NaturalCanonicalStructure>, ExponentB: BorrowedStructure<NaturalCanonicalStructure>> ToStringSignature for FactoringStructure<NaturalCanonicalStructure, PowersB, NaturalCanonicalStructure, ExponentB>

Source§

fn to_string(&self, elem: &Self::Set) -> String

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> TryReciprocalSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn try_reciprocal(&self, a: &Self::Set) -> Option<Self::Set>

b such that a*b=1 and b*a=1 or None if no such b exists.
Source§

fn is_unit(&self, a: &Self::Set) -> bool

Source§

fn units(&self) -> MultiplicativeMonoidUnitsStructure<Self, &Self>

Source§

fn into_units(self) -> MultiplicativeMonoidUnitsStructure<Self, Self>

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> ZeroSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

fn zero(&self) -> Self::Set

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> CommutativeMultiplicationSignature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

impl<Object: Eq + UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: Eq + BorrowedStructure<Object>, Exponent: Eq + SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: Eq + BorrowedStructure<Exponent>> Eq for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> Signature for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Source§

impl<Object: UniqueFactorizationMonoidSignature<FactoredExponent = Exponent>, ObjectB: BorrowedStructure<Object>, Exponent: SemiRingSignature + CancellativeAdditionSignature + OrdSignature, ExponentB: BorrowedStructure<Exponent>> StructuralPartialEq for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

Auto Trait Implementations§

§

impl<Object, ObjectB, Exponent, ExponentB> Freeze for FactoringStructure<Object, ObjectB, Exponent, ExponentB>
where ObjectB: Freeze, ExponentB: Freeze,

§

impl<Object, ObjectB, Exponent, ExponentB> RefUnwindSafe for FactoringStructure<Object, ObjectB, Exponent, ExponentB>
where ObjectB: RefUnwindSafe, ExponentB: RefUnwindSafe, Object: RefUnwindSafe, Exponent: RefUnwindSafe,

§

impl<Object, ObjectB, Exponent, ExponentB> Send for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

§

impl<Object, ObjectB, Exponent, ExponentB> Sync for FactoringStructure<Object, ObjectB, Exponent, ExponentB>

§

impl<Object, ObjectB, Exponent, ExponentB> Unpin for FactoringStructure<Object, ObjectB, Exponent, ExponentB>
where ObjectB: Unpin, ExponentB: Unpin, Object: Unpin, Exponent: Unpin,

§

impl<Object, ObjectB, Exponent, ExponentB> UnwindSafe for FactoringStructure<Object, ObjectB, Exponent, ExponentB>
where ObjectB: UnwindSafe, ExponentB: UnwindSafe, Object: UnwindSafe, Exponent: UnwindSafe,

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<S> AreAssociateMultiplicationSignature for S

Source§

fn are_associate(&self, a: &Self::Set, b: &Self::Set) -> bool

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> 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<T, U> ExactFrom<T> for U
where U: TryFrom<T>,

Source§

fn exact_from(value: T) -> U

Source§

impl<T, U> ExactInto<U> for T
where U: ExactFrom<T>,

Source§

fn exact_into(self) -> U

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<S> IntoErgonomicSignature for S
where S: SetSignature,

Source§

fn into_ergonomic(&self, elem: Self::Set) -> StructuredElement<Self>

Source§

impl<S> LeftCancellativeMultiplicationSignature for S

Source§

fn try_left_divide( &self, a: &<S as SetSignature>::Set, b: &<S as SetSignature>::Set, ) -> Option<<S as SetSignature>::Set>

Try to find x such that a = b * x.
Source§

impl<S> MultiplicativeMonoidTryInverseSignature for S

Source§

fn try_int_pow(&self, a: &Self::Set, n: &Integer) -> Option<Self::Set>

Source§

impl<T, U> OverflowingInto<U> for T
where U: OverflowingFrom<T>,

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<S> RightCancellativeMultiplicationSignature for S

Source§

fn try_right_divide( &self, a: &<S as SetSignature>::Set, b: &<S as SetSignature>::Set, ) -> Option<<S as SetSignature>::Set>

Try to find x such that a = x * b.
Source§

impl<RS> RingMatricesSignature for RS
where RS: SetSignature,

Source§

fn matrices(&self) -> MatrixStructure<Self, &Self>

Source§

fn into_matrices(self) -> MatrixStructure<Self, Self>

Source§

impl<T, U> RoundingInto<U> for T
where U: RoundingFrom<T>,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> SaturatingInto<U> for T
where U: SaturatingFrom<T>,

Source§

impl<T> ToDebugString for T
where T: Debug,

Source§

fn to_debug_string(&self) -> String

Returns the String produced by Ts Debug implementation.

§Examples
use malachite_base::strings::ToDebugString;

assert_eq!([1, 2, 3].to_debug_string(), "[1, 2, 3]");
assert_eq!(
    [vec![2, 3], vec![], vec![4]].to_debug_string(),
    "[[2, 3], [], [4]]"
);
assert_eq!(Some(5).to_debug_string(), "Some(5)");
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<RS> ToPolynomialSignature for RS
where RS: Signature,

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.
Source§

impl<S> TryLeftReciprocalSignature for S

Source§

fn try_left_reciprocal( &self, a: &<S as SetSignature>::Set, ) -> Option<<S as SetSignature>::Set>

x such that x*a=1 or None if no such x exists.
Source§

impl<S> TryRightReciprocalSignature for S

Source§

fn try_right_reciprocal( &self, a: &<S as SetSignature>::Set, ) -> Option<<S as SetSignature>::Set>

x such that a*x=1 or None if no such x exists.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T, U> WrappingInto<U> for T
where U: WrappingFrom<T>,

Source§

fn wrapping_into(self) -> U

Source§

impl<R> ZeroEqSignature for R

Source§

fn is_zero(&self, a: &Self::Set) -> bool

Source§

impl<Domain, Range, M, BM> BorrowedMorphism<Domain, Range, M> for BM
where Domain: Signature, Range: Signature, M: Morphism<Domain, Range>, BM: Borrow<M> + Clone + Debug + Send + Sync,

Source§

impl<S, BS> BorrowedSet<S> for BS
where BS: Borrow<S> + Clone + Debug + Send + Sync,

Source§

impl<S, BS> BorrowedStructure<S> for BS
where S: Signature, BS: Borrow<S> + Clone + Debug + Eq + Send + Sync,