Struct feanor_math::primitive_int::StaticRingBase

source ·
pub struct StaticRingBase<T> { /* private fields */ }
Expand description

The ring of integers Z, using the arithmetic of the primitive integer type T.

For the difference to StaticRing, see the documentation of crate::ring::RingStore.

Trait Implementations§

source§

impl CanHomFrom<StaticRingBase<i128>> for ZnBase

§

type Homomorphism = (i128, i128)

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i128>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i128>, el: i128, hom: &(i128, i128), ) -> 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 CanHomFrom<StaticRingBase<i16>> for ZnBase

§

type Homomorphism = ()

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i16>, ) -> Option<Self::Homomorphism>

source§

fn map_in(&self, _from: &StaticRingBase<i16>, el: i16, _: &()) -> 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 CanHomFrom<StaticRingBase<i16>> for ZnBase

§

type Homomorphism = (i16, i16)

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i16>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i16>, el: i16, hom: &(i16, i16), ) -> 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 CanHomFrom<StaticRingBase<i32>> for ZnBase

§

type Homomorphism = (i32, i32)

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i32>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i32>, el: i32, hom: &(i32, i32), ) -> 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 CanHomFrom<StaticRingBase<i32>> for ZnBase

§

type Homomorphism = I32ToZnHom

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i32>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i32>, el: i32, hom: &I32ToZnHom, ) -> 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 CanHomFrom<StaticRingBase<i64>> for ZnBase

§

type Homomorphism = (i64, i64)

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i64>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i64>, el: i64, hom: &(i64, i64), ) -> 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<const N: u64, const IS_FIELD: bool> CanHomFrom<StaticRingBase<i64>> for ZnBase<N, IS_FIELD>

§

type Homomorphism = ()

source§

fn has_canonical_hom(&self, _: &StaticRingBase<i64>) -> Option<()>

source§

fn map_in(&self, _: &StaticRingBase<i64>, el: i64, _: &()) -> 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 CanHomFrom<StaticRingBase<i8>> for ZnBase

§

type Homomorphism = (i8, i8)

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i8>, ) -> Option<Self::Homomorphism>

source§

fn map_in( &self, _from: &StaticRingBase<i8>, el: i8, hom: &(i8, i8), ) -> 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 CanHomFrom<StaticRingBase<i8>> for ZnBase

§

type Homomorphism = ()

source§

fn has_canonical_hom( &self, _from: &StaticRingBase<i8>, ) -> Option<Self::Homomorphism>

source§

fn map_in(&self, _from: &StaticRingBase<i8>, el: i8, _: &()) -> 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<T> Clone for StaticRingBase<T>

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 ConvMulComputation for StaticRingBase<i128>

source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M: MemoryProvider<Self::Element>>( &self, dst: &mut [Self::Element], lhs: &[Self::Element], rhs: &[Self::Element], memory_provider: &M, )

Computes the convolution of lhs and rhs, and adds the result to dst. Read more
source§

impl ConvMulComputation for StaticRingBase<i16>

source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M: MemoryProvider<Self::Element>>( &self, dst: &mut [Self::Element], lhs: &[Self::Element], rhs: &[Self::Element], memory_provider: &M, )

Computes the convolution of lhs and rhs, and adds the result to dst. Read more
source§

impl ConvMulComputation for StaticRingBase<i32>

source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M: MemoryProvider<Self::Element>>( &self, dst: &mut [Self::Element], lhs: &[Self::Element], rhs: &[Self::Element], memory_provider: &M, )

Computes the convolution of lhs and rhs, and adds the result to dst. Read more
source§

impl ConvMulComputation for StaticRingBase<i64>

source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M: MemoryProvider<Self::Element>>( &self, dst: &mut [Self::Element], lhs: &[Self::Element], rhs: &[Self::Element], memory_provider: &M, )

Computes the convolution of lhs and rhs, and adds the result to dst. Read more
source§

impl ConvMulComputation for StaticRingBase<i8>

source§

fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M: MemoryProvider<Self::Element>>( &self, dst: &mut [Self::Element], lhs: &[Self::Element], rhs: &[Self::Element], memory_provider: &M, )

Computes the convolution of lhs and rhs, and adds the result to dst. Read more
source§

impl<T: PrimitiveInt> DivisibilityRing for StaticRingBase<T>

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. Note that this does not have to be unique, if rhs is a left zero-divisor. In particular, this function will return any element in the ring if lhs = rhs = 0.
source§

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

source§

impl<T: PrimitiveInt> EuclideanRing for StaticRingBase<T>

source§

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

source§

fn euclidean_deg(&self, val: &Self::Element) -> Option<usize>

source§

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

source§

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

source§

impl<T: PrimitiveInt> HashableElRing for StaticRingBase<T>

source§

fn hash<H: Hasher>(&self, el: &Self::Element, h: &mut H)

source§

impl<R> Homomorphism<StaticRingBase<i32>, <R as RingStore>::Type> for IntHom<R>
where R: RingStore,

§

type CodomainStore = R

§

type DomainStore = RingValue<StaticRingBase<i32>>

source§

fn domain<'a>(&'a self) -> &'a Self::DomainStore

source§

fn codomain<'a>(&'a self) -> &'a Self::CodomainStore

source§

fn map(&self, x: i32) -> <R::Type as RingBase>::Element

source§

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

source§

fn mul_assign_map_ref( &self, lhs: &mut <R::Type as RingBase>::Element, rhs: &<StaticRingBase<i32> as RingBase>::Element, )

source§

fn map_ref(&self, x: &Domain::Element) -> Codomain::Element

source§

fn mul_map( &self, lhs: Codomain::Element, rhs: Domain::Element, ) -> Codomain::Element

source§

fn mul_ref_fst_map( &self, lhs: &Codomain::Element, rhs: Domain::Element, ) -> Codomain::Element

source§

fn mul_ref_snd_map( &self, lhs: Codomain::Element, rhs: &Domain::Element, ) -> Codomain::Element

source§

fn mul_ref_map( &self, lhs: &Codomain::Element, rhs: &Domain::Element, ) -> Codomain::Element

source§

fn compose<F, PrevDomain: ?Sized + RingBase>( self, prev: F, ) -> ComposedHom<PrevDomain, Domain, Codomain, F, Self>
where Self: Sized, F: Homomorphism<PrevDomain, Domain>,

source§

impl IntCast<RustBigintRingBase> for StaticRingBase<i128>

source§

fn cast(&self, from: &RustBigintRingBase, value: RustBigint) -> i128

source§

impl IntCast<RustBigintRingBase> for StaticRingBase<i16>

source§

fn cast(&self, from: &RustBigintRingBase, value: RustBigint) -> i16

source§

impl IntCast<RustBigintRingBase> for StaticRingBase<i32>

source§

fn cast(&self, from: &RustBigintRingBase, value: RustBigint) -> i32

source§

impl IntCast<RustBigintRingBase> for StaticRingBase<i64>

source§

fn cast(&self, from: &RustBigintRingBase, value: RustBigint) -> i64

source§

impl IntCast<RustBigintRingBase> for StaticRingBase<i8>

source§

fn cast(&self, from: &RustBigintRingBase, value: RustBigint) -> i8

source§

impl IntCast<StaticRingBase<i128>> for RustBigintRingBase

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> RustBigint

source§

impl IntCast<StaticRingBase<i128>> for StaticRingBase<i128>

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> Self::Element

source§

impl IntCast<StaticRingBase<i128>> for StaticRingBase<i16>

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> Self::Element

source§

impl IntCast<StaticRingBase<i128>> for StaticRingBase<i32>

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> Self::Element

source§

impl IntCast<StaticRingBase<i128>> for StaticRingBase<i64>

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> Self::Element

source§

impl IntCast<StaticRingBase<i128>> for StaticRingBase<i8>

source§

fn cast(&self, _: &StaticRingBase<i128>, value: i128) -> Self::Element

source§

impl IntCast<StaticRingBase<i16>> for RustBigintRingBase

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> RustBigint

source§

impl IntCast<StaticRingBase<i16>> for StaticRingBase<i128>

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> Self::Element

source§

impl IntCast<StaticRingBase<i16>> for StaticRingBase<i16>

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> Self::Element

source§

impl IntCast<StaticRingBase<i16>> for StaticRingBase<i32>

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> Self::Element

source§

impl IntCast<StaticRingBase<i16>> for StaticRingBase<i64>

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> Self::Element

source§

impl IntCast<StaticRingBase<i16>> for StaticRingBase<i8>

source§

fn cast(&self, _: &StaticRingBase<i16>, value: i16) -> Self::Element

source§

impl IntCast<StaticRingBase<i32>> for RustBigintRingBase

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> RustBigint

source§

impl IntCast<StaticRingBase<i32>> for StaticRingBase<i128>

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> Self::Element

source§

impl IntCast<StaticRingBase<i32>> for StaticRingBase<i16>

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> Self::Element

source§

impl IntCast<StaticRingBase<i32>> for StaticRingBase<i32>

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> Self::Element

source§

impl IntCast<StaticRingBase<i32>> for StaticRingBase<i64>

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> Self::Element

source§

impl IntCast<StaticRingBase<i32>> for StaticRingBase<i8>

source§

fn cast(&self, _: &StaticRingBase<i32>, value: i32) -> Self::Element

source§

impl IntCast<StaticRingBase<i64>> for RustBigintRingBase

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> RustBigint

source§

impl IntCast<StaticRingBase<i64>> for StaticRingBase<i128>

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> Self::Element

source§

impl IntCast<StaticRingBase<i64>> for StaticRingBase<i16>

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> Self::Element

source§

impl IntCast<StaticRingBase<i64>> for StaticRingBase<i32>

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> Self::Element

source§

impl IntCast<StaticRingBase<i64>> for StaticRingBase<i64>

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> Self::Element

source§

impl IntCast<StaticRingBase<i64>> for StaticRingBase<i8>

source§

fn cast(&self, _: &StaticRingBase<i64>, value: i64) -> Self::Element

source§

impl IntCast<StaticRingBase<i8>> for RustBigintRingBase

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> RustBigint

source§

impl IntCast<StaticRingBase<i8>> for StaticRingBase<i128>

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> Self::Element

source§

impl IntCast<StaticRingBase<i8>> for StaticRingBase<i16>

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> Self::Element

source§

impl IntCast<StaticRingBase<i8>> for StaticRingBase<i32>

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> Self::Element

source§

impl IntCast<StaticRingBase<i8>> for StaticRingBase<i64>

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> Self::Element

source§

impl IntCast<StaticRingBase<i8>> for StaticRingBase<i8>

source§

fn cast(&self, _: &StaticRingBase<i8>, value: i8) -> Self::Element

source§

impl<T: PrimitiveInt> IntegerRing for StaticRingBase<T>

source§

fn to_float_approx(&self, value: &Self::Element) -> f64

Computes a float value that is supposed to be close to value. However, no guarantees are made on how close it must be, in particular, this function may also always return 0. (this is just an example - it’s not a good idea). Read more
source§

fn from_float_approx(&self, value: f64) -> Option<Self::Element>

Computes a value that is “close” to the given float. However, no guarantees are made on the definition of close, in particular, this does not have to be the closest integer to the given float, and cannot be used to compute rounding. It is also implementation-defined when to return None, although this is usually the case on infinity and NaN.
source§

fn abs_is_bit_set(&self, value: &Self::Element, i: usize) -> bool

Return whether the i-th bit in the two-complements representation of abs(value) is 1. Read more
source§

fn abs_highest_set_bit(&self, value: &Self::Element) -> Option<usize>

Returns the index of the highest set bit in the two-complements representation of abs(value), or None if the value is zero. Read more
source§

fn abs_lowest_set_bit(&self, value: &Self::Element) -> Option<usize>

Returns the index of the lowest set bit in the two-complements representation of abs(value), or None if the value is zero. Read more
source§

fn euclidean_div_pow_2(&self, value: &mut Self::Element, power: usize)

Computes the euclidean division by a power of two, always rounding to zero (note that euclidean division requires that |remainder| < |divisor|, and thus would otherwise leave multiple possible results). Read more
source§

fn mul_pow_2(&self, value: &mut Self::Element, power: usize)

Multiplies the element by a power of two.
source§

fn get_uniformly_random_bits<G: FnMut() -> u64>( &self, log2_bound_exclusive: usize, rng: G, ) -> Self::Element

Computes a uniformly random integer in [0, 2^log_bound_exclusive - 1], assuming that rng provides uniformly random values in the whole range of u64.
source§

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

Returns n such that this ring can represent at least [-2^n, ..., 2^n - 1]. Returning None means that the size of representable integers is unbounded.
source§

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

Computes the rounded division, i.e. rounding to the closest integer. In the case of a tie (i.e. round(0.5)), we round towards +/- infinity. Read more
source§

fn power_of_two(&self, power: usize) -> Self::Element

Returns the value 2^power in this integer ring.
source§

impl<T: PrimitiveInt> OrderedRing for StaticRingBase<T>

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn is_neg(&self, value: &Self::Element) -> bool

source§

fn is_pos(&self, value: &Self::Element) -> bool

source§

fn abs(&self, value: Self::Element) -> Self::Element

source§

impl<T> PartialEq for StaticRingBase<T>

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: 'static + PrimitiveInt> PreparedDivisibilityRing for StaticRingBase<T>

source§

impl<T: PrimitiveInt> PrincipalIdealRing for StaticRingBase<T>

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 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<T: PrimitiveInt> RingBase for StaticRingBase<T>

§

type Element = T

source§

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

source§

fn add_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)

source§

fn negate_inplace(&self, lhs: &mut Self::Element)

source§

fn mul_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)

source§

fn from_int(&self, value: i32) -> Self::Element

source§

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

source§

fn is_commutative(&self) -> bool

source§

fn is_noetherian(&self) -> bool

source§

fn dbg<'a>(&self, value: &Self::Element, out: &mut Formatter<'a>) -> Result

source§

fn characteristic<I: IntegerRingStore>(&self, ZZ: &I) -> Option<El<I>>
where I::Type: IntegerRing,

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

fn add_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)

source§

fn sub_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)

source§

fn mul_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)

source§

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

source§

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

source§

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

source§

fn is_zero(&self, value: &Self::Element) -> bool

source§

fn is_one(&self, value: &Self::Element) -> bool

source§

fn is_neg_one(&self, value: &Self::Element) -> bool

source§

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§

fn square(&self, value: &mut Self::Element)

source§

fn negate(&self, value: Self::Element) -> Self::Element

source§

fn sub_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)

source§

fn mul_assign_int(&self, lhs: &mut Self::Element, rhs: i32)

source§

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

source§

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

source§

fn sub_self_assign(&self, lhs: &mut Self::Element, rhs: Self::Element)

Computes lhs := rhs - lhs.
source§

fn sub_self_assign_ref(&self, lhs: &mut Self::Element, rhs: &Self::Element)

Computes lhs := rhs - lhs.
source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

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

source§

fn pow_gen<R: IntegerRingStore>( &self, x: Self::Element, power: &El<R>, integers: R, ) -> Self::Element
where R::Type: IntegerRing,

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

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

source§

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

source§

impl<T> Copy for StaticRingBase<T>

source§

impl<T: PrimitiveInt> Domain for StaticRingBase<T>

Auto Trait Implementations§

§

impl<T> Freeze for StaticRingBase<T>

§

impl<T> RefUnwindSafe for StaticRingBase<T>
where T: RefUnwindSafe,

§

impl<T> Send for StaticRingBase<T>
where T: Send,

§

impl<T> Sync for StaticRingBase<T>
where T: Sync,

§

impl<T> Unpin for StaticRingBase<T>
where T: Unpin,

§

impl<T> UnwindSafe for StaticRingBase<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> 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<I, J> CanHomFrom<I> for J
where I: IntegerRing + ?Sized, J: IntegerRing + ?Sized,

§

type Homomorphism = ()

source§

fn has_canonical_hom(&self, _: &I) -> Option<<J as CanHomFrom<I>>::Homomorphism>

source§

fn map_in( &self, from: &I, el: <I as RingBase>::Element, _: &<J as CanHomFrom<I>>::Homomorphism, ) -> <J as RingBase>::Element

source§

default fn map_in_ref( &self, from: &I, el: &<I as RingBase>::Element, hom: &<J as CanHomFrom<I>>::Homomorphism, ) -> <J as RingBase>::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<I, J> CanIsoFromTo<I> for J
where I: IntegerRing + ?Sized, J: IntegerRing + ?Sized,

§

type Isomorphism = ()

source§

fn has_canonical_iso( &self, _: &I, ) -> Option<<J as CanIsoFromTo<I>>::Isomorphism>

source§

fn map_out( &self, from: &I, el: <J as RingBase>::Element, _: &<J as CanIsoFromTo<I>>::Isomorphism, ) -> <I as RingBase>::Element

source§

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

source§

default fn karatsuba_threshold(&self) -> usize

Define a threshold from which on the default implementation of ConvMulComputation::add_assign_conv_mul() will use the Karatsuba algorithm. Read more
source§

fn add_assign_conv_mul<M>( &self, dst: &mut [<R as RingBase>::Element], lhs: &[<R as RingBase>::Element], rhs: &[<R as RingBase>::Element], memory_provider: &M, )
where M: MemoryProvider<<R as RingBase>::Element>,

Computes the convolution of lhs and rhs, and adds the result to dst. 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>,

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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<R> InnerProductComputation 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<F, T> IntCast<F> for T
where F: IntegerRing + ?Sized, T: IntegerRing + ?Sized,

source§

default fn cast( &self, from: &F, value: <F as RingBase>::Element, ) -> <T as RingBase>::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> ToOwned for T
where T: Clone,

§

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

§

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

§

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