pub struct StaticRingBase<T> { /* private fields */ }
Expand description
The ring of integers Z
, using the arithmetic of the primitive integer type T
.
For the difference to StaticRing
, see the documentation of crate::ring::RingStore
.
Trait Implementations§
Source§impl CanHomFrom<StaticRingBase<i128>> for ZnBase
impl CanHomFrom<StaticRingBase<i128>> for ZnBase
Source§fn map_in(
&self,
_from: &StaticRingBase<i128>,
el: i128,
_hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, _from: &StaticRingBase<i128>, el: i128, _hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism.
Source§type Homomorphism
type Homomorphism
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
If there is a canonical 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: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl CanHomFrom<StaticRingBase<i16>> for ZnBase
impl CanHomFrom<StaticRingBase<i16>> for ZnBase
Source§fn map_in(
&self,
_from: &StaticRingBase<i16>,
el: i16,
_hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, _from: &StaticRingBase<i16>, el: i16, _hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism.
Source§type Homomorphism
type Homomorphism
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
If there is a canonical 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: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl CanHomFrom<StaticRingBase<i32>> for ZnBase
impl CanHomFrom<StaticRingBase<i32>> for ZnBase
Source§fn map_in(
&self,
_from: &StaticRingBase<i32>,
el: i32,
_hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, _from: &StaticRingBase<i32>, el: i32, _hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism.
Source§type Homomorphism
type Homomorphism
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
If there is a canonical 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: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl CanHomFrom<StaticRingBase<i64>> for ZnBase
impl CanHomFrom<StaticRingBase<i64>> for ZnBase
Source§fn map_in(
&self,
_from: &StaticRingBase<i64>,
el: i64,
_hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, _from: &StaticRingBase<i64>, el: i64, _hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism.
Source§type Homomorphism
type Homomorphism
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
If there is a canonical 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: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl<const N: u64, const IS_FIELD: bool> CanHomFrom<StaticRingBase<i64>> for ZnBase<N, IS_FIELD>
impl<const N: u64, const IS_FIELD: bool> CanHomFrom<StaticRingBase<i64>> for ZnBase<N, IS_FIELD>
Source§type Homomorphism = ()
type Homomorphism = ()
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, _: &StaticRingBase<i64>) -> Option<()>
fn has_canonical_hom(&self, _: &StaticRingBase<i64>) -> Option<()>
If there is a canonical 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, _: &StaticRingBase<i64>, el: i64, _: &()) -> Self::Element
fn map_in(&self, _: &StaticRingBase<i64>, el: i64, _: &()) -> Self::Element
Evaluates the homomorphism.
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
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl CanHomFrom<StaticRingBase<i8>> for ZnBase
impl CanHomFrom<StaticRingBase<i8>> for ZnBase
Source§fn map_in(
&self,
_from: &StaticRingBase<i8>,
el: i8,
_hom: &Self::Homomorphism,
) -> Self::Element
fn map_in( &self, _from: &StaticRingBase<i8>, el: i8, _hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism.
Source§type Homomorphism
type Homomorphism
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>
If there is a canonical 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: &S,
el: &S::Element,
hom: &Self::Homomorphism,
) -> Self::Element
fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl<T> Clone for StaticRingBase<T>
impl<T> Clone for StaticRingBase<T>
Source§impl<T> Debug for StaticRingBase<T>
impl<T> Debug for StaticRingBase<T>
Source§impl<T: PrimitiveInt> Default for StaticRingBase<T>
impl<T: PrimitiveInt> Default for StaticRingBase<T>
Source§impl<'de, T: PrimitiveInt> Deserialize<'de> for StaticRingBase<T>
impl<'de, T: PrimitiveInt> Deserialize<'de> for StaticRingBase<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PrimitiveInt> DivisibilityRing for StaticRingBase<T>
impl<T: PrimitiveInt> DivisibilityRing for StaticRingBase<T>
Source§type PreparedDivisorData = PrimitiveIntPreparedDivisorData<T>
type PreparedDivisorData = PrimitiveIntPreparedDivisorData<T>
Additional data associated to a fixed ring element that can be used
to speed up division by this ring element. Read more
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>
Checks whether there is an element
x
such that rhs * x = lhs
, and
returns it if it exists. Read moreSource§fn balance_factor<'a, I>(&self, elements: I) -> Option<Self::Element>
fn balance_factor<'a, I>(&self, elements: I) -> Option<Self::Element>
Function that computes a “balancing” factor of a sequence of ring elements.
The only use of the balancing factor is to increase performance, in particular,
dividing all elements in the sequence by this factor should make them
“smaller” resp. cheaper to process. Read more
Source§fn prepare_divisor(&self, x: &Self::Element) -> Self::PreparedDivisorData
fn prepare_divisor(&self, x: &Self::Element) -> Self::PreparedDivisorData
“Prepares” an element of this ring for division. Read more
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>
Same as
DivisibilityRing::checked_left_div()
but for a prepared divisor. Read moreSource§fn divides_left(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn divides_left(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
Returns whether there is an element
x
such that rhs * x = lhs
.
If you need such an element, consider using DivisibilityRing::checked_left_div()
. Read moreSource§fn divides(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn divides(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
Same as
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>
Same as
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
Returns whether the given element is a unit, i.e. has an inverse.
Source§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
Same as
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
Same as
DivisibilityRing::is_unit()
but for a prepared divisor. Read moreSource§impl<T: PrimitiveInt> EuclideanRing for StaticRingBase<T>
impl<T: PrimitiveInt> EuclideanRing for StaticRingBase<T>
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)
Computes euclidean division with remainder. Read more
Source§fn euclidean_deg(&self, val: &Self::Element) -> Option<usize>
fn euclidean_deg(&self, val: &Self::Element) -> Option<usize>
Defines how “small” an element is. For details, see
EuclideanRing
.Source§impl<T> EvalPolyLocallyRing for StaticRingBase<T>where
T: PrimitiveInt,
impl<T> EvalPolyLocallyRing for StaticRingBase<T>where
T: PrimitiveInt,
Source§type LocalComputationData<'ring> = RingValue<ZnBase<RingValue<AsFieldBase<RingValue<ZnBase>>>, RingRef<'ring, StaticRingBase<T>>>>
where
Self: 'ring
type LocalComputationData<'ring> = RingValue<ZnBase<RingValue<AsFieldBase<RingValue<ZnBase>>>, RingRef<'ring, StaticRingBase<T>>>> where Self: 'ring
Available on crate feature
unstable-enable
only.A collection of prime ideals of the ring, and additionally any data required to reconstruct
a small ring element from its projections onto each prime ideal.
Source§type LocalRing<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>>
where
Self: 'ring
type LocalRing<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>> where Self: 'ring
Available on crate feature
unstable-enable
only.Source§type LocalRingBase<'ring> = AsFieldBase<RingValue<ZnBase>>
where
Self: 'ring
type LocalRingBase<'ring> = AsFieldBase<RingValue<ZnBase>> where Self: 'ring
Available on crate feature
unstable-enable
only.The type of the ring we get once quotienting by a prime ideal. Read more
Source§fn ln_pseudo_norm(&self, el: &Self::Element) -> f64
fn ln_pseudo_norm(&self, el: &Self::Element) -> f64
Available on crate feature
unstable-enable
only.Computes (an upper bound of) the natural logarithm of the pseudo norm of a ring element. Read more
Source§fn local_computation<'ring>(
&'ring self,
ln_pseudo_norm_bound: f64,
) -> Self::LocalComputationData<'ring>
fn local_computation<'ring>( &'ring self, ln_pseudo_norm_bound: f64, ) -> Self::LocalComputationData<'ring>
Available on crate feature
unstable-enable
only.Sets up the context for a new polynomial evaluation, whose output
should have pseudo norm less than the given bound.
Source§fn local_ring_at<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
i: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
fn local_ring_at<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
i: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Returns the
i
-th local ring belonging to the given computation.Source§fn local_ring_count<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
) -> usizewhere
Self: 'ring,
fn local_ring_count<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
) -> usizewhere
Self: 'ring,
Available on crate feature
unstable-enable
only.Returns the number
k
of local rings that are required
to get the correct result of the given computation.Source§fn reduce<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
el: &Self::Element,
) -> Vec<<Self::LocalRingBase<'ring> as RingBase>::Element>where
Self: 'ring,
fn reduce<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
el: &Self::Element,
) -> Vec<<Self::LocalRingBase<'ring> as RingBase>::Element>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes the map
R -> R1 x ... x Rk
, i.e. maps the given element into each of
the local rings.Source§fn lift_combine<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
el: &[<Self::LocalRingBase<'ring> as RingBase>::Element],
) -> Self::Elementwhere
Self: 'ring,
fn lift_combine<'ring>(
&self,
computation: &Self::LocalComputationData<'ring>,
el: &[<Self::LocalRingBase<'ring> as RingBase>::Element],
) -> Self::Elementwhere
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes a preimage under the map
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<T> FiniteRingSpecializable for StaticRingBase<T>where
T: PrimitiveInt,
impl<T> FiniteRingSpecializable for StaticRingBase<T>where
T: PrimitiveInt,
Source§fn specialize<O: FiniteRingOperation<Self>>(op: O) -> O::Output
fn specialize<O: FiniteRingOperation<Self>>(op: O) -> O::Output
Available on crate feature
unstable-enable
only.Source§fn is_finite_ring() -> bool
fn is_finite_ring() -> bool
Available on crate feature
unstable-enable
only.Source§impl<T: PrimitiveInt> HashableElRing for StaticRingBase<T>
impl<T: PrimitiveInt> HashableElRing for StaticRingBase<T>
Source§impl<R> Homomorphism<StaticRingBase<i32>, <R as RingStore>::Type> for IntHom<R>where
R: RingStore,
impl<R> Homomorphism<StaticRingBase<i32>, <R as RingStore>::Type> for IntHom<R>where
R: RingStore,
Source§type CodomainStore = R
type CodomainStore = R
The type of the
RingStore
used by this object to store the codomain ring.Source§type DomainStore = RingValue<StaticRingBase<i32>>
type DomainStore = RingValue<StaticRingBase<i32>>
The type of the
RingStore
used by this object to store the domain ring.Source§fn domain<'a>(&'a self) -> &'a Self::DomainStore
fn domain<'a>(&'a self) -> &'a Self::DomainStore
Returns a reference to the domain ring.
Source§fn codomain<'a>(&'a self) -> &'a Self::CodomainStore
fn codomain<'a>(&'a self) -> &'a Self::CodomainStore
Returns a reference to the codomain ring.
Source§fn map(&self, x: i32) -> El<R>
fn map(&self, x: i32) -> El<R>
Applies this homomorphism to the given element from the domain ring,
resulting in an element in the codomain ring.
Source§fn mul_assign_map(&self, lhs: &mut El<R>, rhs: i32)
fn mul_assign_map(&self, lhs: &mut El<R>, rhs: i32)
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn mul_assign_ref_map(
&self,
lhs: &mut El<R>,
rhs: &<StaticRingBase<i32> as RingBase>::Element,
)
fn mul_assign_ref_map( &self, lhs: &mut El<R>, rhs: &<StaticRingBase<i32> as RingBase>::Element, )
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn fma_map(&self, lhs: &El<R>, rhs: &i32, summand: El<R>) -> El<R>
fn fma_map(&self, lhs: &El<R>, rhs: &i32, summand: El<R>) -> El<R>
Fused-multiply-add. This computes
lhs * rhs + summand
, where rhs
is mapped
into the ring via this homomorphism. Read moreSource§fn map_ref(&self, x: &Domain::Element) -> Codomain::Element
fn map_ref(&self, x: &Domain::Element) -> Codomain::Element
Applies this homomorphism to the given element from the domain ring,
resulting in an element in the codomain ring.
Source§fn mul_map(
&self,
lhs: Codomain::Element,
rhs: Domain::Element,
) -> Codomain::Element
fn mul_map( &self, lhs: Codomain::Element, rhs: Domain::Element, ) -> Codomain::Element
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn mul_ref_fst_map(
&self,
lhs: &Codomain::Element,
rhs: Domain::Element,
) -> Codomain::Element
fn mul_ref_fst_map( &self, lhs: &Codomain::Element, rhs: Domain::Element, ) -> Codomain::Element
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn mul_ref_snd_map(
&self,
lhs: Codomain::Element,
rhs: &Domain::Element,
) -> Codomain::Element
fn mul_ref_snd_map( &self, lhs: Codomain::Element, rhs: &Domain::Element, ) -> Codomain::Element
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn mul_ref_map(
&self,
lhs: &Codomain::Element,
rhs: &Domain::Element,
) -> Codomain::Element
fn mul_ref_map( &self, lhs: &Codomain::Element, rhs: &Domain::Element, ) -> Codomain::Element
Multiplies the given element in the codomain ring with an element obtained
by applying this homomorphism to a given element from the domain ring. Read more
Source§fn compose<F, PrevDomain: ?Sized + RingBase>(
self,
prev: F,
) -> ComposedHom<PrevDomain, Domain, Codomain, F, Self>where
Self: Sized,
F: Homomorphism<PrevDomain, Domain>,
fn compose<F, PrevDomain: ?Sized + RingBase>(
self,
prev: F,
) -> ComposedHom<PrevDomain, Domain, Codomain, F, Self>where
Self: Sized,
F: Homomorphism<PrevDomain, Domain>,
Constructs the homomorphism
x -> self.map(prev.map(x))
.Source§fn mul_assign_ref_map_through_hom<First: ?Sized + RingBase, H: Homomorphism<First, Domain>>(
&self,
lhs: &mut Codomain::Element,
rhs: &First::Element,
hom: H,
)
fn mul_assign_ref_map_through_hom<First: ?Sized + RingBase, H: Homomorphism<First, Domain>>( &self, lhs: &mut Codomain::Element, rhs: &First::Element, hom: H, )
Multiplies the given element in the codomain ring with an element obtained
by applying this and another homomorphism to a given element from another ring. Read more
Source§fn mul_assign_map_through_hom<First: ?Sized + RingBase, H: Homomorphism<First, Domain>>(
&self,
lhs: &mut Codomain::Element,
rhs: First::Element,
hom: H,
)
fn mul_assign_map_through_hom<First: ?Sized + RingBase, H: Homomorphism<First, Domain>>( &self, lhs: &mut Codomain::Element, rhs: First::Element, hom: H, )
Multiplies the given element in the codomain ring with an element obtained
by applying this and another homomorphism to a given element from another ring. Read more
Source§impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i128>
impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i128>
Source§fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i128
fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i128
Maps the given integer into this ring. Read more
Source§impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i16>
impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i16>
Source§fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i16
fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i16
Maps the given integer into this ring. Read more
Source§impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i32>
impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i32>
Source§fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i32
fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i32
Maps the given integer into this ring. Read more
Source§impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i64>
impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i64>
Source§fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i64
fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i64
Maps the given integer into this ring. Read more
Source§impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i8>
impl<A: Allocator + Clone> IntCast<RustBigintRingBase<A>> for StaticRingBase<i8>
Source§fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i8
fn cast(&self, from: &RustBigintRingBase<A>, value: RustBigint<A>) -> i8
Maps the given integer into this ring. Read more
Source§impl<A: Allocator + Clone> IntCast<StaticRingBase<i128>> for RustBigintRingBase<A>
impl<A: Allocator + Clone> IntCast<StaticRingBase<i128>> for RustBigintRingBase<A>
Source§fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> RustBigint<A>
fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> RustBigint<A>
Maps the given integer into this ring. Read more
Source§impl IntCast<StaticRingBase<i128>> for StaticRingBase<i128>
impl IntCast<StaticRingBase<i128>> for StaticRingBase<i128>
Source§impl IntCast<StaticRingBase<i128>> for StaticRingBase<i16>
impl IntCast<StaticRingBase<i128>> for StaticRingBase<i16>
Source§impl IntCast<StaticRingBase<i128>> for StaticRingBase<i32>
impl IntCast<StaticRingBase<i128>> for StaticRingBase<i32>
Source§impl IntCast<StaticRingBase<i128>> for StaticRingBase<i64>
impl IntCast<StaticRingBase<i128>> for StaticRingBase<i64>
Source§impl IntCast<StaticRingBase<i128>> for StaticRingBase<i8>
impl IntCast<StaticRingBase<i128>> for StaticRingBase<i8>
Source§impl<A: Allocator + Clone> IntCast<StaticRingBase<i16>> for RustBigintRingBase<A>
impl<A: Allocator + Clone> IntCast<StaticRingBase<i16>> for RustBigintRingBase<A>
Source§fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> RustBigint<A>
fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> RustBigint<A>
Maps the given integer into this ring. Read more
Source§impl IntCast<StaticRingBase<i16>> for StaticRingBase<i128>
impl IntCast<StaticRingBase<i16>> for StaticRingBase<i128>
Source§impl IntCast<StaticRingBase<i16>> for StaticRingBase<i16>
impl IntCast<StaticRingBase<i16>> for StaticRingBase<i16>
Source§impl IntCast<StaticRingBase<i16>> for StaticRingBase<i32>
impl IntCast<StaticRingBase<i16>> for StaticRingBase<i32>
Source§impl IntCast<StaticRingBase<i16>> for StaticRingBase<i64>
impl IntCast<StaticRingBase<i16>> for StaticRingBase<i64>
Source§impl IntCast<StaticRingBase<i16>> for StaticRingBase<i8>
impl IntCast<StaticRingBase<i16>> for StaticRingBase<i8>
Source§impl<A: Allocator + Clone> IntCast<StaticRingBase<i32>> for RustBigintRingBase<A>
impl<A: Allocator + Clone> IntCast<StaticRingBase<i32>> for RustBigintRingBase<A>
Source§fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> RustBigint<A>
fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> RustBigint<A>
Maps the given integer into this ring. Read more
Source§impl IntCast<StaticRingBase<i32>> for StaticRingBase<i128>
impl IntCast<StaticRingBase<i32>> for StaticRingBase<i128>
Source§impl IntCast<StaticRingBase<i32>> for StaticRingBase<i16>
impl IntCast<StaticRingBase<i32>> for StaticRingBase<i16>
Source§impl IntCast<StaticRingBase<i32>> for StaticRingBase<i32>
impl IntCast<StaticRingBase<i32>> for StaticRingBase<i32>
Source§impl IntCast<StaticRingBase<i32>> for StaticRingBase<i64>
impl IntCast<StaticRingBase<i32>> for StaticRingBase<i64>
Source§impl IntCast<StaticRingBase<i32>> for StaticRingBase<i8>
impl IntCast<StaticRingBase<i32>> for StaticRingBase<i8>
Source§impl<A: Allocator + Clone> IntCast<StaticRingBase<i64>> for RustBigintRingBase<A>
impl<A: Allocator + Clone> IntCast<StaticRingBase<i64>> for RustBigintRingBase<A>
Source§fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> RustBigint<A>
fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> RustBigint<A>
Maps the given integer into this ring. Read more
Source§impl IntCast<StaticRingBase<i64>> for StaticRingBase<i128>
impl IntCast<StaticRingBase<i64>> for StaticRingBase<i128>
Source§impl IntCast<StaticRingBase<i64>> for StaticRingBase<i16>
impl IntCast<StaticRingBase<i64>> for StaticRingBase<i16>
Source§impl IntCast<StaticRingBase<i64>> for StaticRingBase<i32>
impl IntCast<StaticRingBase<i64>> for StaticRingBase<i32>
Source§impl IntCast<StaticRingBase<i64>> for StaticRingBase<i64>
impl IntCast<StaticRingBase<i64>> for StaticRingBase<i64>
Source§impl IntCast<StaticRingBase<i64>> for StaticRingBase<i8>
impl IntCast<StaticRingBase<i64>> for StaticRingBase<i8>
Source§impl<A: Allocator + Clone> IntCast<StaticRingBase<i8>> for RustBigintRingBase<A>
impl<A: Allocator + Clone> IntCast<StaticRingBase<i8>> for RustBigintRingBase<A>
Source§fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> RustBigint<A>
fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> RustBigint<A>
Maps the given integer into this ring. Read more
Source§impl IntCast<StaticRingBase<i8>> for StaticRingBase<i128>
impl IntCast<StaticRingBase<i8>> for StaticRingBase<i128>
Source§impl IntCast<StaticRingBase<i8>> for StaticRingBase<i16>
impl IntCast<StaticRingBase<i8>> for StaticRingBase<i16>
Source§impl IntCast<StaticRingBase<i8>> for StaticRingBase<i32>
impl IntCast<StaticRingBase<i8>> for StaticRingBase<i32>
Source§impl IntCast<StaticRingBase<i8>> for StaticRingBase<i64>
impl IntCast<StaticRingBase<i8>> for StaticRingBase<i64>
Source§impl IntCast<StaticRingBase<i8>> for StaticRingBase<i8>
impl IntCast<StaticRingBase<i8>> for StaticRingBase<i8>
Source§impl<T> IntegerPolyGCDRing for StaticRingBase<T>where
T: PrimitiveInt,
impl<T> IntegerPolyGCDRing for StaticRingBase<T>where
T: PrimitiveInt,
Source§type LocalRingAsZnBase<'ring> = <StaticRingBase<T> as PolyGCDLocallyDomain>::LocalRingBase<'ring>
where
Self: 'ring
type LocalRingAsZnBase<'ring> = <StaticRingBase<T> as PolyGCDLocallyDomain>::LocalRingBase<'ring> where Self: 'ring
Available on crate feature
unstable-enable
only.It would be much preferrable if we could restrict associated types from supertraits,
this is just a workaround (and an ugly one at that)
Source§type LocalRingAsZn<'ring> = <StaticRingBase<T> as PolyGCDLocallyDomain>::LocalRing<'ring>
where
Self: 'ring
type LocalRingAsZn<'ring> = <StaticRingBase<T> as PolyGCDLocallyDomain>::LocalRing<'ring> where Self: 'ring
Available on crate feature
unstable-enable
only.Source§fn local_ring_as_zn<'a, 'ring>(
&self,
local_field: &'a Self::LocalRing<'ring>,
) -> &'a Self::LocalRingAsZn<'ring>where
Self: 'ring,
fn local_ring_as_zn<'a, 'ring>(
&self,
local_field: &'a Self::LocalRing<'ring>,
) -> &'a Self::LocalRingAsZn<'ring>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Source§fn local_ring_into_zn<'ring>(
&self,
local_field: Self::LocalRing<'ring>,
) -> Self::LocalRingAsZn<'ring>where
Self: 'ring,
fn local_ring_into_zn<'ring>(
&self,
local_field: Self::LocalRing<'ring>,
) -> Self::LocalRingAsZn<'ring>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Source§fn principal_ideal_generator<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
) -> El<BigIntRing>where
Self: 'ring,
fn principal_ideal_generator<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
) -> El<BigIntRing>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Source§impl<T: PrimitiveInt> IntegerRing for StaticRingBase<T>
impl<T: PrimitiveInt> IntegerRing for StaticRingBase<T>
Source§fn to_float_approx(&self, value: &Self::Element) -> f64
fn to_float_approx(&self, value: &Self::Element) -> f64
Computes a float value that is “close” to the given integer. Read more
Source§fn from_float_approx(&self, value: f64) -> Option<Self::Element>
fn from_float_approx(&self, value: f64) -> Option<Self::Element>
Computes a value that is “close” to the given float. However, no guarantees
are made on the definition of close, in particular, this does not have to be
the closest integer to the given float, and cannot be used to compute rounding.
It is also implementation-defined when to return
None
, although this is usually
the case on infinity and NaN. Read moreSource§fn abs_highest_set_bit(&self, value: &Self::Element) -> Option<usize>
fn abs_highest_set_bit(&self, value: &Self::Element) -> Option<usize>
Returns the index of the highest set bit in the two-complements representation of
abs(value)
,
or None
if the value is zero. Read moreSource§fn abs_lowest_set_bit(&self, value: &Self::Element) -> Option<usize>
fn abs_lowest_set_bit(&self, value: &Self::Element) -> Option<usize>
Returns the index of the lowest set bit in the two-complements representation of
abs(value)
,
or None
if the value is zero. Read moreSource§fn euclidean_div_pow_2(&self, value: &mut Self::Element, power: usize)
fn euclidean_div_pow_2(&self, value: &mut Self::Element, power: usize)
Computes the euclidean division by a power of two, always rounding to zero (note that
euclidean division requires that
|remainder| < |divisor|
, and thus would otherwise
leave multiple possible results). Read moreSource§fn mul_pow_2(&self, value: &mut Self::Element, power: usize)
fn mul_pow_2(&self, value: &mut Self::Element, power: usize)
Multiplies the element by a power of two.
Source§fn get_uniformly_random_bits<G: FnMut() -> u64>(
&self,
log2_bound_exclusive: usize,
rng: G,
) -> Self::Element
fn get_uniformly_random_bits<G: FnMut() -> u64>( &self, log2_bound_exclusive: usize, rng: G, ) -> Self::Element
Computes a uniformly random integer in
[0, 2^log_bound_exclusive - 1]
, assuming that
rng
provides uniformly random values in the whole range of u64
.Source§fn representable_bits(&self) -> Option<usize>
fn representable_bits(&self) -> Option<usize>
Returns
n
such that this ring can represent at least [-2^n, ..., 2^n - 1]
.
Returning None
means that the size of representable integers is unbounded.Source§fn rounded_div(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element
fn rounded_div(&self, lhs: Self::Element, rhs: &Self::Element) -> Self::Element
Computes the rounded division, i.e. rounding to the closest integer.
In the case of a tie (i.e.
round(0.5)
), we round towards +/- infinity
. Read moreSource§fn power_of_two(&self, power: usize) -> Self::Element
fn power_of_two(&self, power: usize) -> Self::Element
Returns the value
2^power
in this integer ring.Source§impl<T> InterpolationBaseRing for StaticRingBase<T>where
T: PrimitiveInt,
impl<T> InterpolationBaseRing for StaticRingBase<T>where
T: PrimitiveInt,
Source§type ExtendedRing<'a> = RingRef<'a, StaticRingBase<T>>
where
Self: 'a
type ExtendedRing<'a> = RingRef<'a, StaticRingBase<T>> where Self: 'a
Available on crate feature
unstable-enable
only.Source§type ExtendedRingBase<'a> = StaticRingBase<T>
where
Self: 'a
type ExtendedRingBase<'a> = StaticRingBase<T> where Self: 'a
Available on crate feature
unstable-enable
only.The type of the extension ring we can switch to to get more points. Read more
Source§fn in_base<'a, S>(&self, _ext_ring: S, el: El<S>) -> Option<Self::Element>where
Self: 'a,
S: RingStore<Type = Self::ExtendedRingBase<'a>>,
fn in_base<'a, S>(&self, _ext_ring: S, el: El<S>) -> Option<Self::Element>where
Self: 'a,
S: RingStore<Type = Self::ExtendedRingBase<'a>>,
Available on crate feature
unstable-enable
only.Source§fn in_extension<'a, S>(&self, _ext_ring: S, el: Self::Element) -> El<S>where
Self: 'a,
S: RingStore<Type = Self::ExtendedRingBase<'a>>,
fn in_extension<'a, S>(&self, _ext_ring: S, el: Self::Element) -> El<S>where
Self: 'a,
S: RingStore<Type = Self::ExtendedRingBase<'a>>,
Available on crate feature
unstable-enable
only.Source§fn interpolation_points<'a>(
&'a self,
count: usize,
) -> (Self::ExtendedRing<'a>, Vec<El<Self::ExtendedRing<'a>>>)
fn interpolation_points<'a>( &'a self, count: usize, ) -> (Self::ExtendedRing<'a>, Vec<El<Self::ExtendedRing<'a>>>)
Available on crate feature
unstable-enable
only.Returns
count
points such that the difference between any two of them
is a non-zero-divisor. Read moreSource§impl KaratsubaHint for StaticRingBase<i128>
impl KaratsubaHint for StaticRingBase<i128>
Source§fn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
KaratsubaAlgorithm
will use the Karatsuba algorithm. Read moreSource§impl KaratsubaHint for StaticRingBase<i16>
impl KaratsubaHint for StaticRingBase<i16>
Source§fn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
KaratsubaAlgorithm
will use the Karatsuba algorithm. Read moreSource§impl KaratsubaHint for StaticRingBase<i32>
impl KaratsubaHint for StaticRingBase<i32>
Source§fn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
KaratsubaAlgorithm
will use the Karatsuba algorithm. Read moreSource§impl KaratsubaHint for StaticRingBase<i64>
impl KaratsubaHint for StaticRingBase<i64>
Source§fn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
KaratsubaAlgorithm
will use the Karatsuba algorithm. Read moreSource§impl KaratsubaHint for StaticRingBase<i8>
impl KaratsubaHint for StaticRingBase<i8>
Source§fn karatsuba_threshold(&self) -> usize
fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
KaratsubaAlgorithm
will use the Karatsuba algorithm. Read moreSource§impl<T: PrimitiveInt> OrderedRing for StaticRingBase<T>
impl<T: PrimitiveInt> OrderedRing for StaticRingBase<T>
Source§fn is_leq(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn is_leq(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
Returns whether
lhs <= rhs
.Source§fn is_geq(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn is_geq(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
Returns whether
lhs >= rhs
.Source§impl<T> PartialEq for StaticRingBase<T>
impl<T> PartialEq for StaticRingBase<T>
Source§impl<T> PolyGCDLocallyDomain for StaticRingBase<T>where
T: PrimitiveInt,
impl<T> PolyGCDLocallyDomain for StaticRingBase<T>where
T: PrimitiveInt,
Source§type LocalRing<'ring> = RingValue<ZnBase<RingValue<MPZBase>>>
where
Self: 'ring
type LocalRing<'ring> = RingValue<ZnBase<RingValue<MPZBase>>> where Self: 'ring
Available on crate feature
unstable-enable
only.Source§type LocalRingBase<'ring> = ZnBase<RingValue<MPZBase>>
where
Self: 'ring
type LocalRingBase<'ring> = ZnBase<RingValue<MPZBase>> where Self: 'ring
Available on crate feature
unstable-enable
only.The type of the local ring once we quotiented out a power of a prime ideal.
Source§type LocalFieldBase<'ring> = AsFieldBase<RingValue<ZnBase>>
where
Self: 'ring
type LocalFieldBase<'ring> = AsFieldBase<RingValue<ZnBase>> where Self: 'ring
Available on crate feature
unstable-enable
only.The type of the field we get by quotienting out a power of a prime ideal. Read more
Source§type LocalField<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>>
where
Self: 'ring
type LocalField<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>> where Self: 'ring
Available on crate feature
unstable-enable
only.Source§type SuitableIdeal<'ring> = i64
where
Self: 'ring
type SuitableIdeal<'ring> = i64 where Self: 'ring
Available on crate feature
unstable-enable
only.An ideal of the ring for which we know a decomposition into maximal ideals, and
can use Hensel lifting to lift values to higher powers of this ideal.
Source§fn reconstruct_ring_el<'local, 'element, 'ring, V1, V2>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: V1,
_e: usize,
x: V2,
) -> Self::Element
fn reconstruct_ring_el<'local, 'element, 'ring, V1, V2>( &self, _p: &Self::SuitableIdeal<'ring>, from: V1, _e: usize, x: V2, ) -> Self::Element
Available on crate feature
unstable-enable
only.Computes a “small” element
x in R
such that x mod mi^e
is equal to the given value,
for every maximal ideal mi
over I
.
In cases where the factors of polynomials in R[X]
do not necessarily have coefficients
in R
, this function might have to do rational reconstruction.Source§fn maximal_ideal_factor_count<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
) -> usizewhere
Self: 'ring,
fn maximal_ideal_factor_count<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
) -> usizewhere
Self: 'ring,
Available on crate feature
unstable-enable
only.Returns the number of maximal ideals in the primary decomposition of
ideal
.Source§fn lift_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRingBase<'ring>, usize),
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
fn lift_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRingBase<'ring>, usize),
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes any element
y
in R / mi^to_e
such that y = x mod mi^from_e
.
In particular, y
does not have to be “short” in any sense, but any lift
is a valid result.Source§fn local_field_at<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
max_ideal_idx: usize,
) -> Self::LocalField<'ring>where
Self: 'ring,
fn local_field_at<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
max_ideal_idx: usize,
) -> Self::LocalField<'ring>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Source§fn local_ring_at<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
e: usize,
max_ideal_idx: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
fn local_ring_at<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
e: usize,
max_ideal_idx: usize,
) -> Self::LocalRing<'ring>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Returns
R / mi^e
, where mi
is the i
-th maximal ideal over I
.Source§fn random_suitable_ideal<'ring, F>(
&'ring self,
rng: F,
) -> Self::SuitableIdeal<'ring>
fn random_suitable_ideal<'ring, F>( &'ring self, rng: F, ) -> Self::SuitableIdeal<'ring>
Available on crate feature
unstable-enable
only.Returns an ideal sampled at random from the interval of all supported ideals.
Source§fn base_ring_to_field<'ring>(
&self,
_ideal: &Self::SuitableIdeal<'ring>,
from: &Self::LocalRingBase<'ring>,
to: &Self::LocalFieldBase<'ring>,
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalField<'ring>>where
Self: 'ring,
fn base_ring_to_field<'ring>(
&self,
_ideal: &Self::SuitableIdeal<'ring>,
from: &Self::LocalRingBase<'ring>,
to: &Self::LocalFieldBase<'ring>,
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalField<'ring>>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes the isomorphism between the ring and field representations of
R / mi
Source§fn field_to_base_ring<'ring>(
&self,
_ideal: &Self::SuitableIdeal<'ring>,
from: &Self::LocalFieldBase<'ring>,
to: &Self::LocalRingBase<'ring>,
max_ideal_idx: usize,
x: El<Self::LocalField<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
fn field_to_base_ring<'ring>(
&self,
_ideal: &Self::SuitableIdeal<'ring>,
from: &Self::LocalFieldBase<'ring>,
to: &Self::LocalRingBase<'ring>,
max_ideal_idx: usize,
x: El<Self::LocalField<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes the isomorphism between the ring and field representations of
R / mi
Source§fn reduce_ring_el<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: Self::Element,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
fn reduce_ring_el<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: Self::Element,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes the reduction map Read more
Source§fn reduce_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRingBase<'ring>, usize),
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
fn reduce_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRingBase<'ring>, usize),
to: (&Self::LocalRingBase<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
Available on crate feature
unstable-enable
only.Computes the reduction map Read more
Source§fn heuristic_exponent<'ring, 'a, I>(
&self,
p: &i64,
poly_deg: usize,
coefficients: I,
) -> usize
fn heuristic_exponent<'ring, 'a, I>( &self, p: &i64, poly_deg: usize, coefficients: I, ) -> usize
Available on crate feature
unstable-enable
only.Returns an exponent
e
such that we hope that the factors of a polynomial of given degree,
involving the given coefficient can already be read of (via PolyGCDLocallyDomain::reconstruct_ring_el()
)
their reductions modulo I^e
. Note that this is just a heuristic, and if it does not work,
the implementation will gradually try larger e
. Thus, even if this function returns constant
1, correctness will not be affected, but giving a good guess can improve performanceSource§impl<T: PrimitiveInt> PrincipalIdealRing for StaticRingBase<T>
impl<T: PrimitiveInt> PrincipalIdealRing for StaticRingBase<T>
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>
Similar to
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)
Computes a Bezout identity for the generator
g
of the ideal (lhs, rhs)
as g = s * lhs + t * rhs
. Read moreSource§fn annihilator(&self, val: &Self::Element) -> Self::Element
fn annihilator(&self, val: &Self::Element) -> Self::Element
Source§fn create_elimination_matrix(
&self,
a: &Self::Element,
b: &Self::Element,
) -> ([Self::Element; 4], Self::Element)
fn create_elimination_matrix( &self, a: &Self::Element, b: &Self::Element, ) -> ([Self::Element; 4], Self::Element)
Creates a matrix
A
of unit determinant such that A * (a, b)^T = (d, 0)
.
Returns (A, d)
.Source§fn ideal_gen(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn ideal_gen(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
Computes a generator
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,
) -> Self::Elementwhere
Controller: ComputationController,
fn ideal_gen_with_controller<Controller>(
&self,
lhs: &Self::Element,
rhs: &Self::Element,
_: Controller,
) -> Self::Elementwhere
Controller: ComputationController,
As
PrincipalIdealRing::ideal_gen()
, this computes a generator of the ideal (lhs, rhs)
.
However, it additionally accepts a ComputationController
to customize the performed
computation.Source§impl<T: PrimitiveInt> RingBase for StaticRingBase<T>
impl<T: PrimitiveInt> RingBase for StaticRingBase<T>
fn clone_el(&self, val: &Self::Element) -> Self::Element
fn add_assign(&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 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
Returns whether the ring is commutative, i.e.
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
Returns whether the ring is noetherian, i.e. every ideal is finitely generated. Read more
Source§fn dbg_within<'a>(
&self,
value: &Self::Element,
out: &mut Formatter<'a>,
_: EnvBindingStrength,
) -> Result
fn dbg_within<'a>( &self, value: &Self::Element, out: &mut Formatter<'a>, _: EnvBindingStrength, ) -> Result
Writes a human-readable representation of
value
to out
, taking into account the possible context
to place parenthesis as needed. Read moreSource§fn characteristic<I: RingStore>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
fn characteristic<I: RingStore>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
Returns the characteristic of this ring as an element of the given
implementation of
ZZ
. Read moreSource§fn pow_gen<R: RingStore>(
&self,
x: Self::Element,
power: &El<R>,
integers: R,
) -> Self::Elementwhere
R::Type: IntegerRing,
fn pow_gen<R: RingStore>(
&self,
x: Self::Element,
power: &El<R>,
integers: R,
) -> Self::Elementwhere
R::Type: IntegerRing,
Raises
x
to the power of an arbitrary, nonnegative integer given by
a custom integer ring implementation. Read moreSource§fn is_approximate(&self) -> bool
fn is_approximate(&self) -> bool
Returns whether this ring computes with approximations to elements.
This would usually be the case for rings that are based on
f32
or
f64
, to represent real or complex numbers. Read morefn add_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn sub_assign_ref(&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 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
Fused-multiply-add. This computes
summand + lhs * rhs
.fn square(&self, value: &mut Self::Element)
fn negate(&self, value: Self::Element) -> Self::Element
fn sub_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn mul_assign_int(&self, lhs: &mut Self::Element, rhs: i32)
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
Fused-multiply-add with an integer. This computes
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)
Computes
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)
Computes
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(&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<T: PrimitiveInt> SerializableElementRing for StaticRingBase<T>
impl<T: PrimitiveInt> SerializableElementRing for StaticRingBase<T>
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>,
Available on crate feature
unstable-enable
only.Deserializes an element of this ring from the given deserializer.
Source§impl<T: PrimitiveInt> Serialize for StaticRingBase<T>
impl<T: PrimitiveInt> Serialize for StaticRingBase<T>
Source§impl StrassenHint for StaticRingBase<i128>
impl StrassenHint for StaticRingBase<i128>
Source§fn strassen_threshold(&self) -> usize
fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read moreSource§impl StrassenHint for StaticRingBase<i16>
impl StrassenHint for StaticRingBase<i16>
Source§fn strassen_threshold(&self) -> usize
fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read moreSource§impl StrassenHint for StaticRingBase<i32>
impl StrassenHint for StaticRingBase<i32>
Source§fn strassen_threshold(&self) -> usize
fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read moreSource§impl StrassenHint for StaticRingBase<i64>
impl StrassenHint for StaticRingBase<i64>
Source§fn strassen_threshold(&self) -> usize
fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read moreSource§impl StrassenHint for StaticRingBase<i8>
impl StrassenHint for StaticRingBase<i8>
Source§fn strassen_threshold(&self) -> usize
fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read moreimpl<T> Copy for StaticRingBase<T>
impl<T: PrimitiveInt> Domain for StaticRingBase<T>
Auto Trait Implementations§
impl<T> Freeze for StaticRingBase<T>
impl<T> RefUnwindSafe for StaticRingBase<T>where
T: RefUnwindSafe,
impl<T> Send for StaticRingBase<T>where
T: Send,
impl<T> Sync for StaticRingBase<T>where
T: Sync,
impl<T> Unpin for StaticRingBase<T>where
T: Unpin,
impl<T> UnwindSafe for StaticRingBase<T>where
T: 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
Source§impl<I, J> CanHomFrom<I> for J
impl<I, J> CanHomFrom<I> for J
Source§type Homomorphism = ()
type Homomorphism = ()
Data required to compute the action of the canonical homomorphism on ring elements.
Source§fn has_canonical_hom(&self, _: &I) -> Option<<J as CanHomFrom<I>>::Homomorphism>
fn has_canonical_hom(&self, _: &I) -> Option<<J as CanHomFrom<I>>::Homomorphism>
If there is a canonical 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: &I,
el: <I as RingBase>::Element,
_: &<J as CanHomFrom<I>>::Homomorphism,
) -> <J as RingBase>::Element
fn map_in( &self, from: &I, el: <I as RingBase>::Element, _: &<J as CanHomFrom<I>>::Homomorphism, ) -> <J as RingBase>::Element
Evaluates the homomorphism.
Source§default fn map_in_ref(
&self,
from: &I,
el: &<I as RingBase>::Element,
hom: &<J as CanHomFrom<I>>::Homomorphism,
) -> <J as RingBase>::Element
default fn map_in_ref( &self, from: &I, el: &<I as RingBase>::Element, hom: &<J as CanHomFrom<I>>::Homomorphism, ) -> <J as RingBase>::Element
Evaluates the homomorphism, taking the element by reference.
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, )
Evaluates the homomorphism on
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, )
Evaluates the homomorphism on
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
Fused-multiply-add. Computes
summand + lhs * rhs
, where rhs
is mapped into the ring via the homomorphism.Source§impl<I, J> CanIsoFromTo<I> for J
impl<I, J> CanIsoFromTo<I> for J
Source§type Isomorphism = ()
type Isomorphism = ()
Data required to compute a preimage under the canonical homomorphism.
Source§fn has_canonical_iso(
&self,
_: &I,
) -> Option<<J as CanIsoFromTo<I>>::Isomorphism>
fn has_canonical_iso( &self, _: &I, ) -> Option<<J as CanIsoFromTo<I>>::Isomorphism>
If there is a canonical homomorphism
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: &I,
el: <J as RingBase>::Element,
_: &<J as CanIsoFromTo<I>>::Isomorphism,
) -> <I as RingBase>::Element
fn map_out( &self, from: &I, el: <J as RingBase>::Element, _: &<J as CanIsoFromTo<I>>::Isomorphism, ) -> <I as RingBase>::Element
Computes the preimage of
el
under the canonical homomorphism from -> self
.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
Available on crate feature
unstable-enable
only.Computes the inner product
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
Available on crate feature
unstable-enable
only.Computes the inner product
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, )
👎Deprecated
Should compute
(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>,
Should compute
(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, )
👎Deprecated
Should compute
(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>,
Should compute
(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)
Possibly pre-processes elements before the FFT starts. Here you can
bring ring element into a certain form, and assume during
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)
Possibly pre-processes elements before the inverse FFT starts. Here you can
bring ring element into a certain form, and assume during
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>,
Available on crate feature
unstable-enable
only.Should compute
(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>,
Available on crate feature
unstable-enable
only.Should compute
(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>
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 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>
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 moreSource§impl<R> KaratsubaHint for R
impl<R> KaratsubaHint for R
Source§default fn karatsuba_threshold(&self) -> usize
default fn karatsuba_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
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> PolyTFracGCDRing for R
impl<R> PolyTFracGCDRing for R
Source§default fn power_decomposition<P>(
poly_ring: P,
poly: &<<P as RingStore>::Type as RingBase>::Element,
) -> Vec<(<<P as RingStore>::Type as RingBase>::Element, usize)>
default fn power_decomposition<P>( poly_ring: P, poly: &<<P as RingStore>::Type as RingBase>::Element, ) -> Vec<(<<P as RingStore>::Type as RingBase>::Element, usize)>
Compute square-free polynomials
f1, f2, ...
such that a f = f1 f2^2 f3^3 ...
for some non-zero-divisor a
of this ring. They are returned as tuples (fi, i)
where deg(fi) > 0
. Read moreSource§default fn power_decomposition_with_controller<P, Controller>(
poly_ring: P,
poly: &<<P as RingStore>::Type as RingBase>::Element,
controller: Controller,
) -> Vec<(<<P as RingStore>::Type as RingBase>::Element, usize)>where
P: RingStore + Copy,
<P as RingStore>::Type: PolyRing + DivisibilityRing,
<<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,
Controller: ComputationController,
default fn power_decomposition_with_controller<P, Controller>(
poly_ring: P,
poly: &<<P as RingStore>::Type as RingBase>::Element,
controller: Controller,
) -> Vec<(<<P as RingStore>::Type as RingBase>::Element, usize)>where
P: RingStore + Copy,
<P as RingStore>::Type: PolyRing + DivisibilityRing,
<<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,
Controller: ComputationController,
As
PolyTFracGCDRing::power_decomposition()
, this writes a polynomial as a product
of powers of square-free polynomials. However, it additionally accepts a ComputationController
to customize the performed computation.Source§default fn gcd<P>(
poly_ring: P,
lhs: &<<P as RingStore>::Type as RingBase>::Element,
rhs: &<<P as RingStore>::Type as RingBase>::Element,
) -> <<P as RingStore>::Type as RingBase>::Element
default fn gcd<P>( poly_ring: P, lhs: &<<P as RingStore>::Type as RingBase>::Element, rhs: &<<P as RingStore>::Type as RingBase>::Element, ) -> <<P as RingStore>::Type as RingBase>::Element
Computes the greatest common divisor of two polynomials
f, g
over the fraction field,
which is the largest-degree polynomial d
such that d | a f, a g
for some non-zero-divisor
a
of this ring. Read moreSource§fn gcd_with_controller<P, Controller>(
poly_ring: P,
lhs: &<<P as RingStore>::Type as RingBase>::Element,
rhs: &<<P as RingStore>::Type as RingBase>::Element,
controller: Controller,
) -> <<P as RingStore>::Type as RingBase>::Elementwhere
P: RingStore + Copy,
<P as RingStore>::Type: PolyRing + DivisibilityRing,
<<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,
Controller: ComputationController,
fn gcd_with_controller<P, Controller>(
poly_ring: P,
lhs: &<<P as RingStore>::Type as RingBase>::Element,
rhs: &<<P as RingStore>::Type as RingBase>::Element,
controller: Controller,
) -> <<P as RingStore>::Type as RingBase>::Elementwhere
P: RingStore + Copy,
<P as RingStore>::Type: PolyRing + DivisibilityRing,
<<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,
Controller: ComputationController,
As
PolyTFracGCDRing::gcd()
, this computes the gcd of two polynomials.
However, it additionally accepts a ComputationController
to customize
the performed computation.Source§fn squarefree_part<P>(poly_ring: P, poly: &El<P>) -> El<P>where
P: RingStore + Copy,
P::Type: PolyRing + DivisibilityRing,
<P::Type as RingExtension>::BaseRing: RingStore<Type = Self>,
fn squarefree_part<P>(poly_ring: P, poly: &El<P>) -> El<P>where
P: RingStore + Copy,
P::Type: PolyRing + DivisibilityRing,
<P::Type as RingExtension>::BaseRing: RingStore<Type = Self>,
Computes the square-free part of a polynomial
f
, which is the largest-degree squarefree
polynomial d
such that d | a f
for some non-zero-divisor a
of this ring. Read moreSource§impl<R> StrassenHint for R
impl<R> StrassenHint for R
Source§default fn strassen_threshold(&self) -> usize
default fn strassen_threshold(&self) -> usize
Available on crate feature
unstable-enable
only.Define a threshold from which on
StrassenAlgorithm
will use the Strassen algorithm. Read more