pub struct MPZBase;Available on crate feature
mpir only.Expand description
Arbitrary-precision integer ring, implemented by binding to the well-known and heavily optimized library mpir (fork of gmp).
Implementations§
Source§impl MPZBase
impl MPZBase
pub fn from_base_u64_repr(&self, dst: &mut MPZEl, input: &[u64])
pub fn abs_base_u64_repr_len(&self, src: &MPZEl) -> usize
pub fn abs_base_u64_repr(&self, src: &MPZEl, out: &mut [u64])
Trait Implementations§
Source§impl DivisibilityRing for MPZBase
impl DivisibilityRing for MPZBase
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§type PreparedDivisorData = ()
type PreparedDivisorData = ()
Additional data associated to a fixed ring element that can be used
to speed up division by this ring element. Read more
Source§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 prepare_divisor(&self, x: Self::Element) -> PreparedDivisor<Self>
fn prepare_divisor(&self, x: Self::Element) -> PreparedDivisor<Self>
“Prepares” an element of this ring for division. Read more
Source§fn checked_left_div_prepared(
&self,
lhs: &Self::Element,
rhs: &PreparedDivisor<Self>,
) -> Option<Self::Element>
fn checked_left_div_prepared( &self, lhs: &Self::Element, rhs: &PreparedDivisor<Self>, ) -> Option<Self::Element>
Same as
DivisibilityRing::checked_left_div() but for a prepared divisor. Read moreSource§fn divides_left_prepared(
&self,
lhs: &Self::Element,
rhs: &PreparedDivisor<Self>,
) -> bool
fn divides_left_prepared( &self, lhs: &Self::Element, rhs: &PreparedDivisor<Self>, ) -> 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 EuclideanRing for MPZBase
impl EuclideanRing for MPZBase
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_rem(
&self,
lhs: Self::Element,
rhs: &Self::Element,
) -> Self::Element
fn euclidean_rem( &self, lhs: Self::Element, rhs: &Self::Element, ) -> Self::Element
Computes only the remainder of euclidean division. Read more
Source§fn euclidean_div(
&self,
lhs: Self::Element,
rhs: &Self::Element,
) -> Self::Element
fn euclidean_div( &self, lhs: Self::Element, rhs: &Self::Element, ) -> Self::Element
Computes euclidean division without 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 FiniteRingSpecializable for MPZBase
impl FiniteRingSpecializable for MPZBase
fn specialize<O: FiniteRingOperation<Self>>(_op: O) -> Result<O::Output, ()>
fn is_finite_ring() -> bool
Source§impl HashableElRing for MPZBase
impl HashableElRing for MPZBase
Source§impl IntCast<MPZBase> for RustBigintRingBase
impl IntCast<MPZBase> for RustBigintRingBase
Source§impl IntCast<RustBigintRingBase> for MPZBase
impl IntCast<RustBigintRingBase> for MPZBase
Source§fn cast(&self, _: &RustBigintRingBase, el: RustBigint) -> Self::Element
fn cast(&self, _: &RustBigintRingBase, el: RustBigint) -> Self::Element
Maps the given integer into this ring. Read more
Source§impl IntegerPolyGCDRing for MPZBase
impl IntegerPolyGCDRing for MPZBase
Source§type LocalRingAsZnBase<'ring> = <MPZBase as PolyGCDLocallyDomain>::LocalRingBase<'ring>
where
Self: 'ring
type LocalRingAsZnBase<'ring> = <MPZBase as PolyGCDLocallyDomain>::LocalRingBase<'ring> where Self: 'ring
It would be much preferrable if we could restrict associated types from supertraits,
this is just a workaround (and an ugly one at that)
type LocalRingAsZn<'ring> = <MPZBase as PolyGCDLocallyDomain>::LocalRing<'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,
fn principal_ideal_generator<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
) -> i64where
Self: 'ring,
Source§impl IntegerRing for MPZBase
impl IntegerRing for MPZBase
Source§fn to_float_approx(&self, el: &Self::Element) -> f64
fn to_float_approx(&self, el: &Self::Element) -> f64
Computes a float value that is “close” to the given integer. Read more
Source§fn from_float_approx(&self, el: f64) -> Option<Self::Element>
fn from_float_approx(&self, el: 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 mul_pow_2(&self, el: &mut Self::Element, power: usize)
fn mul_pow_2(&self, el: &mut Self::Element, power: usize)
Multiplies the element by a power of two.
Source§fn euclidean_div_pow_2(&self, el: &mut Self::Element, power: usize)
fn euclidean_div_pow_2(&self, el: &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 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 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 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 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 OrderedRing for MPZBase
impl OrderedRing for MPZBase
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 PolyGCDLocallyDomain for MPZBase
impl PolyGCDLocallyDomain for MPZBase
type LocalRing<'ring> = RingValue<ZnBase<RingValue<MPZBase>>> where Self: 'ring
Source§type LocalRingBase<'ring> = ZnBase<RingValue<MPZBase>>
where
Self: 'ring
type LocalRingBase<'ring> = ZnBase<RingValue<MPZBase>> where Self: 'ring
The proper way would be to define this with two lifetime parameters
'ring and 'data,
see also crate::compute_locally::EvaluatePolyLocallyRing::LocalRingBasetype LocalFieldBase<'ring> = AsFieldBase<RingValue<ZnBase>> where Self: 'ring
type LocalField<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>> where Self: 'ring
type SuitableIdeal<'ring> = i64 where Self: 'ring
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
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.fn maximal_ideal_factor_count<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
) -> usizewhere
Self: 'ring,
Source§fn lift_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRing<'ring>, usize),
to: (&Self::LocalRing<'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::LocalRing<'ring>, usize),
to: (&Self::LocalRing<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
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,
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,
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>
Returns an ideal sampled at random from the interval of all supported ideals.
Source§fn reduce_ring_el<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
to: (&Self::LocalRing<'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::LocalRing<'ring>, usize),
max_ideal_idx: usize,
x: Self::Element,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
Computes the reduction map Read more
Source§fn reduce_partial<'ring>(
&self,
_p: &Self::SuitableIdeal<'ring>,
from: (&Self::LocalRing<'ring>, usize),
to: (&Self::LocalRing<'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::LocalRing<'ring>, usize),
to: (&Self::LocalRing<'ring>, usize),
max_ideal_idx: usize,
x: El<Self::LocalRing<'ring>>,
) -> El<Self::LocalRing<'ring>>where
Self: 'ring,
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
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 performancefn dbg_ideal<'ring>(
&self,
p: &Self::SuitableIdeal<'ring>,
out: &mut Formatter<'_>,
) -> Resultwhere
Self: 'ring,
Source§impl PrincipalIdealRing for MPZBase
impl PrincipalIdealRing for MPZBase
Source§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 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 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§impl RingBase for MPZBase
impl RingBase for MPZBase
fn clone_el(&self, val: &Self::Element) -> Self::Element
fn mul_ref(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element
fn negate_inplace(&self, lhs: &mut Self::Element)
fn zero(&self) -> Self::Element
fn one(&self) -> 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 add_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)
fn add_assign_ref(&self, lhs: &mut Self::Element, rhs: &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 mul_assign_int(&self, lhs: &mut Self::Element, rhs: i32)
fn sub(&self, lhs: Self::Element, rhs: Self::Element) -> Self::Element
fn from_int(&self, value: i32) -> Self::Element
fn eq_el(&self, lhs: &Self::Element, rhs: &Self::Element) -> bool
fn is_zero(&self, val: &Self::Element) -> bool
fn is_one(&self, val: &Self::Element) -> bool
fn is_neg_one(&self, val: &Self::Element) -> bool
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 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_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 moreSource§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
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: IntegerRingStore + Copy>(
&self,
other_ZZ: I,
) -> Option<El<I>>where
I::Type: IntegerRing,
fn characteristic<I: IntegerRingStore + Copy>(
&self,
other_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 morefn sub_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)
fn neg_one(&self) -> Self::Element
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_int(&self, lhs: Self::Element, rhs: i32) -> Self::Element
fn mul_int_ref(&self, lhs: &Self::Element, rhs: i32) -> Self::Element
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 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§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§impl SerializableElementRing for MPZBase
impl SerializableElementRing for MPZBase
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>,
Deserializes an element of this ring from the given deserializer.
impl Copy for MPZBase
impl Domain for MPZBase
impl Eq for MPZBase
impl StructuralPartialEq for MPZBase
Auto Trait Implementations§
impl Freeze for MPZBase
impl RefUnwindSafe for MPZBase
impl Send for MPZBase
impl Sync for MPZBase
impl Unpin for MPZBase
impl UnwindSafe for MPZBase
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
type Homomorphism = ()
fn has_canonical_hom(&self, _: &I) -> Option<<J as CanHomFrom<I>>::Homomorphism>
fn map_in( &self, from: &I, el: <I as RingBase>::Element, _: &<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
fn mul_assign_map_in( &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, )
Source§impl<I, J> CanIsoFromTo<I> for J
impl<I, J> CanIsoFromTo<I> for J
type Isomorphism = ()
fn has_canonical_iso( &self, _: &I, ) -> Option<<J as CanIsoFromTo<I>>::Isomorphism>
fn map_out( &self, from: &I, el: <J as RingBase>::Element, _: &<J as CanIsoFromTo<I>>::Isomorphism, ) -> <I as RingBase>::Element
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
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
Computes the inner product
sum_i lhs[i] * rhs[i].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, )
Should compute
(values[i1], values[i2]) := (values[i1] + twiddle * values[i2], values[i1] - twiddle * values[i2])Source§impl<I> EvaluatePolyLocallyRing for Iwhere
I: IntegerRing,
impl<I> EvaluatePolyLocallyRing for Iwhere
I: IntegerRing,
type LocalComputationData<'ring> = RingValue<ZnBase<RingValue<AsFieldBase<RingValue<ZnBase>>>, RingRef<'ring, I>>> where I: 'ring
type LocalRing<'ring> = RingValue<AsFieldBase<RingValue<ZnBase>>> where I: 'ring
Source§type LocalRingBase<'ring> = AsFieldBase<RingValue<ZnBase>>
where
I: 'ring
type LocalRingBase<'ring> = AsFieldBase<RingValue<ZnBase>> where I: 'ring
The proper way would be to define this with two lifetime parameters
'ring and 'data,
to allow it to reference both the ring itself and the current LocalComputationData.
However, when doing this, I ran into the compiler bug
https://github.com/rust-lang/rust/issues/100013. Read moreSource§fn ln_pseudo_norm(&self, el: &<I as RingBase>::Element) -> f64
fn ln_pseudo_norm(&self, el: &<I as RingBase>::Element) -> f64
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,
) -> <I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>
fn local_computation<'ring>( &'ring self, ln_pseudo_norm_bound: f64, ) -> <I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>
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: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
i: usize,
) -> <I as EvaluatePolyLocallyRing>::LocalRing<'ring>where
I: 'ring,
fn local_ring_at<'ring>(
&self,
computation: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
i: usize,
) -> <I as EvaluatePolyLocallyRing>::LocalRing<'ring>where
I: 'ring,
Returns the
i-th local ring belonging to the given computation.Source§fn local_ring_count<'ring>(
&self,
computation: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
) -> usizewhere
I: 'ring,
fn local_ring_count<'ring>(
&self,
computation: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
) -> usizewhere
I: 'ring,
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: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
el: &<I as RingBase>::Element,
) -> Vec<<<I as EvaluatePolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element>where
I: 'ring,
fn reduce<'ring>(
&self,
computation: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
el: &<I as RingBase>::Element,
) -> Vec<<<I as EvaluatePolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element>where
I: 'ring,
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: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
el: &[<<I as EvaluatePolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element],
) -> <I as RingBase>::Elementwhere
I: 'ring,
fn lift_combine<'ring>(
&self,
computation: &<I as EvaluatePolyLocallyRing>::LocalComputationData<'ring>,
el: &[<<I as EvaluatePolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element],
) -> <I as RingBase>::Elementwhere
I: 'ring,
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 EvaluatePolyLocallyRing::reduce(). 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
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 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 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
Define a threshold from which on
StrassenAlgorithm will use the Strassen algorithm. Read more