feanor_math::rings::local

Struct AsLocalPIRBase

Source
pub struct AsLocalPIRBase<R: DivisibilityRingStore>{ /* private fields */ }
Expand description

A wrapper around a ring that marks this ring to be a local principal ideal ring.

The design is analogous to crate::rings::field::AsFieldBase.

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

Implementations§

Source§

impl<R: DivisibilityRingStore> AsLocalPIRBase<R>

Source

pub fn promise_is_local_pir( base: R, max_ideal_gen: El<R>, nilpotent_power: Option<usize>, ) -> Self

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

§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_self(self) -> R

§Availability

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

Trait Implementations§

Source§

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

Source§

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

Source§

fn has_canonical_hom( &self, from: &AsFieldBase<R1>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsFieldBase<R1>, el: <AsFieldBase<R1> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore, R1, V1, A1, C1, R2, V2, A2, C2> CanHomFrom<AsLocalPIRBase<AsLocalPIRStore>> for FreeAlgebraImplBase<R2, V2, A2, C2>
where AsLocalPIRStore: 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

Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: LocalPIREl<AsLocalPIRStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore> CanHomFrom<AsLocalPIRBase<AsLocalPIRStore>> for ZnBase
where AsLocalPIRStore: RingStore<Type = ZnBase>,

Source§

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

Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: LocalPIREl<AsLocalPIRStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore, I, J> CanHomFrom<AsLocalPIRBase<AsLocalPIRStore>> for ZnBase<J>
where AsLocalPIRStore: RingStore<Type = ZnBase<I>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

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

Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: LocalPIREl<AsLocalPIRStore>, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::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

Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<R1>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsLocalPIRBase<R1>, el: <AsLocalPIRBase<R1> as RingBase>::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<R: DivisibilityRingStore, S: DivisibilityRingStore> CanHomFrom<AsLocalPIRBase<S>> for AsLocalPIRBase<R>

Source§

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

Source§

fn has_canonical_hom( &self, from: &AsLocalPIRBase<S>, ) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &AsLocalPIRBase<S>, el: LocalPIREl<S>, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore, R1, V1, A1, C1, R2, V2, A2, C2> CanHomFrom<FreeAlgebraImplBase<R1, V1, A1, C1>> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: 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

Source§

fn has_canonical_hom( &self, from: &FreeAlgebraImplBase<R1, V1, A1, C1>, ) -> Option<Self::Homomorphism>

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

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<R: DivisibilityRingStore, S: IntegerRing + ?Sized> CanHomFrom<S> for AsLocalPIRBase<R>

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

Source§

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

Source§

fn has_canonical_hom(&self, from: &S) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &S, el: S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore, I, J> CanHomFrom<ZnBase<I>> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: RingStore<Type = ZnBase<J>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

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

Source§

fn has_canonical_hom(&self, from: &ZnBase<I>) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &ZnBase<I>, el: <ZnBase<I> as RingBase>::Element, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

impl<AsLocalPIRStore> CanHomFrom<ZnBase> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: RingStore<Type = ZnBase>,

Source§

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

Source§

fn has_canonical_hom(&self, from: &ZnBase) -> Option<Self::Homomorphism>

Source§

fn map_in( &self, from: &ZnBase, el: <ZnBase as RingBase>::Element, hom: &Self::Homomorphism, ) -> <Self as RingBase>::Element

Source§

fn map_in_ref( &self, from: &S, el: &S::Element, hom: &Self::Homomorphism, ) -> Self::Element

Source§

fn mul_assign_map_in( &self, from: &S, lhs: &mut Self::Element, rhs: S::Element, hom: &Self::Homomorphism, )

Source§

fn mul_assign_map_in_ref( &self, from: &S, lhs: &mut Self::Element, rhs: &S::Element, hom: &Self::Homomorphism, )

Source§

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

Source§

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

Source§

fn has_canonical_iso(&self, from: &AsFieldBase<R1>) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsFieldBase<R1>, el: Self::Element, iso: &Self::Isomorphism, ) -> <AsFieldBase<R1> as RingBase>::Element

Source§

impl<AsLocalPIRStore, R1, V1, A1, C1, R2, V2, A2, C2> CanIsoFromTo<AsLocalPIRBase<AsLocalPIRStore>> for FreeAlgebraImplBase<R2, V2, A2, C2>
where AsLocalPIRStore: 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

Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> LocalPIREl<AsLocalPIRStore>

Source§

impl<AsLocalPIRStore> CanIsoFromTo<AsLocalPIRBase<AsLocalPIRStore>> for ZnBase
where AsLocalPIRStore: RingStore<Type = ZnBase>,

Source§

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

Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> LocalPIREl<AsLocalPIRStore>

Source§

impl<AsLocalPIRStore, I, J> CanIsoFromTo<AsLocalPIRBase<AsLocalPIRStore>> for ZnBase<J>
where AsLocalPIRStore: RingStore<Type = ZnBase<I>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

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

Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, ) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsLocalPIRBase<AsLocalPIRStore>, el: <Self as RingBase>::Element, hom: &Self::Isomorphism, ) -> LocalPIREl<AsLocalPIRStore>

Source§

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

Source§

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

Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<R1>, ) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsLocalPIRBase<R1>, el: Self::Element, iso: &Self::Isomorphism, ) -> <AsLocalPIRBase<R1> as RingBase>::Element

Source§

impl<R: DivisibilityRingStore, S: DivisibilityRingStore> CanIsoFromTo<AsLocalPIRBase<S>> for AsLocalPIRBase<R>

Source§

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

Source§

fn has_canonical_iso( &self, from: &AsLocalPIRBase<S>, ) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &AsLocalPIRBase<S>, el: Self::Element, iso: &Self::Isomorphism, ) -> LocalPIREl<S>

Source§

impl<AsLocalPIRStore, R1, V1, A1, C1, R2, V2, A2, C2> CanIsoFromTo<FreeAlgebraImplBase<R1, V1, A1, C1>> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: 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

Source§

fn has_canonical_iso( &self, from: &FreeAlgebraImplBase<R1, V1, A1, C1>, ) -> Option<Self::Isomorphism>

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

Source§

impl<AsLocalPIRStore, I, J> CanIsoFromTo<ZnBase<I>> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: RingStore<Type = ZnBase<J>>, I: RingStore, I::Type: IntegerRing, J: RingStore, J::Type: IntegerRing,

Source§

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

Source§

fn has_canonical_iso(&self, from: &ZnBase<I>) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &ZnBase<I>, el: <Self as RingBase>::Element, iso: &Self::Isomorphism, ) -> <ZnBase<I> as RingBase>::Element

Source§

impl<AsLocalPIRStore> CanIsoFromTo<ZnBase> for AsLocalPIRBase<AsLocalPIRStore>
where AsLocalPIRStore: RingStore<Type = ZnBase>,

Source§

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

Source§

fn has_canonical_iso(&self, from: &ZnBase) -> Option<Self::Isomorphism>

Source§

fn map_out( &self, from: &ZnBase, el: <Self as RingBase>::Element, iso: &Self::Isomorphism, ) -> <ZnBase as RingBase>::Element

Source§

impl<R> Clone for AsLocalPIRBase<R>

Source§

fn clone(&self) -> Self

Returns a copy 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: DivisibilityRingStore> ComputeInnerProduct for AsLocalPIRBase<R>

Source§

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

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,

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,

Computes the inner product sum_i lhs[i] * rhs[i].
Source§

impl<R: DivisibilityRingStore> DelegateRing for AsLocalPIRBase<R>

Source§

type Element = LocalPIREl<R>

Source§

type Base = <R as RingStore>::Type

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

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§

impl<R: DivisibilityRingStore> DivisibilityRing for AsLocalPIRBase<R>

Source§

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

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

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 balance_factor<'a, I>(&self, _elements: I) -> Option<Self::Element>
where I: Iterator<Item = &'a Self::Element>, Self: '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: 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>

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

fn divides_left_prepared( &self, lhs: &Self::Element, rhs: &PreparedDivisor<Self>, ) -> bool

Same as DivisibilityRing::divides_left() but for a prepared divisor. Read more
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: DivisibilityRingStore> EuclideanRing for AsLocalPIRBase<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_div( &self, lhs: Self::Element, rhs: &Self::Element, ) -> Self::Element

Computes euclidean division without remainder. Read more
Source§

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

Computes only the remainder of euclidean division. Read more
Source§

impl<R: DivisibilityRingStore> Field for AsLocalPIRBase<R>

Source§

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

Source§

impl<R> FromModulusCreateableZnRing for AsLocalPIRBase<RingValue<R>>

Source§

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

Source§

impl<R> InterpolationBaseRing for AsLocalPIRBase<R>

Source§

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

Restricting this here to be DivisibilityRing + PrincipalIdealRing + Domain is necessary, because of a compiler bug, see also crate::compute_locally::EvaluatePolyLocallyRing::LocalRingBase
Source§

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

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

Source§

fn in_extension<'a, S>(&self, ext_ring: S, el: Self::Element) -> El<S>
where Self: 'a, S: RingStore<Type = Self::ExtendedRingBase<'a>>,

Source§

fn interpolation_points<'a>( &'a self, count: usize, ) -> (Self::ExtendedRing<'a>, Vec<El<Self::ExtendedRing<'a>>>)

Returns count points such that the difference between any two of them is a non-zero-divisor. Read more
Source§

impl<R: DivisibilityRingStore> KaratsubaHint for AsLocalPIRBase<R>

Source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on KaratsubaAlgorithm will use the Karatsuba algorithm. Read more
Source§

impl<R> PartialEq for AsLocalPIRBase<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: DivisibilityRingStore> PrincipalIdealRing for AsLocalPIRBase<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 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 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 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 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: DivisibilityRingStore> PrincipalLocalRing for AsLocalPIRBase<R>

Source§

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

Returns a generator p or the unique maximal ideal (p) of this ring. Read more
Source§

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

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>

Returns the largest nonnegative integer e such that p^e | x where p is the generator of the maximal ideal.
Source§

impl<R: DivisibilityRingStore> StrassenHint for AsLocalPIRBase<R>

Source§

fn strassen_threshold(&self) -> usize

Define a threshold from which on StrassenAlgorithm will use the Strassen algorithm. Read more
Source§

impl<R> Copy for AsLocalPIRBase<R>

Source§

impl<R: DivisibilityRingStore> DelegateRingImplFiniteRing for AsLocalPIRBase<R>

Source§

impl<R: DivisibilityRingStore> Domain for AsLocalPIRBase<R>

Auto Trait Implementations§

§

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

§

impl<R> RefUnwindSafe for AsLocalPIRBase<R>

§

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

§

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

§

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

§

impl<R> UnwindSafe for AsLocalPIRBase<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, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
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,

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,

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

Computes the inner product sum_i lhs[i] * rhs[i].
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>,

Should compute (values[i1], values[i2]) := (values[i1] + twiddle * values[i2], values[i1] - twiddle * values[i2])
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>,

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

impl<R> DivisibilityRing for R

Source§

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

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

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

default fn checked_left_div_prepared( &self, lhs: &<R as RingBase>::Element, rhs: &PreparedDivisor<R>, ) -> 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: &PreparedDivisor<R>, ) -> 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> FactorPolyField for R
where R: FiniteRing + Field + SelfIso,

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)

Factors a univariate polynomial with coefficients in this field into its irreducible factors. Read more
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>,

Source§

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

Source§

type FrobeniusData = UnsafeAnyFrobeniusDataGuarded<R>

Source§

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

Source§

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

Source§

impl<R> FiniteRing for R

Source§

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

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§

impl<R> FreeAlgebra for R

Source§

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

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§

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>

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

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
where R: FiniteRing + Field + SelfIso + ?Sized,

Source§

type LocalRingBase<'ring> = R where R: 'ring

The proper way would be to define this with two lifetime parameters 'ring and 'data, see also crate::compute_locally::EvaluatePolyLocallyRing::LocalRingBase
Source§

type LocalRing<'ring> = RingRef<'ring, R> where R: 'ring

Source§

type LocalFieldBase<'ring> = R where R: 'ring

Source§

type LocalField<'ring> = RingRef<'ring, R> where R: 'ring

Source§

type SuitableIdeal<'ring> = RingRef<'ring, R> where R: 'ring

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,

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,

Source§

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

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,

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,

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>::LocalRing<'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,

Computes the reduction map Read more
Source§

fn reduce_partial<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: (&<R as PolyGCDLocallyDomain>::LocalRing<'ring>, usize), to: (&<R as PolyGCDLocallyDomain>::LocalRing<'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,

Computes the reduction map Read more
Source§

fn lift_partial<'ring>( &self, p: &<R as PolyGCDLocallyDomain>::SuitableIdeal<'ring>, from: (&<R as PolyGCDLocallyDomain>::LocalRing<'ring>, usize), to: (&<R as PolyGCDLocallyDomain>::LocalRing<'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,

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,

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,

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

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,

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

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

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<R> SelfIso for R
where R: CanIsoFromTo<R> + ?Sized,