pub struct DensePolyRingBase<R: RingStore, A: Allocator + Clone = Global, C: ConvolutionAlgorithm<R::Type> = KaratsubaAlgorithm<Global>> { /* private fields */ }Expand description
The univariate polynomial ring R[X]. Polynomials are stored as dense vectors of
coefficients, allocated by the given memory provider.
If most of the coefficients will be zero, consider using sparse_poly::SparsePolyRingBase
instead for improved performance.
§Example
let ZZ = StaticRing::<i32>::RING;
let P = DensePolyRing::new(ZZ, "X");
let x_plus_1 = P.add(P.indeterminate(), P.int_hom().map(1));
let binomial_coefficients = P.pow(x_plus_1, 10);
assert_eq!(10 * 9 * 8 * 7 * 6 / 120, *P.coefficient_at(&binomial_coefficients, 5));This ring has a CanIsoFromTo to sparse_poly::SparsePolyRingBase.
let ZZ = StaticRing::<i32>::RING;
let P = DensePolyRing::new(ZZ, "X");
let P2 = SparsePolyRing::new(ZZ, "X");
let high_power_of_x = P.pow(P.indeterminate(), 10);
assert_el_eq!(P2, P2.pow(P2.indeterminate(), 10), &P.can_iso(&P2).unwrap().map(high_power_of_x));Implementations§
Source§impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> DensePolyRingBase<R, A, C>
impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> DensePolyRingBase<R, A, C>
Sourcepub fn into_base_ring(self) -> R
Available on crate feature unstable-enable only.
pub fn into_base_ring(self) -> R
unstable-enable only.§Availability
This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.
Trait Implementations§
Source§impl<R1, A1, R2, A2, C1, C2> CanHomFrom<DensePolyRingBase<R1, A1, C1>> for DensePolyRingBase<R2, A2, C2>where
R1: RingStore,
A1: Allocator + Clone,
C1: ConvolutionAlgorithm<R1::Type>,
R2: RingStore,
A2: Allocator + Clone,
C2: ConvolutionAlgorithm<R2::Type>,
R2::Type: CanHomFrom<R1::Type>,
impl<R1, A1, R2, A2, C1, C2> CanHomFrom<DensePolyRingBase<R1, A1, C1>> for DensePolyRingBase<R2, A2, C2>where
R1: RingStore,
A1: Allocator + Clone,
C1: ConvolutionAlgorithm<R1::Type>,
R2: RingStore,
A2: Allocator + Clone,
C2: ConvolutionAlgorithm<R2::Type>,
R2::Type: CanHomFrom<R1::Type>,
Source§type Homomorphism = <<R2 as RingStore>::Type as CanHomFrom<<R1 as RingStore>::Type>>::Homomorphism
type Homomorphism = <<R2 as RingStore>::Type as CanHomFrom<<R1 as RingStore>::Type>>::Homomorphism
Source§fn has_canonical_hom(
&self,
from: &DensePolyRingBase<R1, A1, C1>,
) -> Option<Self::Homomorphism>
fn has_canonical_hom( &self, from: &DensePolyRingBase<R1, A1, C1>, ) -> Option<Self::Homomorphism>
from -> self, returns Some(data), where
data is additional data that can be used to compute the action of the homomorphism
on ring elements. Otherwise, None is returned.Source§fn map_in_ref(
&self,
from: &DensePolyRingBase<R1, A1, C1>,
el: &DensePolyRingEl<R1, A1>,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &DensePolyRingBase<R1, A1, C1>, el: &DensePolyRingEl<R1, A1>, hom: &Self::Homomorphism, ) -> Self::Element
Source§fn map_in(
&self,
from: &DensePolyRingBase<R1, A1, C1>,
el: DensePolyRingEl<R1, A1>,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, from: &DensePolyRingBase<R1, A1, C1>, el: DensePolyRingEl<R1, A1>, hom: &Self::Homomorphism, ) -> Self::Element
Source§fn mul_assign_map_in(
&self,
from: &S,
lhs: &mut Self::Element,
rhs: S::Element,
hom: &Self::Homomorphism,
)
fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )
rhs, and multiplies the result to lhs.Source§fn mul_assign_map_in_ref(
&self,
from: &S,
lhs: &mut Self::Element,
rhs: &S::Element,
hom: &Self::Homomorphism,
)
fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )
rhs, taking it by reference, and multiplies the result to lhs.Source§fn fma_map_in(
&self,
from: &S,
lhs: &Self::Element,
rhs: &S::Element,
summand: Self::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn fma_map_in( &self, from: &S, lhs: &Self::Element, rhs: &S::Element, summand: Self::Element, hom: &Self::Homomorphism, ) -> Self::Element
summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.Source§impl<R, P, A, C> CanHomFrom<P> for DensePolyRingBase<R, A, C>where
R: RingStore,
R::Type: CanHomFrom<<P::BaseRing as RingStore>::Type>,
P: ImplGenericCanIsoFromToMarker,
A: Allocator + Clone,
C: ConvolutionAlgorithm<R::Type>,
impl<R, P, A, C> CanHomFrom<P> for DensePolyRingBase<R, A, C>where
R: RingStore,
R::Type: CanHomFrom<<P::BaseRing as RingStore>::Type>,
P: ImplGenericCanIsoFromToMarker,
A: Allocator + Clone,
C: ConvolutionAlgorithm<R::Type>,
Source§type Homomorphism = <<<DensePolyRingBase<R, A, C> as RingExtension>::BaseRing as RingStore>::Type as CanHomFrom<<<P as RingExtension>::BaseRing as RingStore>::Type>>::Homomorphism
type Homomorphism = <<<DensePolyRingBase<R, A, C> as RingExtension>::BaseRing as RingStore>::Type as CanHomFrom<<<P as RingExtension>::BaseRing as RingStore>::Type>>::Homomorphism
Source§fn has_canonical_hom(&self, from: &P) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &P) -> Option<Self::Homomorphism>
from -> self, returns Some(data), where
data is additional data that can be used to compute the action of the homomorphism
on ring elements. Otherwise, None is returned.Source§fn map_in(
&self,
from: &P,
el: P::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, from: &P, el: P::Element, hom: &Self::Homomorphism, ) -> Self::Element
Source§fn map_in_ref(
&self,
from: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Source§fn mul_assign_map_in(
&self,
from: &S,
lhs: &mut Self::Element,
rhs: S::Element,
hom: &Self::Homomorphism,
)
fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )
rhs, and multiplies the result to lhs.Source§fn mul_assign_map_in_ref(
&self,
from: &S,
lhs: &mut Self::Element,
rhs: &S::Element,
hom: &Self::Homomorphism,
)
fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )
rhs, taking it by reference, and multiplies the result to lhs.Source§fn fma_map_in(
&self,
from: &S,
lhs: &Self::Element,
rhs: &S::Element,
summand: Self::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn fma_map_in( &self, from: &S, lhs: &Self::Element, rhs: &S::Element, summand: Self::Element, hom: &Self::Homomorphism, ) -> Self::Element
summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.Source§impl<R1, A1, R2, A2, C1, C2> CanIsoFromTo<DensePolyRingBase<R1, A1, C1>> for DensePolyRingBase<R2, A2, C2>where
R1: RingStore,
A1: Allocator + Clone,
C1: ConvolutionAlgorithm<R1::Type>,
R2: RingStore,
A2: Allocator + Clone,
C2: ConvolutionAlgorithm<R2::Type>,
R2::Type: CanIsoFromTo<R1::Type>,
impl<R1, A1, R2, A2, C1, C2> CanIsoFromTo<DensePolyRingBase<R1, A1, C1>> for DensePolyRingBase<R2, A2, C2>where
R1: RingStore,
A1: Allocator + Clone,
C1: ConvolutionAlgorithm<R1::Type>,
R2: RingStore,
A2: Allocator + Clone,
C2: ConvolutionAlgorithm<R2::Type>,
R2::Type: CanIsoFromTo<R1::Type>,
Source§type Isomorphism = <<R2 as RingStore>::Type as CanIsoFromTo<<R1 as RingStore>::Type>>::Isomorphism
type Isomorphism = <<R2 as RingStore>::Type as CanIsoFromTo<<R1 as RingStore>::Type>>::Isomorphism
Source§fn has_canonical_iso(
&self,
from: &DensePolyRingBase<R1, A1, C1>,
) -> Option<Self::Isomorphism>
fn has_canonical_iso( &self, from: &DensePolyRingBase<R1, A1, C1>, ) -> Option<Self::Isomorphism>
from -> self, and this homomorphism
is an isomorphism, returns Some(data), where data is additional data that
can be used to compute preimages under the homomorphism. Otherwise, None is
returned.Source§fn map_out(
&self,
from: &DensePolyRingBase<R1, A1, C1>,
el: DensePolyRingEl<R2, A2>,
hom: &Self::Isomorphism,
) -> DensePolyRingEl<R1, A1>
fn map_out( &self, from: &DensePolyRingBase<R1, A1, C1>, el: DensePolyRingEl<R2, A2>, hom: &Self::Isomorphism, ) -> DensePolyRingEl<R1, A1>
el under the canonical homomorphism from -> self.Source§impl<R, P, A, C> CanIsoFromTo<P> for DensePolyRingBase<R, A, C>where
R: RingStore,
R::Type: CanIsoFromTo<<P::BaseRing as RingStore>::Type>,
P: ImplGenericCanIsoFromToMarker,
A: Allocator + Clone,
C: ConvolutionAlgorithm<R::Type>,
impl<R, P, A, C> CanIsoFromTo<P> for DensePolyRingBase<R, A, C>where
R: RingStore,
R::Type: CanIsoFromTo<<P::BaseRing as RingStore>::Type>,
P: ImplGenericCanIsoFromToMarker,
A: Allocator + Clone,
C: ConvolutionAlgorithm<R::Type>,
Source§type Isomorphism = <<<DensePolyRingBase<R, A, C> as RingExtension>::BaseRing as RingStore>::Type as CanIsoFromTo<<<P as RingExtension>::BaseRing as RingStore>::Type>>::Isomorphism
type Isomorphism = <<<DensePolyRingBase<R, A, C> as RingExtension>::BaseRing as RingStore>::Type as CanIsoFromTo<<<P as RingExtension>::BaseRing as RingStore>::Type>>::Isomorphism
Source§fn has_canonical_iso(&self, from: &P) -> Option<Self::Isomorphism>
fn has_canonical_iso(&self, from: &P) -> Option<Self::Isomorphism>
from -> self, and this homomorphism
is an isomorphism, returns Some(data), where data is additional data that
can be used to compute preimages under the homomorphism. Otherwise, None is
returned.Source§impl<R: RingStore + Clone, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type> + Clone> Clone for DensePolyRingBase<R, A, C>
impl<R: RingStore + Clone, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type> + Clone> Clone for DensePolyRingBase<R, A, C>
Source§impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> Debug for DensePolyRingBase<R, A, C>
impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> Debug for DensePolyRingBase<R, A, C>
Source§impl<R, A: Allocator + Clone, C> DivisibilityRing for DensePolyRingBase<R, A, C>
impl<R, A: Allocator + Clone, C> DivisibilityRing for DensePolyRingBase<R, A, C>
Source§fn checked_left_div(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
) -> Option<Self::Element>
fn checked_left_div( &self, lhs: &Self::Element, rhs: &Self::Element, ) -> Option<Self::Element>
x such that rhs * x = lhs, and
returns it if it exists. Read moreSource§fn divides_left(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn divides_left(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
x such that rhs * x = lhs.
If you need such an element, consider using DivisibilityRing::checked_left_div(). Read moreSource§fn balance_factor<'a, I>(&self, elements: I) -> Option<Self::Element>
fn balance_factor<'a, I>(&self, elements: I) -> Option<Self::Element>
Source§type PreparedDivisorData = ()
type PreparedDivisorData = ()
Source§fn divides(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn divides(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
DivisibilityRing::divides_left(), but requires a commutative ring.Source§fn checked_div(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
) -> Option<Self::Element>
fn checked_div( &self, lhs: &Self::Element, rhs: &Self::Element, ) -> Option<Self::Element>
DivisibilityRing::checked_left_div(), but requires a commutative ring.Source§fn is_unit(&self, x: &Self::Element) -> bool
fn is_unit(&self, x: &Self::Element) -> bool
Source§fn prepare_divisor(&self, _: &Self::Element) -> Self::PreparedDivisorData
fn prepare_divisor(&self, _: &Self::Element) -> Self::PreparedDivisorData
Source§fn checked_left_div_prepared(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
_rhs_prep: &Self::PreparedDivisorData,
) -> Option<Self::Element>
fn checked_left_div_prepared( &self, lhs: &Self::Element, rhs: &Self::Element, _rhs_prep: &Self::PreparedDivisorData, ) -> Option<Self::Element>
DivisibilityRing::checked_left_div() but for a prepared divisor. Read moreSource§fn divides_left_prepared(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
_rhs_prep: &Self::PreparedDivisorData,
) -> bool
fn divides_left_prepared( &self, lhs: &Self::Element, rhs: &Self::Element, _rhs_prep: &Self::PreparedDivisorData, ) -> bool
DivisibilityRing::divides_left() but for a prepared divisor. Read moreSource§fn is_unit_prepared(&self, x: &PreparedDivisor<Self>) -> bool
fn is_unit_prepared(&self, x: &PreparedDivisor<Self>) -> bool
DivisibilityRing::is_unit() but for a prepared divisor. Read moreSource§impl<R, A, C> EuclideanRing for DensePolyRingBase<R, A, C>where
A: Allocator + Clone,
R: RingStore,
R::Type: Field + PolyTFracGCDRing,
C: ConvolutionAlgorithm<R::Type>,
impl<R, A, C> EuclideanRing for DensePolyRingBase<R, A, C>where
A: Allocator + Clone,
R: RingStore,
R::Type: Field + PolyTFracGCDRing,
C: ConvolutionAlgorithm<R::Type>,
Source§fn euclidean_div_rem(
&self,
lhs: Self::Element,
rhs: &Self::Element,
) -> (Self::Element, Self::Element)
fn euclidean_div_rem( &self, lhs: Self::Element, rhs: &Self::Element, ) -> (Self::Element, Self::Element)
Source§fn euclidean_deg(&self, val: &Self::Element) -> Option<usize>
fn euclidean_deg(&self, val: &Self::Element) -> Option<usize>
EuclideanRing.Source§impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> EvalPolyLocallyRing for DensePolyRingBase<R, A, C>
impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> EvalPolyLocallyRing for DensePolyRingBase<R, A, C>
Source§type LocalRing<'ring> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRing<'ring>
where
Self: 'ring
type LocalRing<'ring> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRing<'ring> where Self: 'ring
unstable-enable only.Source§type LocalRingBase<'ring> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRingBase<'ring>
where
Self: 'ring
type LocalRingBase<'ring> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRingBase<'ring> where Self: 'ring
unstable-enable only.Source§type LocalComputationData<'ring> = (ToExtRingMap<'ring, <R as RingStore>::Type>, Vec<<<<<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRing<'ring> as RingStore>::Type as RingBase>::Element>)
where
Self: 'ring
type LocalComputationData<'ring> = (ToExtRingMap<'ring, <R as RingStore>::Type>, Vec<<<<<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRing<'ring> as RingStore>::Type as RingBase>::Element>) where Self: 'ring
unstable-enable only.Source§fn ln_pseudo_norm(&self, el: &Self::Element) -> f64
fn ln_pseudo_norm(&self, el: &Self::Element) -> f64
unstable-enable only.Source§fn local_computation<'ring>(
&'ring self,
ln_pseudo_norm: f64,
) -> Self::LocalComputationData<'ring>
fn local_computation<'ring>( &'ring self, ln_pseudo_norm: f64, ) -> Self::LocalComputationData<'ring>
unstable-enable only.Source§fn local_ring_count<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
) -> usizewhere
Self: 'ring,
fn local_ring_count<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
) -> usizewhere
Self: 'ring,
unstable-enable only.k of local rings that are required
to get the correct result of the given computation.Source§fn local_ring_at<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
i: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
fn local_ring_at<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
i: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
unstable-enable only.i-th local ring belonging to the given computation.Source§fn reduce<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
el: &Self::Element,
) -> Vec<<Self::LocalRingBase<'ring> as RingBase>::Element>where
Self: 'ring,
fn reduce<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
el: &Self::Element,
) -> Vec<<Self::LocalRingBase<'ring> as RingBase>::Element>where
Self: 'ring,
unstable-enable only.R -> R1 x ... x Rk, i.e. maps the given element into each of
the local rings.Source§fn lift_combine<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
els: &[<Self::LocalRingBase<'ring> as RingBase>::Element],
) -> Self::Elementwhere
Self: 'ring,
fn lift_combine<'ring>(
&self,
data: &Self::LocalComputationData<'ring>,
els: &[<Self::LocalRingBase<'ring> as RingBase>::Element],
) -> Self::Elementwhere
Self: 'ring,
unstable-enable only.R -> R1 x ... x Rk, i.e. a ring element x that reduces
to each of the given local rings under the map EvalPolyLocallyRing::reduce(). Read moreSource§impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> FiniteRingSpecializable for DensePolyRingBase<R, A, C>
impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> FiniteRingSpecializable for DensePolyRingBase<R, A, C>
Source§fn specialize<O: FiniteRingOperation<Self>>(op: O) -> O::Output
fn specialize<O: FiniteRingOperation<Self>>(op: O) -> O::Output
unstable-enable only.Source§fn is_finite_ring() -> bool
fn is_finite_ring() -> bool
unstable-enable only.Source§impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> HashableElRing for DensePolyRingBase<R, A, C>
impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> HashableElRing for DensePolyRingBase<R, A, C>
Source§impl<R, A, C> PartialEq for DensePolyRingBase<R, A, C>
impl<R, A, C> PartialEq for DensePolyRingBase<R, A, C>
Source§impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> PolyRing for DensePolyRingBase<R, A, C>where
R: RingStore,
impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> PolyRing for DensePolyRingBase<R, A, C>where
R: RingStore,
Source§type TermsIterator<'a> = TermIterator<'a, R>
where
Self: 'a
type TermsIterator<'a> = TermIterator<'a, R> where Self: 'a
PolyRing::terms().Source§fn indeterminate(&self) -> Self::Element
fn indeterminate(&self) -> Self::Element
X generating this polynomial ring.Source§fn terms<'a>(&'a self, f: &'a Self::Element) -> TermIterator<'a, R> ⓘ
fn terms<'a>(&'a self, f: &'a Self::Element) -> TermIterator<'a, R> ⓘ
Source§fn add_assign_from_terms<I>(&self, lhs: &mut Self::Element, rhs: I)
fn add_assign_from_terms<I>(&self, lhs: &mut Self::Element, rhs: I)
Source§fn truncate_monomials(
&self,
lhs: &mut Self::Element,
truncated_at_degree: usize,
)
fn truncate_monomials( &self, lhs: &mut Self::Element, truncated_at_degree: usize, )
lhs by X^truncated_at_inclusive.Source§fn coefficient_at<'a>(
&'a self,
f: &'a Self::Element,
i: usize,
) -> &'a El<Self::BaseRing>
fn coefficient_at<'a>( &'a self, f: &'a Self::Element, i: usize, ) -> &'a El<Self::BaseRing>
f that corresponds to the monomial X^i.Source§fn mul_assign_monomial(&self, lhs: &mut Self::Element, rhs_power: usize)
fn mul_assign_monomial(&self, lhs: &mut Self::Element, rhs_power: usize)
X^rhs_power.Source§fn degree(&self, f: &Self::Element) -> Option<usize>
fn degree(&self, f: &Self::Element) -> Option<usize>
f, i.e. the value d such that f can be written as
f(X) = a0 + a1 * X + a2 * X^2 + ... + ad * X^d. Returns None if f is zero.Source§fn div_rem_monic(
&self,
lhs: Self::Element,
rhs: &Self::Element,
) -> (Self::Element, Self::Element)
fn div_rem_monic( &self, lhs: Self::Element, rhs: &Self::Element, ) -> (Self::Element, Self::Element)
rhs. Read moreSource§fn evaluate<S, H>(
&self,
f: &Self::Element,
value: &S::Element,
hom: H,
) -> S::Element
fn evaluate<S, H>( &self, f: &Self::Element, value: &S::Element, hom: H, ) -> S::Element
Source§impl<R, A, C> PrincipalIdealRing for DensePolyRingBase<R, A, C>where
A: Allocator + Clone,
R: RingStore,
R::Type: Field + PolyTFracGCDRing,
C: ConvolutionAlgorithm<R::Type>,
impl<R, A, C> PrincipalIdealRing for DensePolyRingBase<R, A, C>where
A: Allocator + Clone,
R: RingStore,
R::Type: Field + PolyTFracGCDRing,
C: ConvolutionAlgorithm<R::Type>,
Source§fn checked_div_min(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
) -> Option<Self::Element>
fn checked_div_min( &self, lhs: &Self::Element, rhs: &Self::Element, ) -> Option<Self::Element>
DivisibilityRing::checked_left_div() this computes a “quotient” q
of lhs and rhs, if it exists. However, we impose the additional constraint
that this quotient be minimal, i.e. there is no q' with q' | q properly and
q' * rhs = lhs. Read moreSource§fn extended_ideal_gen(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
) -> (Self::Element, Self::Element, Self::Element)
fn extended_ideal_gen( &self, lhs: &Self::Element, rhs: &Self::Element, ) -> (Self::Element, Self::Element, Self::Element)
g of the ideal (lhs, rhs)
as g = s * lhs + t * rhs. Read moreSource§fn ideal_gen(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn ideal_gen(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
g of the ideal (lhs, rhs) = (g), also known as greatest
common divisor. Read moreSource§fn ideal_gen_with_controller<Controller>(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
controller: Controller,
) -> Self::Elementwhere
Controller: ComputationController,
fn ideal_gen_with_controller<Controller>(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
controller: Controller,
) -> Self::Elementwhere
Controller: ComputationController,
PrincipalIdealRing::ideal_gen(), this computes a generator of the ideal (lhs, rhs).
However, it additionally accepts a ComputationController to customize the performed
computation.Source§fn annihilator(&self, val: &Self::Element) -> Self::Element
fn annihilator(&self, val: &Self::Element) -> Self::Element
Source§impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> RingBase for DensePolyRingBase<R, A, C>
impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> RingBase for DensePolyRingBase<R, A, C>
Source§type Element = DensePolyRingEl<R, A>
type Element = DensePolyRingEl<R, A>
fn clone_el(&self, val: &Self::Element) -> Self::Element
fn add_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn add_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn sub_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn negate_inplace(&self, lhs: &mut Self::Element)
fn mul_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn mul_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn zero(&self) -> Self::Element
fn from_int(&self, value: i32) -> Self::Element
fn eq_el(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
Source§fn is_commutative(&self) -> bool
fn is_commutative(&self) -> bool
a * b = b * a for all elements a, b.
Note that addition is assumed to be always commutative.Source§fn is_noetherian(&self) -> bool
fn is_noetherian(&self) -> bool
Source§fn dbg_within<'a>(
&self,
value: &Self::Element,
out: &mut Formatter<'a>,
env: EnvBindingStrength,
) -> Result
fn dbg_within<'a>( &self, value: &Self::Element, out: &mut Formatter<'a>, env: EnvBindingStrength, ) -> Result
value to out, taking into account the possible context
to place parenthesis as needed. Read morefn square(&self, value: &mut Self::Element)
fn mul_ref(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn mul_assign_int(&self, lhs: &mut Self::Element, rhs: i32)
Source§fn characteristic<I: IntegerRingStore + Copy>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
fn characteristic<I: IntegerRingStore + Copy>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
ZZ. Read moreSource§fn prod<I>(&self, els: I) -> Self::Elementwhere
I: IntoIterator<Item = Self::Element>,
fn prod<I>(&self, els: I) -> Self::Elementwhere
I: IntoIterator<Item = Self::Element>,
Source§fn is_approximate(&self) -> bool
fn is_approximate(&self) -> bool
f32 or
f64, to represent real or complex numbers. Read morefn one(&self) -> Self::Element
fn neg_one(&self) -> Self::Element
fn is_zero(&self, value: &Self::Element) -> bool
fn is_one(&self, value: &Self::Element) -> bool
fn is_neg_one(&self, value: &Self::Element) -> bool
Source§fn fma(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
summand: Self::Element,
) -> Self::Element
fn fma( &self, lhs: &Self::Element, rhs: &Self::Element, summand: Self::Element, ) -> Self::Element
summand + lhs * rhs.fn negate(&self, value: Self::Element) -> Self::Element
fn sub_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn mul_int(&self, lhs: Self::Element, rhs: i32) -> Self::Element
fn mul_int_ref(&self, lhs: &Self::Element, rhs: i32) -> Self::Element
Source§fn fma_int(
&self,
lhs: &Self::Element,
rhs: i32,
summand: Self::Element,
) -> Self::Element
fn fma_int( &self, lhs: &Self::Element, rhs: i32, summand: Self::Element, ) -> Self::Element
summand + lhs * rhs.Source§fn sub_self_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn sub_self_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
lhs := rhs - lhs.Source§fn sub_self_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn sub_self_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
lhs := rhs - lhs.fn add_ref(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn add_ref_fst(&self, lhs: &Self::Element, rhs: Self::Element) -> Self::Element
fn add_ref_snd(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element
fn add(&self, lhs: Self::Element, rhs: Self::Element) -> Self::Element
fn sub_ref(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn sub_ref_fst(&self, lhs: &Self::Element, rhs: Self::Element) -> Self::Element
fn sub_ref_snd(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element
fn sub(&self, lhs: Self::Element, rhs: Self::Element) -> Self::Element
fn mul_ref_fst(&self, lhs: &Self::Element, rhs: Self::Element) -> Self::Element
fn mul_ref_snd(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element
fn mul(&self, lhs: Self::Element, rhs: Self::Element) -> Self::Element
Source§impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> RingExtension for DensePolyRingBase<R, A, C>
impl<R: RingStore, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> RingExtension for DensePolyRingBase<R, A, C>
Source§fn from(&self, x: El<Self::BaseRing>) -> Self::Element
fn from(&self, x: El<Self::BaseRing>) -> Self::Element
fn fma_base( &self, lhs: &Self::Element, rhs: &El<Self::BaseRing>, summand: Self::Element, ) -> Self::Element
Source§fn mul_assign_base(&self, lhs: &mut Self::Element, rhs: &El<Self::BaseRing>)
fn mul_assign_base(&self, lhs: &mut Self::Element, rhs: &El<Self::BaseRing>)
lhs := lhs * rhs, where rhs is mapped into this
ring via RingExtension::from_ref(). Note that this may be
faster than self.mul_assign(lhs, self.from_ref(rhs)).Source§fn from_ref(&self, x: &El<Self::BaseRing>) -> Self::Element
fn from_ref(&self, x: &El<Self::BaseRing>) -> Self::Element
Source§fn mul_assign_base_through_hom<S: ?Sized + RingBase, H: Homomorphism<S, <Self::BaseRing as RingStore>::Type>>(
&self,
lhs: &mut Self::Element,
rhs: &S::Element,
hom: H,
)
fn mul_assign_base_through_hom<S: ?Sized + RingBase, H: Homomorphism<S, <Self::BaseRing as RingStore>::Type>>( &self, lhs: &mut Self::Element, rhs: &S::Element, hom: H, )
lhs := lhs * rhs, where rhs is mapped into this ring
via the given homomorphism, followed by the inclusion (as specified by
RingExtension::from_ref()). Read moreSource§impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> SerializableElementRing for DensePolyRingBase<R, A, C>
impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> SerializableElementRing for DensePolyRingBase<R, A, C>
Source§fn deserialize<'de, D>(
&self,
deserializer: D,
) -> Result<Self::Element, D::Error>where
D: Deserializer<'de>,
fn deserialize<'de, D>(
&self,
deserializer: D,
) -> Result<Self::Element, D::Error>where
D: Deserializer<'de>,
unstable-enable only.impl<R, A: Allocator + Clone, C: ConvolutionAlgorithm<R::Type>> Domain for DensePolyRingBase<R, A, C>
impl<R, A, C> ImplGenericCanIsoFromToMarker for DensePolyRingBase<R, A, C>
Auto Trait Implementations§
impl<R, A, C> Freeze for DensePolyRingBase<R, A, C>
impl<R, A, C> RefUnwindSafe for DensePolyRingBase<R, A, C>where
R: RefUnwindSafe,
<<R as RingStore>::Type as RingBase>::Element: RefUnwindSafe,
A: RefUnwindSafe,
C: RefUnwindSafe,
impl<R, A, C> Send for DensePolyRingBase<R, A, C>
impl<R, A, C> Sync for DensePolyRingBase<R, A, C>
impl<R, A, C> Unpin for DensePolyRingBase<R, A, C>
impl<R, A, C> UnwindSafe for DensePolyRingBase<R, A, C>where
R: UnwindSafe,
<<R as RingStore>::Type as RingBase>::Element: UnwindSafe,
A: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<R> ComputeInnerProduct for R
impl<R> ComputeInnerProduct for R
Source§default fn inner_product_ref_fst<'a, I>(
&self,
els: I,
) -> <R as RingBase>::Element
default fn inner_product_ref_fst<'a, I>( &self, els: I, ) -> <R as RingBase>::Element
unstable-enable only.sum_i lhs[i] * rhs[i].Source§default fn inner_product_ref<'a, I>(&self, els: I) -> <R as RingBase>::Element
default fn inner_product_ref<'a, I>(&self, els: I) -> <R as RingBase>::Element
unstable-enable only.sum_i lhs[i] * rhs[i].Source§impl<R> ComputeResultantRing for R
impl<R> ComputeResultantRing for R
Source§impl<R, S> CooleyTuckeyButterfly<S> for R
impl<R, S> CooleyTuckeyButterfly<S> for R
Source§default fn butterfly<V, H>(
&self,
hom: H,
values: &mut V,
twiddle: &<S as RingBase>::Element,
i1: usize,
i2: usize,
)
default fn butterfly<V, H>( &self, hom: H, values: &mut V, twiddle: &<S as RingBase>::Element, i1: usize, i2: usize, )
(values[i1], values[i2]) := (values[i1] + twiddle * values[i2], values[i1] - twiddle * values[i2]). Read moreSource§default fn butterfly_new<H>(
hom: H,
x: &mut <R as RingBase>::Element,
y: &mut <R as RingBase>::Element,
twiddle: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
default fn butterfly_new<H>(
hom: H,
x: &mut <R as RingBase>::Element,
y: &mut <R as RingBase>::Element,
twiddle: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
(x, y) := (x + twiddle * y, x - twiddle * y). Read moreSource§default fn inv_butterfly<V, H>(
&self,
hom: H,
values: &mut V,
twiddle: &<S as RingBase>::Element,
i1: usize,
i2: usize,
)
default fn inv_butterfly<V, H>( &self, hom: H, values: &mut V, twiddle: &<S as RingBase>::Element, i1: usize, i2: usize, )
(values[i1], values[i2]) := (values[i1] + values[i2], (values[i1] - values[i2]) * twiddle) Read moreSource§default fn inv_butterfly_new<H>(
hom: H,
x: &mut <R as RingBase>::Element,
y: &mut <R as RingBase>::Element,
twiddle: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
default fn inv_butterfly_new<H>(
hom: H,
x: &mut <R as RingBase>::Element,
y: &mut <R as RingBase>::Element,
twiddle: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
(x, y) := (x + y, (x - y) * twiddle) Read moreSource§default fn prepare_for_fft(&self, _value: &mut <R as RingBase>::Element)
default fn prepare_for_fft(&self, _value: &mut <R as RingBase>::Element)
CooleyTuckeyButterfly::butterfly_new()
that the inputs are in this form.Source§default fn prepare_for_inv_fft(&self, _value: &mut <R as RingBase>::Element)
default fn prepare_for_inv_fft(&self, _value: &mut <R as RingBase>::Element)
CooleyTuckeyButterfly::inv_butterfly_new()
that the inputs are in this form.Source§impl<R, S> CooleyTukeyRadix3Butterfly<S> for R
impl<R, S> CooleyTukeyRadix3Butterfly<S> for R
Source§default fn prepare_for_fft(&self, _value: &mut <R as RingBase>::Element)
Available on crate feature unstable-enable only.
default fn prepare_for_fft(&self, _value: &mut <R as RingBase>::Element)
unstable-enable only.Possibly pre-processes elements before the FFT starts. Here you can bring ring element
into a certain form, and assume during CooleyTukeyRadix3Butterfly::butterfly()
that the inputs are in this form.
Source§default fn prepare_for_inv_fft(&self, _value: &mut <R as RingBase>::Element)
Available on crate feature unstable-enable only.
default fn prepare_for_inv_fft(&self, _value: &mut <R as RingBase>::Element)
unstable-enable only.Possibly pre-processes elements before the inverse FFT starts. Here you can bring ring element
into a certain form, and assume during CooleyTukeyRadix3Butterfly::inv_butterfly()
that the inputs are in this form.
Source§default fn butterfly<H>(
hom: H,
a: &mut <R as RingBase>::Element,
b: &mut <R as RingBase>::Element,
c: &mut <R as RingBase>::Element,
z: &<S as RingBase>::Element,
t: &<S as RingBase>::Element,
t_sqr_z_sqr: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
default fn butterfly<H>(
hom: H,
a: &mut <R as RingBase>::Element,
b: &mut <R as RingBase>::Element,
c: &mut <R as RingBase>::Element,
z: &<S as RingBase>::Element,
t: &<S as RingBase>::Element,
t_sqr_z_sqr: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
unstable-enable only.(a, b, c) := (a + t b + t^2 c, a + t z b + t^2 z^2 c, a + t z^2 b + t^2 z c). Read moreSource§default fn inv_butterfly<H>(
hom: H,
a: &mut <R as RingBase>::Element,
b: &mut <R as RingBase>::Element,
c: &mut <R as RingBase>::Element,
z: &<S as RingBase>::Element,
t: &<S as RingBase>::Element,
t_sqr: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
default fn inv_butterfly<H>(
hom: H,
a: &mut <R as RingBase>::Element,
b: &mut <R as RingBase>::Element,
c: &mut <R as RingBase>::Element,
z: &<S as RingBase>::Element,
t: &<S as RingBase>::Element,
t_sqr: &<S as RingBase>::Element,
)where
H: Homomorphism<S, R>,
unstable-enable only.(a, b, c) := (a + b + c, t (a + z^2 b + z c), t^2 (a + z b + z^2 c)). Read moreSource§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<R> KaratsubaHint for R
impl<R> KaratsubaHint for R
Source§default fn karatsuba_threshold(&self) -> usize
default fn karatsuba_threshold(&self) -> usize
unstable-enable only.KaratsubaAlgorithm will use the Karatsuba algorithm. Read moreSource§impl<R> LinSolveRing for Rwhere
R: PrincipalIdealRing + ?Sized,
impl<R> LinSolveRing for Rwhere
R: PrincipalIdealRing + ?Sized,
Source§default fn solve_right<V1, V2, V3, A>(
&self,
lhs: SubmatrixMut<'_, V1, <R as RingBase>::Element>,
rhs: SubmatrixMut<'_, V2, <R as RingBase>::Element>,
out: SubmatrixMut<'_, V3, <R as RingBase>::Element>,
allocator: A,
) -> SolveResultwhere
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
A: Allocator,
default fn solve_right<V1, V2, V3, A>(
&self,
lhs: SubmatrixMut<'_, V1, <R as RingBase>::Element>,
rhs: SubmatrixMut<'_, V2, <R as RingBase>::Element>,
out: SubmatrixMut<'_, V3, <R as RingBase>::Element>,
allocator: A,
) -> SolveResultwhere
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
A: Allocator,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R> StrassenHint for R
impl<R> StrassenHint for R
Source§default fn strassen_threshold(&self) -> usize
default fn strassen_threshold(&self) -> usize
unstable-enable only.StrassenAlgorithm will use the Strassen algorithm. Read more