Skip to main content

AsFieldBase

Struct AsFieldBase 

Source
pub struct AsFieldBase<R: RingStore>{ /* private fields */ }
Expand description

A wrapper around a ring that marks this ring to be a perfect field. In particular, the functions provided by DivisibilityRing will be used to provide field-like division for the wrapped ring.

§Example

A common case where you might encounter AsFieldBase is when working with rings which might or might not be a field depending on data only known at runtime. One example are implementations of ZnRing with modulus chosen at runtime.

// 7 is a prime, so this is a field - but must be checked at runtime
let Fp_as_ring = Zn::new(7);
// we use `ZnRing::as_field()` to make this a field
let Fp_as_field: AsField<Zn> = Fp_as_ring.as_field().ok().unwrap();
// in many cases (like here) we can use canonical isomorphisms to map elements
let iso = Fp_as_field.can_iso(&Fp_as_ring).unwrap();
assert_el_eq!(&Fp_as_ring, Fp_as_ring.one(), iso.map(Fp_as_field.one()));

Since the canonical isomorphisms are not given by blanket implementations (unfortunately there are some conflicts…), they are often not available in generic contexts. In this case, the currently best solution is to directly use the functions given by DelegateRing, e.g.

fn work_in_Fp<R>(ring: R)
    where R: RingStore,
        R::Type: ZnRing
{
    use crate::feanor_math::delegate::DelegateRing;
 
    let R_as_field = (&ring).as_field().ok().unwrap();
    let x = ring.one();
    // since `DelegateRing` does not have a corresponding `RingStore`, the access
    // through `get_ring()` is necessary
    let x_mapped = R_as_field.get_ring().rev_delegate(x);
    let x_mapped_back = R_as_field.get_ring().delegate(x_mapped);
}

The alternative is to explicitly use WrapHom and UnwrapHom.

Implementations§

Source§

impl<R: RingStore> AsFieldBase<R>

Source

pub fn promise_is_perfect_field(base: R) -> Self

Assumes that the given ring is a perfect field, and wraps it in AsFieldBase.

This function is not really unsafe, but users should be careful to only use it with rings that are perfect fields. This cannot be checked in here, so must be checked by the caller.

Source

pub fn promise_is_field(base: R) -> Result<Self, R>

Available on crate feature unstable-enable only.

Assumes that the given ring is a field and checks whether it is perfect. If this is the case, the function wraps it in AsFieldBase.

This function is not really unsafe, but users should be careful to only use it with rings that are fields. This cannot be checked in here, so must be checked by the caller.

Note that this function does check that the passed field is perfect. However, that check is too conservative, and might fail on some perfect fields. If you are sure that the field is also perfect, consider using AsFieldBase::promise_is_perfect_field() instead.

§Availability

This API is marked as unstable and is only available when the unstable-enable crate feature is enabled. This comes with no stability guarantees, and could be changed or removed at any time.

Source

pub fn unwrap_element(&self, el: <Self as RingBase>::Element) -> El<R>

Source

pub fn unwrap_self(self) -> R

Removes the wrapper, returning the underlying base field.

Source§

impl<R: RingStore> AsFieldBase<R>
where R::Type: PerfectField,

Source

pub fn from_field(base: R) -> Self

Creates a new AsFieldBase from a ring that is already known to be a perfect field.

Trait Implementations§

Source§

impl<AsFieldRingStore, R1, V1, A1, C1, R2, V2, A2, C2> CanHomFrom<AsFieldBase<AsFieldRingStore>> for FreeAlgebraImplBase<R2, V2, A2, C2>
where AsFieldRingStore: RingStore<Type = FreeAlgebraImplBase<R1, V1, A1, C1>>, R1: RingStore, R1::Type: LinSolveRing, V1: VectorView<El<R1>>, A1: Allocator + Clone, C1: ConvolutionAlgorithm<R1::Type>, R2: RingStore, R2::Type: LinSolveRing + CanHomFrom<R1::Type>, V2: VectorView<El<R2>>, A2: Allocator + Clone, C2: ConvolutionAlgorithm<R2::Type>,

Source§

type Homomorphism = <FreeAlgebraImplBase<R2, V2, A2, C2> as CanHomFrom<FreeAlgebraImplBase<R1, V1, A1, C1>>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> 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( &self, from: &AsFieldBase<AsFieldRingStore>, el: FieldEl<AsFieldRingStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore> CanHomFrom<AsFieldBase<AsFieldRingStore>> for ZnBase
where AsFieldRingStore: RingStore<Type = ZnBase>,

Source§

type Homomorphism = <ZnBase as CanHomFrom<ZnBase>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> 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( &self, from: &AsFieldBase<AsFieldRingStore>, el: FieldEl<AsFieldRingStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore, I, J> CanHomFrom<AsFieldBase<AsFieldRingStore>> for ZnBase<J>
where AsFieldRingStore: RingStore<Type = ZnBase<I>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

type Homomorphism = <ZnBase<J> as CanHomFrom<ZnBase<I>>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> 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( &self, from: &AsFieldBase<AsFieldRingStore>, el: FieldEl<AsFieldRingStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<R1, R2> CanHomFrom<AsFieldBase<R1>> for AsLocalPIRBase<R2>

Source§

type Homomorphism = <<R2 as RingStore>::Type as CanHomFrom<<R1 as RingStore>::Type>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &AsFieldBase<R1>, ) -> 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( &self, from: &AsFieldBase<R1>, el: <AsFieldBase<R1> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<R: RingStore, S: RingStore> CanHomFrom<AsFieldBase<S>> for AsFieldBase<R>

Source§

type Homomorphism = <<R as RingStore>::Type as CanHomFrom<<S as RingStore>::Type>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom(&self, from: &AsFieldBase<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( &self, from: &AsFieldBase<S>, el: FieldEl<S>, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<R1, R2> CanHomFrom<AsLocalPIRBase<R1>> for AsFieldBase<R2>

Source§

type Homomorphism = <<R2 as RingStore>::Type as CanHomFrom<<R1 as RingStore>::Type>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<R1>, ) -> 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( &self, from: &AsLocalPIRBase<R1>, el: <AsLocalPIRBase<R1> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore, R1, V1, A1, C1, R2, V2, A2, C2> CanHomFrom<FreeAlgebraImplBase<R1, V1, A1, C1>> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = FreeAlgebraImplBase<R2, V2, A2, C2>>, R1: RingStore, R1::Type: LinSolveRing, V1: VectorView<El<R1>>, A1: Allocator + Clone, C1: ConvolutionAlgorithm<R1::Type>, R2: RingStore, R2::Type: LinSolveRing + CanHomFrom<R1::Type>, V2: VectorView<El<R2>>, A2: Allocator + Clone, C2: ConvolutionAlgorithm<R2::Type>,

Source§

type Homomorphism = <FreeAlgebraImplBase<R2, V2, A2, C2> as CanHomFrom<FreeAlgebraImplBase<R1, V1, A1, C1>>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &FreeAlgebraImplBase<R1, V1, A1, C1>, ) -> 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( &self, from: &FreeAlgebraImplBase<R1, V1, A1, C1>, el: <FreeAlgebraImplBase<R1, V1, A1, C1> as RingBase>::Element, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<Impl, R, A, V, C> CanHomFrom<GaloisFieldBase<Impl>> for AsFieldBase<FreeAlgebraImpl<R, V, A, C>>

For the rationale which blanket implementations I chose, see the GaloisFieldBase.

Source§

type Homomorphism = <FreeAlgebraImplBase<R, V, A, C> as CanHomFrom<<Impl as RingStore>::Type>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom( &self, from: &GaloisFieldBase<Impl>, ) -> 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( &self, from: &GaloisFieldBase<Impl>, el: <GaloisFieldBase<Impl> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<R: RingStore, S: IntegerRing + ?Sized> CanHomFrom<S> for AsFieldBase<R>

Necessary to potentially implement crate::rings::zn::ZnRing.

Source§

type Homomorphism = <<R as RingStore>::Type as CanHomFrom<S>>::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>

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: &S, el: S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore, I, J> CanHomFrom<ZnBase<I>> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = ZnBase<J>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

type Homomorphism = <ZnBase<J> as CanHomFrom<ZnBase<I>>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom(&self, from: &ZnBase<I>) -> 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( &self, from: &ZnBase<I>, el: <ZnBase<I> as RingBase>::Element, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<I> CanHomFrom<ZnBase<I>> for AsFieldBase<Zn>
where I: RingStore, I::Type: IntegerRing,

Source§

type Homomorphism = <ZnBase as CanHomFrom<ZnBase<I>>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom(&self, from: &ZnBase<I>) -> 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( &self, from: &ZnBase<I>, el: <ZnBase<I> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore> CanHomFrom<ZnBase> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = ZnBase>,

Source§

type Homomorphism = <ZnBase as CanHomFrom<ZnBase>>::Homomorphism

Data required to compute the action of the canonical homomorphism on ring elements.
Source§

fn has_canonical_hom(&self, from: &ZnBase) -> 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( &self, from: &ZnBase, el: <ZnBase as RingBase>::Element, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Evaluates the homomorphism.
Source§

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, )

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, )

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

Fused-multiply-add. Computes summand + lhs * rhs, where rhs is mapped into the ring via the homomorphism.
Source§

impl<AsFieldRingStore, R1, V1, A1, C1, R2, V2, A2, C2> CanIsoFromTo<AsFieldBase<AsFieldRingStore>> for FreeAlgebraImplBase<R2, V2, A2, C2>
where AsFieldRingStore: RingStore<Type = FreeAlgebraImplBase<R1, V1, A1, C1>>, R1: RingStore, R1::Type: LinSolveRing, V1: VectorView<El<R1>>, A1: Allocator + Clone, C1: ConvolutionAlgorithm<R1::Type>, R2: RingStore, R2::Type: LinSolveRing + CanIsoFromTo<R1::Type>, V2: VectorView<El<R2>>, A2: Allocator + Clone, C2: ConvolutionAlgorithm<R2::Type>,

Source§

type Isomorphism = <FreeAlgebraImplBase<R2, V2, A2, C2> as CanIsoFromTo<FreeAlgebraImplBase<R1, V1, A1, C1>>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> Option<Self::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: &AsFieldBase<AsFieldRingStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> FieldEl<AsFieldRingStore>

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<AsFieldRingStore> CanIsoFromTo<AsFieldBase<AsFieldRingStore>> for ZnBase
where AsFieldRingStore: RingStore<Type = ZnBase>,

Source§

type Isomorphism = <ZnBase as CanIsoFromTo<ZnBase>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> Option<Self::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: &AsFieldBase<AsFieldRingStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> FieldEl<AsFieldRingStore>

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<AsFieldRingStore, I, J> CanIsoFromTo<AsFieldBase<AsFieldRingStore>> for ZnBase<J>
where AsFieldRingStore: RingStore<Type = ZnBase<I>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

type Isomorphism = <ZnBase<J> as CanIsoFromTo<ZnBase<I>>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &AsFieldBase<AsFieldRingStore>, ) -> Option<Self::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: &AsFieldBase<AsFieldRingStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> FieldEl<AsFieldRingStore>

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<R1, R2> CanIsoFromTo<AsFieldBase<R1>> for AsLocalPIRBase<R2>

Source§

type Isomorphism = <<R2 as RingStore>::Type as CanIsoFromTo<<R1 as RingStore>::Type>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso(&self, from: &AsFieldBase<R1>) -> Option<Self::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: &AsFieldBase<R1>, el: Self::Element, iso: &Self::Isomorphism, ) -> <AsFieldBase<R1> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<R: RingStore, S: RingStore> CanIsoFromTo<AsFieldBase<S>> for AsFieldBase<R>

Source§

type Isomorphism = <<R as RingStore>::Type as CanIsoFromTo<<S as RingStore>::Type>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso(&self, from: &AsFieldBase<S>) -> Option<Self::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: &AsFieldBase<S>, el: Self::Element, iso: &Self::Isomorphism, ) -> FieldEl<S>

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<R1, R2> CanIsoFromTo<AsLocalPIRBase<R1>> for AsFieldBase<R2>

Source§

type Isomorphism = <<R2 as RingStore>::Type as CanIsoFromTo<<R1 as RingStore>::Type>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<R1>, ) -> Option<Self::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: &AsLocalPIRBase<R1>, el: Self::Element, iso: &Self::Isomorphism, ) -> <AsLocalPIRBase<R1> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<AsFieldRingStore, R1, V1, A1, C1, R2, V2, A2, C2> CanIsoFromTo<FreeAlgebraImplBase<R1, V1, A1, C1>> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = FreeAlgebraImplBase<R2, V2, A2, C2>>, R1: RingStore, R1::Type: LinSolveRing, V1: VectorView<El<R1>>, A1: Allocator + Clone, C1: ConvolutionAlgorithm<R1::Type>, R2: RingStore, R2::Type: LinSolveRing + CanIsoFromTo<R1::Type>, V2: VectorView<El<R2>>, A2: Allocator + Clone, C2: ConvolutionAlgorithm<R2::Type>,

Source§

type Isomorphism = <FreeAlgebraImplBase<R2, V2, A2, C2> as CanIsoFromTo<FreeAlgebraImplBase<R1, V1, A1, C1>>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &FreeAlgebraImplBase<R1, V1, A1, C1>, ) -> Option<Self::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: &FreeAlgebraImplBase<R1, V1, A1, C1>, el: <Self as RingBase>::Element, iso: &Self::Isomorphism, ) -> <FreeAlgebraImplBase<R1, V1, A1, C1> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<Impl, R, A, V, C> CanIsoFromTo<GaloisFieldBase<Impl>> for AsFieldBase<FreeAlgebraImpl<R, V, A, C>>

For the rationale which blanket implementations I chose, see the GaloisFieldBase.

Source§

type Isomorphism = <FreeAlgebraImplBase<R, V, A, C> as CanIsoFromTo<<Impl as RingStore>::Type>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso( &self, from: &GaloisFieldBase<Impl>, ) -> Option<Self::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: &GaloisFieldBase<Impl>, el: Self::Element, iso: &Self::Isomorphism, ) -> <GaloisFieldBase<Impl> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<AsFieldRingStore, I, J> CanIsoFromTo<ZnBase<I>> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = ZnBase<J>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

type Isomorphism = <ZnBase<J> as CanIsoFromTo<ZnBase<I>>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso(&self, from: &ZnBase<I>) -> Option<Self::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: &ZnBase<I>, el: <Self as RingBase>::Element, iso: &Self::Isomorphism, ) -> <ZnBase<I> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<I> CanIsoFromTo<ZnBase<I>> for AsFieldBase<Zn>
where I: RingStore, I::Type: IntegerRing,

Source§

type Isomorphism = <ZnBase as CanIsoFromTo<ZnBase<I>>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso(&self, from: &ZnBase<I>) -> Option<Self::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: &ZnBase<I>, el: Self::Element, hom: &Self::Isomorphism, ) -> <ZnBase<I> as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<AsFieldRingStore> CanIsoFromTo<ZnBase> for AsFieldBase<AsFieldRingStore>
where AsFieldRingStore: RingStore<Type = ZnBase>,

Source§

type Isomorphism = <ZnBase as CanIsoFromTo<ZnBase>>::Isomorphism

Data required to compute a preimage under the canonical homomorphism.
Source§

fn has_canonical_iso(&self, from: &ZnBase) -> Option<Self::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: &ZnBase, el: <Self as RingBase>::Element, iso: &Self::Isomorphism, ) -> <ZnBase as RingBase>::Element

Computes the preimage of el under the canonical homomorphism from -> self.
Source§

impl<R> Clone for AsFieldBase<R>

Source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. Read more
Source§

impl<R: RingStore> ComputeInnerProduct for AsFieldBase<R>

Source§

fn inner_product<I: Iterator<Item = (Self::Element, Self::Element)>>( &self, els: I, ) -> Self::Element

Available on crate feature unstable-enable only.
Computes the inner product sum_i lhs[i] * rhs[i].
Source§

fn inner_product_ref<'a, I: Iterator<Item = (&'a Self::Element, &'a Self::Element)>>( &self, els: I, ) -> Self::Element
where Self::Element: 'a, Self: 'a,

Available on crate feature unstable-enable only.
Computes the inner product sum_i lhs[i] * rhs[i].
Source§

fn inner_product_ref_fst<'a, I: Iterator<Item = (&'a Self::Element, Self::Element)>>( &self, els: I, ) -> Self::Element
where Self::Element: 'a, Self: 'a,

Available on crate feature unstable-enable only.
Computes the inner product sum_i lhs[i] * rhs[i].
Source§

impl<R> Debug for AsFieldBase<R>

Source§

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

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

impl<R: RingStore> DelegateRing for AsFieldBase<R>

Source§

type Element = FieldEl<R>

Type of elements of this ring. These should always wrap elements from the delegated-to ring, but may store additional data.
Source§

type Base = <R as RingStore>::Type

Type of the delegated-to ring.
Source§

fn get_delegate(&self) -> &Self::Base

Returns a reference to the delegated-to ring, which is used by all other default implementations to actually implement arithmetic operations.
Source§

fn delegate(&self, el: Self::Element) -> <Self::Base as RingBase>::Element

Creates an element of the delegated-to ring, representing the given element from this ring.
Source§

fn delegate_mut<'a>( &self, el: &'a mut Self::Element, ) -> &'a mut <Self::Base as RingBase>::Element

Provides a mutable reference to the delegated-to ring element stored in the given element from this ring.
Source§

fn delegate_ref<'a>( &self, el: &'a Self::Element, ) -> &'a <Self::Base as RingBase>::Element

Provides a reference to the delegated-to ring element stored in the given element from this ring.
Source§

fn rev_delegate(&self, el: <Self::Base as RingBase>::Element) -> Self::Element

Creates an element of this ring, representing the given element from the delegated-to ring.
Source§

fn postprocess_delegate_mut(&self, el: &mut Self::Element)

Called after every operation of the delegated-to ring that accepts a mutable reference (which is acquired using DelegateRing::delegate_mut()). Read more
Source§

fn element_cast(&self, el: Self::Element) -> <Self as RingBase>::Element

Necessary in some locations to satisfy the type system
Source§

fn rev_element_cast(&self, el: <Self as RingBase>::Element) -> Self::Element

Necessary in some locations to satisfy the type system
Source§

fn rev_element_cast_ref<'a>( &self, el: &'a <Self as RingBase>::Element, ) -> &'a Self::Element

Necessary in some locations to satisfy the type system
Source§

fn rev_element_cast_mut<'a>( &self, el: &'a mut <Self as RingBase>::Element, ) -> &'a mut Self::Element

Necessary in some locations to satisfy the type system
Source§

impl<'de, R> Deserialize<'de> for AsFieldBase<R>

Source§

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<R: RingStore> EuclideanRing for AsFieldBase<R>

Source§

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>

Defines how “small” an element is. For details, see EuclideanRing.
Source§

fn euclidean_rem(&self, _: 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

Computes euclidean division without remainder. Read more
Source§

impl<R: RingStore> Field for AsFieldBase<R>

Source§

fn div(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element

Computes the division lhs / rhs, where rhs != 0. Read more
Source§

impl<R> FromModulusCreateableZnRing for AsFieldBase<RingValue<R>>

Source§

fn from_modulus<F, E>(create_modulus: F) -> Result<Self, E>
where F: FnOnce(&Self::IntegerRingBase) -> Result<El<Self::IntegerRing>, E>,

Available on crate feature unstable-enable only.
Source§

impl<R> InterpolationBaseRing for AsFieldBase<R>

Source§

type ExtendedRingBase<'a> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRingBase<'a> 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§

type ExtendedRing<'a> = <<R as RingStore>::Type as InterpolationBaseRing>::ExtendedRing<'a> where Self: 'a

Available on crate feature unstable-enable only.
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>>,

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>>,

Available on crate feature unstable-enable only.
Source§

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

impl<I: RingStore> InterpolationBaseRing for AsFieldBase<Zn<I>>
where I::Type: IntegerRing,

Source§

type ExtendedRingBase<'a> = GaloisFieldBase<RingValue<AsFieldBase<RingValue<FreeAlgebraImplBase<RingRef<'a, AsFieldBase<RingValue<ZnBase<I>>>>, SparseMapVector<RingRef<'a, AsFieldBase<RingValue<ZnBase<I>>>>>>>>>> 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§

type ExtendedRing<'a> = RingValue<GaloisFieldBase<RingValue<AsFieldBase<RingValue<FreeAlgebraImplBase<RingRef<'a, AsFieldBase<RingValue<ZnBase<I>>>>, SparseMapVector<RingRef<'a, AsFieldBase<RingValue<ZnBase<I>>>>>>>>>>> where Self: 'a

Available on crate feature unstable-enable only.
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>>,

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>>,

Available on crate feature unstable-enable only.
Source§

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

impl InterpolationBaseRing for AsFieldBase<Zn>

Source§

type ExtendedRingBase<'a> = GaloisFieldBase<RingValue<AsFieldBase<RingValue<FreeAlgebraImplBase<RingRef<'a, AsFieldBase<RingValue<ZnBase>>>, SparseMapVector<RingRef<'a, AsFieldBase<RingValue<ZnBase>>>>>>>>> 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§

type ExtendedRing<'a> = RingValue<GaloisFieldBase<RingValue<AsFieldBase<RingValue<FreeAlgebraImplBase<RingRef<'a, AsFieldBase<RingValue<ZnBase>>>, SparseMapVector<RingRef<'a, AsFieldBase<RingValue<ZnBase>>>>>>>>>> where Self: 'a

Available on crate feature unstable-enable only.
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>>,

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>>,

Available on crate feature unstable-enable only.
Source§

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

impl<R: RingStore> KaratsubaHint for AsFieldBase<R>

Source§

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

impl<R> PartialEq for AsFieldBase<R>

Source§

fn eq(&self, other: &Self) -> bool

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

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

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

impl<R: RingStore> PrincipalIdealRing for AsFieldBase<R>

Source§

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

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

fn annihilator(&self, val: &Self::Element) -> Self::Element

Returns the (w.r.t. divisibility) smallest element x such that x * val = 0. Read more
Source§

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

Computes a generator g of the ideal (lhs, rhs) = (g), also known as greatest common divisor. Read more
Source§

fn ideal_gen_with_controller<Controller>( &self, lhs: &Self::Element, rhs: &Self::Element, _: Controller, ) -> Self::Element
where 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§

fn lcm(&self, lhs: &Self::Element, rhs: &Self::Element) -> Self::Element

Computes a generator of the ideal (lhs) ∩ (rhs), also known as least common multiple. Read more
Source§

impl<R: RingStore> PrincipalLocalRing for AsFieldBase<R>

Source§

fn max_ideal_gen(&self) -> &Self::Element

Available on crate feature unstable-enable only.
Returns a generator p or the unique maximal ideal (p) of this ring. Read more
Source§

fn nilpotent_power(&self) -> Option<usize>

Available on crate feature unstable-enable only.
Returns the smallest nonnegative integer e such that p^e = 0 where p is the generator of the maximal ideal.
Source§

fn valuation(&self, x: &Self::Element) -> Option<usize>

Available on crate feature unstable-enable only.
Returns the largest nonnegative integer e such that p^e | x where p is the generator of the maximal ideal.
Source§

impl<R> Serialize for AsFieldBase<R>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<R: RingStore> StrassenHint for AsFieldBase<R>

Source§

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

impl<R> Copy for AsFieldBase<R>
where R: RingStore + Copy, R::Type: DivisibilityRing, El<R>: Copy,

Source§

impl<R: RingStore> DelegateRingImplFiniteRing for AsFieldBase<R>

Source§

impl<R: RingStore> Domain for AsFieldBase<R>

Source§

impl<R> PerfectField for AsFieldBase<R>

Auto Trait Implementations§

§

impl<R> Freeze for AsFieldBase<R>
where R: Freeze, <<R as RingStore>::Type as RingBase>::Element: Freeze,

§

impl<R> RefUnwindSafe for AsFieldBase<R>

§

impl<R> Send for AsFieldBase<R>
where R: Send, <<R as RingStore>::Type as RingBase>::Element: Send,

§

impl<R> Sync for AsFieldBase<R>
where R: Sync, <<R as RingStore>::Type as RingBase>::Element: Sync,

§

impl<R> Unpin for AsFieldBase<R>
where R: Unpin, <<R as RingStore>::Type as RingBase>::Element: Unpin,

§

impl<R> UnwindSafe for AsFieldBase<R>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

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

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<R> ComputeFrobeniusRing for R
where R: Field + FiniteRing + ?Sized,

Source§

type FrobeniusData = UnsafeAnyFrobeniusDataGuarded<R>

Available on crate feature unstable-enable only.
Source§

default fn create_frobenius( &self, exponent_of_p: usize, ) -> (<R as ComputeFrobeniusRing>::FrobeniusData, usize)

Available on crate feature unstable-enable only.
Source§

default fn apply_frobenius( &self, _frobenius_data: &<R as ComputeFrobeniusRing>::FrobeniusData, exponent_of_p: usize, x: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Available on crate feature unstable-enable only.
Source§

impl<R> ComputeInnerProduct for R
where R: RingBase + ?Sized,

Source§

default fn inner_product_ref_fst<'a, I>( &self, els: I, ) -> <R as RingBase>::Element
where I: Iterator<Item = (&'a <R as RingBase>::Element, <R as RingBase>::Element)>, <R as RingBase>::Element: 'a,

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
where I: Iterator<Item = (&'a <R as RingBase>::Element, &'a <R as RingBase>::Element)>, <R as RingBase>::Element: 'a,

Available on crate feature unstable-enable only.
Computes the inner product sum_i lhs[i] * rhs[i].
Source§

default fn inner_product<I>(&self, els: I) -> <R as RingBase>::Element
where I: Iterator<Item = (<R as RingBase>::Element, <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

Source§

default fn resultant<P>( ring: P, f: <<P as RingStore>::Type as RingBase>::Element, g: <<P as RingStore>::Type as RingBase>::Element, ) -> <<<<P as RingStore>::Type as RingExtension>::BaseRing as RingStore>::Type as RingBase>::Element
where P: RingStore + Copy, <P as RingStore>::Type: PolyRing, <<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,

Available on crate feature unstable-enable only.
Computes the resultant of f and g over the base ring. Read more
Source§

impl<R, S> CooleyTuckeyButterfly<S> for R
where S: RingBase + ?Sized, R: RingBase + ?Sized,

Source§

default fn butterfly<V, H>( &self, hom: H, values: &mut V, twiddle: &<S as RingBase>::Element, i1: usize, i2: usize, )
where V: VectorViewMut<<R as RingBase>::Element>, H: Homomorphism<S, R>,

👎Deprecated
Should compute (values[i1], values[i2]) := (values[i1] + twiddle * values[i2], values[i1] - twiddle * values[i2]). Read more
Source§

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

default fn inv_butterfly<V, H>( &self, hom: H, values: &mut V, twiddle: &<S as RingBase>::Element, i1: usize, i2: usize, )
where V: VectorViewMut<<R as RingBase>::Element>, H: Homomorphism<S, R>,

👎Deprecated
Should compute (values[i1], values[i2]) := (values[i1] + values[i2], (values[i1] - values[i2]) * twiddle) Read more
Source§

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

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)

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
where R: RingBase + ?Sized, S: RingBase + ?Sized,

Source§

default fn prepare_for_fft(&self, _value: &mut <R as RingBase>::Element)

Available on crate feature 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.

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>,

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

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

impl<R> DivisibilityRing for R

Source§

type PreparedDivisorData = <<R as DelegateRing>::Base as DivisibilityRing>::PreparedDivisorData

Additional data associated to a fixed ring element that can be used to speed up division by this ring element. Read more
Source§

default fn checked_left_div( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> Option<<R as RingBase>::Element>

Checks whether there is an element x such that rhs * x = lhs, and returns it if it exists. Read more
Source§

default fn balance_factor<'a, I>( &self, elements: I, ) -> Option<<R as RingBase>::Element>
where I: Iterator<Item = &'a <R as RingBase>::Element>, R: 'a,

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: &<R as RingBase>::Element, ) -> <R as DivisibilityRing>::PreparedDivisorData

“Prepares” an element of this ring for division. Read more
Source§

default fn checked_left_div_prepared( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, rhs_prep: &<R as DivisibilityRing>::PreparedDivisorData, ) -> Option<<R as RingBase>::Element>

Same as DivisibilityRing::checked_left_div() but for a prepared divisor. Read more
Source§

default fn divides_left_prepared( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, rhs_prep: &<R as DivisibilityRing>::PreparedDivisorData, ) -> bool

Same as DivisibilityRing::divides_left() but for a prepared divisor. Read more
Source§

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

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>

Same as DivisibilityRing::checked_left_div(), but requires a commutative ring.
Source§

fn is_unit(&self, x: &Self::Element) -> bool

Returns whether the given element is a unit, i.e. has an inverse.
Source§

fn is_unit_prepared(&self, x: &PreparedDivisor<Self>) -> bool

Same as DivisibilityRing::is_unit() but for a prepared divisor. Read more
Source§

fn invert(&self, el: &Self::Element) -> Option<Self::Element>

If the given element is a unit, returns its inverse, otherwise None. Read more
Source§

impl<R> EvalPolyLocallyRing for R
where R: FiniteRing + Field + Debug + SelfIso + ?Sized,

Source§

type LocalComputationData<'ring> = RingRef<'ring, R> where R: '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> = RingRef<'ring, R> where R: 'ring

Available on crate feature unstable-enable only.
Source§

type LocalRingBase<'ring> = R where R: '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: &<R as RingBase>::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, ) -> <R as EvalPolyLocallyRing>::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: &<R as EvalPolyLocallyRing>::LocalComputationData<'ring>, _i: usize, ) -> <R as EvalPolyLocallyRing>::LocalRing<'ring>
where R: '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: &<R as EvalPolyLocallyRing>::LocalComputationData<'ring>, ) -> usize
where R: '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: &<R as EvalPolyLocallyRing>::LocalComputationData<'ring>, el: &<R as RingBase>::Element, ) -> Vec<<<R as EvalPolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element>
where R: '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: &<R as EvalPolyLocallyRing>::LocalComputationData<'ring>, el: &[<<R as EvalPolyLocallyRing>::LocalRingBase<'ring> as RingBase>::Element], ) -> <R as RingBase>::Element
where R: '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 more
Source§

impl<R> FactorPolyField for R
where R: FiniteRing + Field + SelfIso + ?Sized,

Source§

fn factor_poly<P>( poly_ring: P, poly: &<<P as RingStore>::Type as RingBase>::Element, ) -> (Vec<(<<P as RingStore>::Type as RingBase>::Element, usize)>, <R as RingBase>::Element)
where P: RingStore + Copy, <P as RingStore>::Type: PolyRing + EuclideanRing, <<P as RingStore>::Type as RingExtension>::BaseRing: RingStore<Type = R>,

Factors a univariate polynomial with coefficients in this field into its irreducible factors. Read more
Source§

fn factor_poly_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)>, <R as RingBase>::Element)

As FactorPolyField::factor_poly(), this computes the factorization of a polynomial. However, it additionally accepts a ComputationController to customize the performed computation.
Source§

fn is_irred<P>(poly_ring: P, poly: &El<P>) -> bool
where P: RingStore + Copy, P::Type: PolyRing + EuclideanRing, <P::Type as RingExtension>::BaseRing: RingStore<Type = Self>,

Returns whether the given polynomial is irreducible over the base field. Read more
Source§

impl<R> FiniteRing for R

Source§

type ElementsIter<'a> = DelegateFiniteRingElementsIter<'a, R> where R: 'a

Type of the iterator returned by FiniteRing::elements(), which should iterate over all elements of the ring.
Source§

fn elements<'a>(&'a self) -> <R as FiniteRing>::ElementsIter<'a>

Returns an iterator over all elements of this ring. The order is not specified.
Source§

default fn random_element<G>(&self, rng: G) -> <R as RingBase>::Element
where G: FnMut() -> u64,

Returns a uniformly random element from this ring, using the randomness provided by rng.
Source§

default fn size<I>( &self, ZZ: I, ) -> Option<<<I as RingStore>::Type as RingBase>::Element>

Returns the number of elements in this ring, if it fits within the given integer ring.
Source§

impl<R> FiniteRingSpecializable for R

Source§

fn specialize<O>(op: O) -> <O as FiniteRingOperation<R>>::Output
where O: FiniteRingOperation<R>,

Available on crate feature unstable-enable only.
Source§

fn is_finite_ring() -> bool

Available on crate feature unstable-enable only.
Source§

impl<R> FreeAlgebra for R

Source§

type VectorRepresentation<'a> = <<R as DelegateRing>::Base as FreeAlgebra>::VectorRepresentation<'a> where R: 'a

Type of the canonical-basis representation of a ring element, as returned by FreeAlgebra::wrt_canonical_basis().
Source§

default fn canonical_gen(&self) -> <R as RingBase>::Element

Returns the fixed element that generates this ring as a free module over the base ring.
Source§

default fn from_canonical_basis<V>(&self, vec: V) -> <R as RingBase>::Element

Returns the element that has the given representation w.r.t. the canonical basis, that is the basis given by the powers x^i where x is the canonical generator given by FreeAlgebra::canonical_gen() and i goes from 0 to rank - 1. Read more
Source§

default fn rank(&self) -> usize

Returns the rank of this ring as a free module over the base ring.
Source§

default fn wrt_canonical_basis<'a>( &'a self, el: &'a <R as RingBase>::Element, ) -> <R as FreeAlgebra>::VectorRepresentation<'a>

Returns the representation of the element w.r.t. the canonical basis, that is the basis given by the powers x^i where x is the canonical generator given by FreeAlgebra::canonical_gen() and i goes from 0 to rank - 1. Read more
Source§

default fn mul_assign_gen_power( &self, el: &mut <R as RingBase>::Element, power: usize, )

Multiplies the given element by the power-th power of the canonical generator of this ring, as given by FreeAlgebra::canonical_gen().
Source§

fn from_canonical_basis_extended<V>(&self, vec: V) -> Self::Element
where V: IntoIterator<Item = El<Self::BaseRing>>,

Like FreeAlgebra::from_canonical_basis(), this computes the sum sum_i vec[i] * x^i where x is the canonical generator given by FreeAlgebra::canonical_gen(). Unlike FreeAlgebra::from_canonical_basis(), vec can return any number elements.
Source§

fn charpoly<P, H>(&self, el: &Self::Element, poly_ring: P, hom: H) -> El<P>

Computes the characteristic polynomial of the given element. Read more
Source§

fn minpoly<P, H>(&self, el: &Self::Element, poly_ring: P, hom: H) -> El<P>

Computes the (or a) minimal polynomial of the given element. Read more
Source§

fn trace(&self, el: Self::Element) -> El<Self::BaseRing>

Computes the trace of an element a in this ring extension, which is defined as the matrix trace of the multiplication-by-a map. Read more
Source§

fn discriminant(&self) -> El<Self::BaseRing>

Computes the discriminant of the canonical basis of this ring extension, which is defined as the determinant of the trace matrix (Tr(a^(i + j))), where a is the canonical generator of this ring extension. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<R> HashableElRing for R

Source§

default fn hash<H>(&self, el: &<R as RingBase>::Element, h: &mut H)
where H: Hasher,

Hashes the given ring element.
Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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

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

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

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

impl<R> KaratsubaHint for R
where R: RingBase + ?Sized,

Source§

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

impl<R> LinSolveRing for R

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, ) -> SolveResult

Tries to find a matrix X such that lhs * X = rhs. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<R> PolyGCDLocallyDomain for R

Source§

type LocalRingBase<'ring> = R where R: '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 LocalRing<'ring> = RingRef<'ring, R> where R: 'ring

Available on crate feature unstable-enable only.
Source§

type LocalFieldBase<'ring> = R where R: '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> = RingRef<'ring, R> where R: 'ring

Available on crate feature unstable-enable only.
Source§

type SuitableIdeal<'ring> = RingRef<'ring, R> where R: '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 heuristic_exponent<'ring, 'element, IteratorType>( &self, _maximal_ideal: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, _poly_deg: usize, _coefficients: IteratorType, ) -> usize
where IteratorType: Iterator<Item = &'element <R as RingBase>::Element>, R: 'element + 'ring,

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

fn maximal_ideal_factor_count<'ring>( &self, ideal: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, ) -> usize
where R: 'ring,

Available on crate feature unstable-enable only.
Returns the number of maximal ideals in the primary decomposition of ideal.
Source§

fn random_suitable_ideal<'ring, RandomNumberFunction>( &'ring self, rng: RandomNumberFunction, ) -> <R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>
where RandomNumberFunction: FnMut() -> u64,

Available on crate feature unstable-enable only.
Returns an ideal sampled at random from the interval of all supported ideals.
Source§

fn local_field_at<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, max_ideal_idx: usize, ) -> <R as PolyGCDLocallyDomain>::LocalField<'ring>
where R: 'ring,

Available on crate feature unstable-enable only.
Returns R / mi, where mi is the i-th maximal ideal over I. Read more
Source§

fn local_ring_at<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, e: usize, max_ideal_idx: usize, ) -> <R as PolyGCDLocallyDomain>::LocalRing<'ring>
where R: 'ring,

Available on crate feature unstable-enable only.
Returns R / mi^e, where mi is the i-th maximal ideal over I.
Source§

fn reduce_ring_el<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, to: (&<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, usize), max_ideal_idx: usize, x: <R as RingBase>::Element, ) -> <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element
where R: 'ring,

Available on crate feature unstable-enable only.
Computes the reduction map Read more
Source§

fn base_ring_to_field<'ring>( &self, _ideal: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: &<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, to: &<R as PolyGCDLocallyDomain>::LocalFieldBase<'ring>, max_ideal_idx: usize, x: <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element, ) -> <<<R as PolyGCDLocallyDomain>::LocalField<'ring> as RingStore>::Type as RingBase>::Element
where R: '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: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: &<R as PolyGCDLocallyDomain>::LocalFieldBase<'ring>, to: &<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, max_ideal_idx: usize, x: <<<R as PolyGCDLocallyDomain>::LocalField<'ring> as RingStore>::Type as RingBase>::Element, ) -> <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element
where R: 'ring,

Available on crate feature unstable-enable only.
Computes the isomorphism between the ring and field representations of R / mi
Source§

fn reduce_partial<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: (&<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, usize), to: (&<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, usize), max_ideal_idx: usize, x: <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element, ) -> <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element
where R: 'ring,

Available on crate feature unstable-enable only.
Computes the reduction map Read more
Source§

fn lift_partial<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: (&<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, usize), to: (&<R as PolyGCDLocallyDomain>::LocalRingBase<'ring>, usize), max_ideal_idx: usize, x: <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element, ) -> <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element
where R: '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 reconstruct_ring_el<'local, 'element, 'ring, V1, V2>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: V1, e: usize, x: V2, ) -> <R as RingBase>::Element
where 'ring: 'local, 'ring: 'element, R: 'ring, V1: VectorFn<&'local <R as PolyGCDLocallyDomain>::LocalRing<'ring>>, V2: VectorFn<&'element <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element>, <R as PolyGCDLocallyDomain>::LocalRing<'ring>: 'local, <<<R as PolyGCDLocallyDomain>::LocalRing<'ring> as RingStore>::Type as RingBase>::Element: '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 dbg_ideal<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, out: &mut Formatter<'_>, ) -> Result<(), Error>
where R: 'ring,

Available on crate feature unstable-enable only.
Source§

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)>

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

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)>

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

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

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>::Element

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>,

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

impl<R> RingBase for R

Source§

type Element = <R as DelegateRing>::Element

Type of elements of the ring
Source§

default fn clone_el( &self, val: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn add_assign_ref( &self, lhs: &mut <R as RingBase>::Element, rhs: &<R as RingBase>::Element, )

Source§

default fn add_assign( &self, lhs: &mut <R as RingBase>::Element, rhs: <R as RingBase>::Element, )

Source§

default fn sub_assign_ref( &self, lhs: &mut <R as RingBase>::Element, rhs: &<R as RingBase>::Element, )

Source§

default fn sub_self_assign( &self, lhs: &mut <R as RingBase>::Element, rhs: <R as RingBase>::Element, )

Computes lhs := rhs - lhs.
Source§

default fn sub_self_assign_ref( &self, lhs: &mut <R as RingBase>::Element, rhs: &<R as RingBase>::Element, )

Computes lhs := rhs - lhs.
Source§

default fn negate_inplace(&self, lhs: &mut <R as RingBase>::Element)

Source§

default fn mul_assign( &self, lhs: &mut <R as RingBase>::Element, rhs: <R as RingBase>::Element, )

Source§

default fn mul_assign_ref( &self, lhs: &mut <R as RingBase>::Element, rhs: &<R as RingBase>::Element, )

Source§

default fn square(&self, value: &mut <R as RingBase>::Element)

Source§

default fn zero(&self) -> <R as RingBase>::Element

Source§

default fn one(&self) -> <R as RingBase>::Element

Source§

default fn neg_one(&self) -> <R as RingBase>::Element

Source§

default fn from_int(&self, value: i32) -> <R as RingBase>::Element

Source§

default fn eq_el( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> bool

Source§

default fn is_zero(&self, value: &<R as RingBase>::Element) -> bool

Source§

default fn is_one(&self, value: &<R as RingBase>::Element) -> bool

Source§

default fn is_neg_one(&self, value: &<R as RingBase>::Element) -> bool

Source§

default 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§

default fn is_noetherian(&self) -> bool

Returns whether the ring is noetherian, i.e. every ideal is finitely generated. Read more
Source§

default fn dbg<'a>( &self, value: &<R as RingBase>::Element, out: &mut Formatter<'a>, ) -> Result<(), Error>

Writes a human-readable representation of value to out. Read more
Source§

default fn dbg_within<'a>( &self, value: &<R as RingBase>::Element, out: &mut Formatter<'a>, env: EnvBindingStrength, ) -> Result<(), Error>

Writes a human-readable representation of value to out, taking into account the possible context to place parenthesis as needed. Read more
Source§

default fn negate( &self, value: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn sub_assign( &self, lhs: &mut <R as RingBase>::Element, rhs: <R as RingBase>::Element, )

Source§

default fn add_ref( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn add_ref_fst( &self, lhs: &<R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn add_ref_snd( &self, lhs: <R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn add( &self, lhs: <R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn sub_ref( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn sub_ref_fst( &self, lhs: &<R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn sub_ref_snd( &self, lhs: <R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn sub( &self, lhs: <R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn mul_ref( &self, lhs: &<R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn mul_ref_fst( &self, lhs: &<R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn mul_ref_snd( &self, lhs: <R as RingBase>::Element, rhs: &<R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default fn mul( &self, lhs: <R as RingBase>::Element, rhs: <R as RingBase>::Element, ) -> <R as RingBase>::Element

Source§

default 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 more
Source§

default fn mul_assign_int(&self, lhs: &mut <R as RingBase>::Element, rhs: i32)

Source§

default fn mul_int( &self, lhs: <R as RingBase>::Element, rhs: i32, ) -> <R as RingBase>::Element

Source§

default fn mul_int_ref( &self, lhs: &<R as RingBase>::Element, rhs: i32, ) -> <R as RingBase>::Element

Source§

default fn pow_gen<S>( &self, x: <R as RingBase>::Element, power: &<<S as RingStore>::Type as RingBase>::Element, integers: S, ) -> <R as RingBase>::Element

Raises x to the power of an arbitrary, nonnegative integer given by a custom integer ring implementation. Read more
Source§

default fn characteristic<I>( &self, ZZ: I, ) -> Option<<<I as RingStore>::Type as RingBase>::Element>

Returns the characteristic of this ring as an element of the given implementation of ZZ. Read more
Source§

fn fma( &self, lhs: &Self::Element, rhs: &Self::Element, summand: Self::Element, ) -> Self::Element

Fused-multiply-add. This computes summand + lhs * rhs.
Source§

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 sum<I>(&self, els: I) -> Self::Element
where I: IntoIterator<Item = Self::Element>,

Sums the elements given by the iterator. Read more
Source§

fn prod<I>(&self, els: I) -> Self::Element
where I: IntoIterator<Item = Self::Element>,

Computes the product of the elements given by the iterator. Read more
Source§

impl<R> RingExtension for R

Source§

type BaseRing = <<R as DelegateRing>::Base as RingExtension>::BaseRing

Type of the base ring; Read more
Source§

fn base_ring<'a>(&'a self) -> &'a <R as RingExtension>::BaseRing

Returns a reference to the base ring.
Source§

fn from( &self, x: <<<R as RingExtension>::BaseRing as RingStore>::Type as RingBase>::Element, ) -> <R as RingBase>::Element

Maps an element of the base ring into this ring. Read more
Source§

fn from_ref(&self, x: &El<Self::BaseRing>) -> Self::Element

Maps an element of the base ring (given as reference) into this ring.
Source§

fn mul_assign_base(&self, lhs: &mut Self::Element, rhs: &El<Self::BaseRing>)

Computes lhs := lhs * rhs, where rhs is mapped into this ring via RingExtension::from_ref(). Note that this may be faster than self.mul_assign(lhs, self.from_ref(rhs)).
Source§

fn fma_base( &self, lhs: &Self::Element, rhs: &El<Self::BaseRing>, summand: Self::Element, ) -> Self::Element

Source§

fn mul_assign_base_through_hom<S: ?Sized + RingBase, H: Homomorphism<S, <Self::BaseRing as RingStore>::Type>>( &self, lhs: &mut Self::Element, rhs: &S::Element, hom: H, )

Computes lhs := lhs * rhs, where rhs is mapped into this ring via the given homomorphism, followed by the inclusion (as specified by RingExtension::from_ref()). Read more
Source§

impl<R> SerializableElementRing for R

Source§

default fn serialize<S>( &self, el: &<R as RingBase>::Element, serializer: S, ) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>
where S: Serializer,

Available on crate feature unstable-enable only.
Serializes an element of this ring to the given serializer.
Source§

default fn deserialize<'de, D>( &self, deserializer: D, ) -> Result<<R as RingBase>::Element, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Available on crate feature unstable-enable only.
Deserializes an element of this ring from the given deserializer.
Source§

impl<R> StrassenHint for R
where R: RingBase + ?Sized,

Source§

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

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

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

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

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<R> ZnRing for R

Source§

type IntegerRingBase = <<R as DelegateRing>::Base as ZnRing>::IntegerRingBase

there seems to be a problem with associated type bounds, hence we cannot use Integers: IntegerRingStore or Integers: RingStore<Type: IntegerRing>
Source§

type IntegerRing = <<R as DelegateRing>::Base as ZnRing>::IntegerRing

Source§

default fn integer_ring(&self) -> &<R as ZnRing>::IntegerRing

Source§

default fn modulus( &self, ) -> &<<<R as ZnRing>::IntegerRing as RingStore>::Type as RingBase>::Element

Source§

default fn smallest_positive_lift( &self, el: <R as RingBase>::Element, ) -> <<<R as ZnRing>::IntegerRing as RingStore>::Type as RingBase>::Element

Computes the smallest positive lift for some x in Z/nZ, i.e. the smallest positive integer m such that m = x mod n. Read more
Source§

default fn smallest_lift( &self, el: <R as RingBase>::Element, ) -> <<<R as ZnRing>::IntegerRing as RingStore>::Type as RingBase>::Element

Computes the smallest lift for some x in Z/nZ, i.e. the smallest integer m such that m = x mod n. Read more
Source§

default fn from_int_promise_reduced( &self, x: <<<R as ZnRing>::IntegerRing as RingStore>::Type as RingBase>::Element, ) -> <R as RingBase>::Element

If the given integer is within { 0, ..., n - 1 }, returns the corresponding element in Z/nZ. Any other input is considered a logic error. Read more
Source§

fn any_lift(&self, el: Self::Element) -> El<Self::IntegerRing>

Computes any lift for some x in Z/nZ, i.e. the some integer m such that m = x mod n. Read more
Source§

fn is_field(&self) -> bool

Returns whether this ring is a field, i.e. whether n is prime.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<R> SelfIso for R
where R: CanIsoFromTo<R> + ?Sized,