pub struct RingElementWrapper<R>where
R: RingStore,{ /* private fields */ }
Expand description
Stores a ring element together with its ring, so that ring operations do
not require explicit mention of the ring object. This can be used both for
convenience of notation (i.e. use a + b
instead of ring.add(a, b)
) and
might also be necessary when e.g. storing elements in a set.
§Examples
let ring = DensePolyRing::new(StaticRing::<i64>::RING, "X");
let x = RingElementWrapper::new(&ring, ring.indeterminate());
println!("The result is: {}", x.clone() + x.clone() * x);
// instead of
let x = ring.indeterminate();
println!("The result is: {}", ring.format(&ring.add(ring.mul(ring.clone_el(&x), ring.clone_el(&x)), ring.clone_el(&x))));
You can also retrieve the wrapped element
let ring = DensePolyRing::new(StaticRing::<i64>::RING, "X");
let x = RingElementWrapper::new(&ring, ring.indeterminate());
assert_el_eq!(&ring, ring.add(ring.mul(ring.clone_el(&x), ring.clone_el(&x)), ring.clone_el(&x)), (x.clone() + x.clone() * x).unwrap());
Implementations§
Source§impl<R: RingStore> RingElementWrapper<R>
impl<R: RingStore> RingElementWrapper<R>
Sourcepub const fn new(ring: R, element: El<R>) -> Self
pub const fn new(ring: R, element: El<R>) -> Self
Creates a new RingElementWrapper
wrapping the given element of the given ring.
Sourcepub fn pow(self, power: usize) -> Self
pub fn pow(self, power: usize) -> Self
Raises the stored element to the given power.
Consider using RingElementWrapper::pow_ref()
if you don’t want to
move the element.
Sourcepub fn pow_ref(&self, power: usize) -> Selfwhere
R: Clone,
pub fn pow_ref(&self, power: usize) -> Selfwhere
R: Clone,
Raises the stored element to the given power.
Sourcepub fn unwrap_ref(&self) -> &El<R>
pub fn unwrap_ref(&self) -> &El<R>
Returns the stored element as reference.
Sourcepub fn is_zero(&self) -> bool
pub fn is_zero(&self) -> bool
Returns true
if this element is zero.
Equivalent to self.parent().is_zero(self.unwrap_ref())
.
Sourcepub fn is_one(&self) -> bool
pub fn is_one(&self) -> bool
Returns true
if this element is one.
Equivalent to self.parent().is_one(self.unwrap_ref())
.
Sourcepub fn is_neg_one(&self) -> bool
pub fn is_neg_one(&self) -> bool
Returns true
if this element is negative one.
Equivalent to self.parent().is_neg_one(self.unwrap_ref())
.
Trait Implementations§
Source§impl<'a, 'b, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
impl<'a, 'b, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
+
operator.Source§impl<'a, R: RingStore> Add<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> Add<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
+
operator.Source§impl<'a, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for i32
impl<'a, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
+
operator.Source§impl<'a, R: RingStore> Add<RingElementWrapper<R>> for &'a RingElementWrapper<R>
impl<'a, R: RingStore> Add<RingElementWrapper<R>> for &'a RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
+
operator.Source§impl<R: RingStore> Add<RingElementWrapper<R>> for i32
impl<R: RingStore> Add<RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
+
operator.Source§impl<R: RingStore> Add for RingElementWrapper<R>
impl<R: RingStore> Add for RingElementWrapper<R>
Source§impl<'a, R: RingStore> AddAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> AddAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§fn add_assign(&mut self, rhs: &'a Self)
fn add_assign(&mut self, rhs: &'a Self)
+=
operation. Read moreSource§impl<R: RingStore> AddAssign<i32> for RingElementWrapper<R>
impl<R: RingStore> AddAssign<i32> for RingElementWrapper<R>
Source§fn add_assign(&mut self, rhs: i32)
fn add_assign(&mut self, rhs: i32)
+=
operation. Read moreSource§impl<R: RingStore> AddAssign for RingElementWrapper<R>
impl<R: RingStore> AddAssign for RingElementWrapper<R>
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+=
operation. Read moreSource§impl<R: RingStore> Debug for RingElementWrapper<R>
impl<R: RingStore> Debug for RingElementWrapper<R>
Source§impl<R: RingStore> Deref for RingElementWrapper<R>
impl<R: RingStore> Deref for RingElementWrapper<R>
Source§impl<R: RingStore> Display for RingElementWrapper<R>
impl<R: RingStore> Display for RingElementWrapper<R>
Source§impl<'a, 'b, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
impl<'a, 'b, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for i32
impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<'a, R: RingStore + Clone> Div<RingElementWrapper<R>> for &'a RingElementWrapper<R>
impl<'a, R: RingStore + Clone> Div<RingElementWrapper<R>> for &'a RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<R: RingStore> Div<RingElementWrapper<R>> for i32
impl<R: RingStore> Div<RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<R: RingStore> Div for RingElementWrapper<R>
impl<R: RingStore> Div for RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
/
operator.Source§impl<R: RingStore> Hash for RingElementWrapper<R>where
R::Type: HashableElRing,
impl<R: RingStore> Hash for RingElementWrapper<R>where
R::Type: HashableElRing,
Source§impl<'a, 'b, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
impl<'a, 'b, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
*
operator.Source§impl<'a, R: RingStore> Mul<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> Mul<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
*
operator.Source§impl<'a, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for i32
impl<'a, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
*
operator.Source§impl<'a, R: RingStore> Mul<RingElementWrapper<R>> for &'a RingElementWrapper<R>
impl<'a, R: RingStore> Mul<RingElementWrapper<R>> for &'a RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
*
operator.Source§impl<R: RingStore> Mul<RingElementWrapper<R>> for i32
impl<R: RingStore> Mul<RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
*
operator.Source§impl<R: RingStore> Mul for RingElementWrapper<R>
impl<R: RingStore> Mul for RingElementWrapper<R>
Source§impl<'a, R: RingStore> MulAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> MulAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§fn mul_assign(&mut self, rhs: &'a Self)
fn mul_assign(&mut self, rhs: &'a Self)
*=
operation. Read moreSource§impl<R: RingStore> MulAssign<i32> for RingElementWrapper<R>
impl<R: RingStore> MulAssign<i32> for RingElementWrapper<R>
Source§fn mul_assign(&mut self, rhs: i32)
fn mul_assign(&mut self, rhs: i32)
*=
operation. Read moreSource§impl<R: RingStore> MulAssign for RingElementWrapper<R>
impl<R: RingStore> MulAssign for RingElementWrapper<R>
Source§fn mul_assign(&mut self, rhs: Self)
fn mul_assign(&mut self, rhs: Self)
*=
operation. Read moreSource§impl<R: RingStore> PartialEq for RingElementWrapper<R>
impl<R: RingStore> PartialEq for RingElementWrapper<R>
Source§impl<'a, 'b, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
impl<'a, 'b, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
-
operator.Source§impl<'a, R: RingStore> Sub<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> Sub<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
-
operator.Source§impl<'a, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for i32
impl<'a, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
-
operator.Source§impl<'a, R: RingStore> Sub<RingElementWrapper<R>> for &'a RingElementWrapper<R>
impl<'a, R: RingStore> Sub<RingElementWrapper<R>> for &'a RingElementWrapper<R>
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
-
operator.Source§impl<R: RingStore> Sub<RingElementWrapper<R>> for i32
impl<R: RingStore> Sub<RingElementWrapper<R>> for i32
Source§type Output = RingElementWrapper<R>
type Output = RingElementWrapper<R>
-
operator.Source§impl<R: RingStore> Sub for RingElementWrapper<R>
impl<R: RingStore> Sub for RingElementWrapper<R>
Source§impl<'a, R: RingStore> SubAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
impl<'a, R: RingStore> SubAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>
Source§fn sub_assign(&mut self, rhs: &'a Self)
fn sub_assign(&mut self, rhs: &'a Self)
-=
operation. Read moreSource§impl<R: RingStore> SubAssign<i32> for RingElementWrapper<R>
impl<R: RingStore> SubAssign<i32> for RingElementWrapper<R>
Source§fn sub_assign(&mut self, rhs: i32)
fn sub_assign(&mut self, rhs: i32)
-=
operation. Read moreSource§impl<R: RingStore> SubAssign for RingElementWrapper<R>
impl<R: RingStore> SubAssign for RingElementWrapper<R>
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-=
operation. Read moreimpl<R: RingStore + Copy> Copy for RingElementWrapper<R>
impl<R: RingStore> Eq for RingElementWrapper<R>
Auto Trait Implementations§
impl<R> Freeze for RingElementWrapper<R>
impl<R> RefUnwindSafe for RingElementWrapper<R>
impl<R> Send for RingElementWrapper<R>
impl<R> Sync for RingElementWrapper<R>
impl<R> Unpin for RingElementWrapper<R>
impl<R> UnwindSafe for RingElementWrapper<R>
Blanket Implementations§
Source§impl<G> AbelianGroupStore for G
impl<G> AbelianGroupStore for G
Source§type Type = <<G as Deref>::Target as AbelianGroupStore>::Type
type Type = <<G as Deref>::Target as AbelianGroupStore>::Type
unstable-enable
only.Source§fn get_group(&self) -> &<G as AbelianGroupStore>::Type
fn get_group(&self) -> &<G as AbelianGroupStore>::Type
unstable-enable
only.Source§fn clone_el(&self, el: &GroupEl<Self>) -> GroupEl<Self>
fn clone_el(&self, el: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable
only.Source§fn eq_el(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> bool
fn eq_el(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> bool
unstable-enable
only.Source§fn op(&self, lhs: GroupEl<Self>, rhs: GroupEl<Self>) -> GroupEl<Self>
fn op(&self, lhs: GroupEl<Self>, rhs: GroupEl<Self>) -> GroupEl<Self>
unstable-enable
only.Source§fn op_ref(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
fn op_ref(&self, lhs: &GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable
only.Source§fn op_ref_snd(&self, lhs: GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
fn op_ref_snd(&self, lhs: GroupEl<Self>, rhs: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable
only.Source§fn inv(&self, x: &GroupEl<Self>) -> GroupEl<Self>
fn inv(&self, x: &GroupEl<Self>) -> GroupEl<Self>
unstable-enable
only.Source§fn pow(&self, x: &GroupEl<Self>, e: &El<BigIntRing>) -> GroupEl<Self>
fn pow(&self, x: &GroupEl<Self>, e: &El<BigIntRing>) -> GroupEl<Self>
unstable-enable
only.Source§fn is_identity(&self, x: &GroupEl<Self>) -> bool
fn is_identity(&self, x: &GroupEl<Self>) -> bool
unstable-enable
only.Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'a, R, C> ConvolutionAlgorithm<R> for C
impl<'a, R, C> ConvolutionAlgorithm<R> for C
Source§type PreparedConvolutionOperand = <<C as Deref>::Target as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand
type PreparedConvolutionOperand = <<C as Deref>::Target as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand
Source§fn compute_convolution<S, V1, V2>(
&self,
lhs: V1,
rhs: V2,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
fn compute_convolution<S, V1, V2>(
&self,
lhs: V1,
rhs: V2,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
Source§fn supports_ring<S>(&self, ring: S) -> bool
fn supports_ring<S>(&self, ring: S) -> bool
Source§fn prepare_convolution_operand<S, V>(
&self,
val: V,
len_hint: Option<usize>,
ring: S,
) -> <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand
fn prepare_convolution_operand<S, V>( &self, val: V, len_hint: Option<usize>, ring: S, ) -> <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand
ConvolutionAlgorithm::PreparedConvolutionOperand
,
which can be used to compute future convolutions with this list of values faster. Read moreSource§fn compute_convolution_prepared<S, V1, V2>(
&self,
lhs: V1,
lhs_prep: Option<&<C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>,
rhs: V2,
rhs_prep: Option<&<C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
fn compute_convolution_prepared<S, V1, V2>(
&self,
lhs: V1,
lhs_prep: Option<&<C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>,
rhs: V2,
rhs_prep: Option<&<C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
lhs
and rhs
to dst
. If provided, the given
prepared convolution operands are used for a faster computation. Read moreSource§fn compute_convolution_sum<'b, S, I, V1, V2>(
&self,
values: I,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
I: ExactSizeIterator<Item = (V1, Option<&'b <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>, V2, Option<&'b <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>)>,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
C: 'b,
R: 'b,
fn compute_convolution_sum<'b, S, I, V1, V2>(
&self,
values: I,
dst: &mut [<R as RingBase>::Element],
ring: S,
)where
S: RingStore<Type = R> + Copy,
I: ExactSizeIterator<Item = (V1, Option<&'b <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>, V2, Option<&'b <C as ConvolutionAlgorithm<R>>::PreparedConvolutionOperand>)>,
V1: VectorView<<R as RingBase>::Element>,
V2: VectorView<<R as RingBase>::Element>,
C: 'b,
R: 'b,
dst
. Read moreSource§impl<R> DivisibilityRingStore for R
impl<R> DivisibilityRingStore for R
Source§impl<R> EuclideanRingStore for R
impl<R> EuclideanRingStore for R
Source§impl<T, R> FFTAlgorithm<R> for T
impl<T, R> FFTAlgorithm<R> for T
Source§fn root_of_unity<S>(&self, ring: S) -> &<R as RingBase>::Element
fn root_of_unity<S>(&self, ring: S) -> &<R as RingBase>::Element
n
-th roots
of unity can be used equally for computing a Fourier transform, the
concrete one used determines the order of the output values. Read moreSource§fn unordered_fft_permutation(&self, i: usize) -> usize
fn unordered_fft_permutation(&self, i: usize) -> usize
i
, returns j
such that unordered_fft(values)[i]
contains the evaluation
at z^(-j)
of values (note the -
, which is standard convention for Fourier transforms).
Here z
is the value returned by FFTAlgorithm::root_of_unity()
. Read moreSource§fn unordered_fft_permutation_inv(&self, i: usize) -> usize
fn unordered_fft_permutation_inv(&self, i: usize) -> usize
FFTAlgorithm::unordered_fft_permutation()
, i.e. for all i, have
self.unordered_fft_permutation_inv(self.unordered_fft_permutation(i)) == i
.Source§fn fft<V, S>(&self, values: V, ring: S)
fn fft<V, S>(&self, values: V, ring: S)
values
over the specified ring.
The output is in standard order, i.e. the i
-th output element is the evaluation
of the input at self.root_of_unity()^(-i)
(note the -
, which is standard
convention for Fourier transforms). Read moreSource§fn inv_fft<V, S>(&self, values: V, ring: S)
fn inv_fft<V, S>(&self, values: V, ring: S)
values
over the specified ring.
The output is in standard order, i.e. the i
-th output element is the evaluation
of the input at self.root_of_unity()^i
, divided by self.len()
. Read moreSource§fn unordered_fft<V, S>(&self, values: V, ring: S)
fn unordered_fft<V, S>(&self, values: V, ring: S)
FFTAlgorithm::unordered_inv_fft()
). Read moreSource§fn unordered_inv_fft<V, S>(&self, values: V, ring: S)
fn unordered_inv_fft<V, S>(&self, values: V, ring: S)
FFTAlgorithm::unordered_fft()
, with basically the same contract. Read moreSource§impl<R> FiniteRingStore for R
impl<R> FiniteRingStore for R
Source§fn elements<'a>(&'a self) -> <Self::Type as FiniteRing>::ElementsIter<'a>
fn elements<'a>(&'a self) -> <Self::Type as FiniteRing>::ElementsIter<'a>
Source§fn size<I: IntegerRingStore + Copy>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
fn size<I: IntegerRingStore + Copy>(&self, ZZ: I) -> Option<El<I>>where
I::Type: IntegerRing,
FiniteRing::size()
.Source§impl<R> FreeAlgebraStore for R
impl<R> FreeAlgebraStore for R
Source§fn canonical_gen(&self) -> El<Self>
fn canonical_gen(&self) -> El<Self>
Source§fn wrt_canonical_basis<'a>(
&'a self,
el: &'a El<Self>,
) -> <Self::Type as FreeAlgebra>::VectorRepresentation<'a>
fn wrt_canonical_basis<'a>( &'a self, el: &'a El<Self>, ) -> <Self::Type as FreeAlgebra>::VectorRepresentation<'a>
Source§fn from_canonical_basis<V>(&self, vec: V) -> El<Self>where
V: IntoIterator<Item = El<<Self::Type as RingExtension>::BaseRing>>,
V::IntoIter: DoubleEndedIterator,
fn from_canonical_basis<V>(&self, vec: V) -> El<Self>where
V: IntoIterator<Item = El<<Self::Type as RingExtension>::BaseRing>>,
V::IntoIter: DoubleEndedIterator,
Source§fn from_canonical_basis_extended<V>(&self, vec: V) -> El<Self>
fn from_canonical_basis_extended<V>(&self, vec: V) -> El<Self>
Source§fn generating_poly<P, H>(&self, poly_ring: P, hom: H) -> El<P>where
P: PolyRingStore,
P::Type: PolyRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
fn generating_poly<P, H>(&self, poly_ring: P, hom: H) -> El<P>where
P: PolyRingStore,
P::Type: PolyRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
f(X)
such that this ring is isomorphic
to R[X]/(f(X))
, where R
is the base ring.Source§fn as_field(self) -> Result<AsField<Self>, Self>where
Self::Type: DivisibilityRing,
<<Self::Type as RingExtension>::BaseRing as RingStore>::Type: Field + FactorPolyField,
fn as_field(self) -> Result<AsField<Self>, Self>where
Self::Type: DivisibilityRing,
<<Self::Type as RingExtension>::BaseRing as RingStore>::Type: Field + FactorPolyField,
crate::field::FieldStore
. Read moreSource§fn poly_repr<P, H>(&self, to: P, el: &El<Self>, hom: H) -> El<P>where
P: PolyRingStore,
P::Type: PolyRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
fn poly_repr<P, H>(&self, to: P, el: &El<Self>, hom: H) -> El<P>where
P: PolyRingStore,
P::Type: PolyRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
y
, i.e. the polynomial f(X)
of degree at most
FreeAlgebraStore::rank()
such that f(x) = y
, where y
is the canonical generator of this ring, as given by
FreeAlgebraStore::canonical_gen()
.Source§fn discriminant(&self) -> El<<Self::Type as RingExtension>::BaseRing>
fn discriminant(&self) -> El<<Self::Type as RingExtension>::BaseRing>
(Tr(a^(i + j)))
,
where a
is the canonical generator of this ring extension. Read moreSource§fn charpoly<P, H>(&self, el: &El<Self>, poly_ring: P, hom: H) -> El<P>where
P: RingStore,
P::Type: PolyRing,
<<P::Type as RingExtension>::BaseRing as RingStore>::Type: LinSolveRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
fn charpoly<P, H>(&self, el: &El<Self>, poly_ring: P, hom: H) -> El<P>where
P: RingStore,
P::Type: PolyRing,
<<P::Type as RingExtension>::BaseRing as RingStore>::Type: LinSolveRing,
H: Homomorphism<<<Self::Type as RingExtension>::BaseRing as RingStore>::Type, <<P::Type as RingExtension>::BaseRing as RingStore>::Type>,
FreeAlgebra::charpoly()
.Source§fn with_wrapped_generator<'a, F, const M: usize>(
&'a self,
f: F,
) -> [El<Self>; M]
fn with_wrapped_generator<'a, F, const M: usize>( &'a self, f: F, ) -> [El<Self>; M]
RingElementWrapper
, for more
natural creation of ring elements.Source§impl<R> HashableElRingStore for R
impl<R> HashableElRingStore for R
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<R> LinSolveRingStore for R
impl<R> LinSolveRingStore for R
Source§fn solve_right<V1, V2, V3>(
&self,
lhs: SubmatrixMut<'_, V1, El<Self>>,
rhs: SubmatrixMut<'_, V2, El<Self>>,
out: SubmatrixMut<'_, V3, El<Self>>,
) -> SolveResultwhere
V1: AsPointerToSlice<El<Self>>,
V2: AsPointerToSlice<El<Self>>,
V3: AsPointerToSlice<El<Self>>,
fn solve_right<V1, V2, V3>(
&self,
lhs: SubmatrixMut<'_, V1, El<Self>>,
rhs: SubmatrixMut<'_, V2, El<Self>>,
out: SubmatrixMut<'_, V3, El<Self>>,
) -> SolveResultwhere
V1: AsPointerToSlice<El<Self>>,
V2: AsPointerToSlice<El<Self>>,
V3: AsPointerToSlice<El<Self>>,
lhs * X = rhs
. Read moreSource§fn solve_right_with<V1, V2, V3, A>(
&self,
lhs: SubmatrixMut<'_, V1, El<Self>>,
rhs: SubmatrixMut<'_, V2, El<Self>>,
out: SubmatrixMut<'_, V3, El<Self>>,
allocator: A,
) -> SolveResultwhere
V1: AsPointerToSlice<El<Self>>,
V2: AsPointerToSlice<El<Self>>,
V3: AsPointerToSlice<El<Self>>,
A: Allocator,
fn solve_right_with<V1, V2, V3, A>(
&self,
lhs: SubmatrixMut<'_, V1, El<Self>>,
rhs: SubmatrixMut<'_, V2, El<Self>>,
out: SubmatrixMut<'_, V3, El<Self>>,
allocator: A,
) -> SolveResultwhere
V1: AsPointerToSlice<El<Self>>,
V2: AsPointerToSlice<El<Self>>,
V3: AsPointerToSlice<El<Self>>,
A: Allocator,
lhs * X = rhs
. Read moreSource§impl<R, T> MatmulAlgorithm<R> for T
impl<R, T> MatmulAlgorithm<R> for T
Source§fn add_matmul<S, V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
&self,
lhs: TransposableSubmatrix<'_, V1, <R as RingBase>::Element, T1>,
rhs: TransposableSubmatrix<'_, V2, <R as RingBase>::Element, T2>,
dst: TransposableSubmatrixMut<'_, V3, <R as RingBase>::Element, T3>,
ring: S,
)where
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
S: RingStore<Type = R> + Copy,
fn add_matmul<S, V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
&self,
lhs: TransposableSubmatrix<'_, V1, <R as RingBase>::Element, T1>,
rhs: TransposableSubmatrix<'_, V2, <R as RingBase>::Element, T2>,
dst: TransposableSubmatrixMut<'_, V3, <R as RingBase>::Element, T3>,
ring: S,
)where
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
S: RingStore<Type = R> + Copy,
unstable-enable
only.Source§fn matmul<S, V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
&self,
lhs: TransposableSubmatrix<'_, V1, <R as RingBase>::Element, T1>,
rhs: TransposableSubmatrix<'_, V2, <R as RingBase>::Element, T2>,
dst: TransposableSubmatrixMut<'_, V3, <R as RingBase>::Element, T3>,
ring: S,
)where
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
S: RingStore<Type = R> + Copy,
fn matmul<S, V1, V2, V3, const T1: bool, const T2: bool, const T3: bool>(
&self,
lhs: TransposableSubmatrix<'_, V1, <R as RingBase>::Element, T1>,
rhs: TransposableSubmatrix<'_, V2, <R as RingBase>::Element, T2>,
dst: TransposableSubmatrixMut<'_, V3, <R as RingBase>::Element, T3>,
ring: S,
)where
V1: AsPointerToSlice<<R as RingBase>::Element>,
V2: AsPointerToSlice<<R as RingBase>::Element>,
V3: AsPointerToSlice<<R as RingBase>::Element>,
S: RingStore<Type = R> + Copy,
unstable-enable
only.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R> PrincipalIdealRingStore for R
impl<R> PrincipalIdealRingStore for R
Source§fn extended_ideal_gen(
&self,
lhs: &El<Self>,
rhs: &El<Self>,
) -> (El<Self>, El<Self>, El<Self>)
fn extended_ideal_gen( &self, lhs: &El<Self>, rhs: &El<Self>, ) -> (El<Self>, El<Self>, El<Self>)
Source§fn annihilator(&self, val: &El<Self>) -> El<Self>
fn annihilator(&self, val: &El<Self>) -> El<Self>
Source§impl<R> RingExtensionStore for R
impl<R> RingExtensionStore for R
Source§fn into_inclusion(self) -> Inclusion<Self>
fn into_inclusion(self) -> Inclusion<Self>
R -> self
.Source§impl<'a, S> RingStore for S
impl<'a, S> RingStore for S
Source§fn get_ring<'b>(&'b self) -> &'b <S as RingStore>::Type
fn get_ring<'b>(&'b self) -> &'b <S as RingStore>::Type
Source§fn add_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
fn add_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
Source§fn add_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
fn add_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
Source§fn sub_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
fn sub_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
Source§fn sub_self_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
fn sub_self_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
Source§fn sub_self_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
fn sub_self_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
Source§fn negate_inplace(&self, lhs: &mut El<Self>)
fn negate_inplace(&self, lhs: &mut El<Self>)
Source§fn mul_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
fn mul_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
Source§fn mul_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
fn mul_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)
Source§fn zero(&self) -> El<Self>
fn zero(&self) -> El<Self>
RingBase::zero()
Source§fn one(&self) -> El<Self>
fn one(&self) -> El<Self>
RingBase::one()
Source§fn is_neg_one(&self, value: &El<Self>) -> bool
fn is_neg_one(&self, value: &El<Self>) -> bool
Source§fn is_commutative(&self) -> bool
fn is_commutative(&self) -> bool
Source§fn is_noetherian(&self) -> bool
fn is_noetherian(&self) -> bool
Source§fn sub_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
fn sub_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)
Source§fn fma(&self, lhs: &El<Self>, rhs: &El<Self>, summand: El<Self>) -> El<Self>
fn fma(&self, lhs: &El<Self>, rhs: &El<Self>, summand: El<Self>) -> El<Self>
RingBase::fma()
Source§fn coerce<S>(&self, from: &S, el: El<S>) -> El<Self>
fn coerce<S>(&self, from: &S, el: El<S>) -> El<Self>
Source§fn into_identity(self) -> Identity<Self>
fn into_identity(self) -> Identity<Self>
self -> self
.Source§fn into_can_hom<S>(self, from: S) -> Result<CanHom<S, Self>, (S, Self)>
fn into_can_hom<S>(self, from: S) -> Result<CanHom<S, Self>, (S, Self)>
from -> self
, if it exists,
moving both rings into the CanHom
object.Source§fn into_can_iso<S>(self, from: S) -> Result<CanIso<S, Self>, (S, Self)>
fn into_can_iso<S>(self, from: S) -> Result<CanIso<S, Self>, (S, Self)>
from -> self
, if it exists,
moving both rings into the CanHom
object.Source§fn can_hom<'a, S>(&'a self, from: &'a S) -> Option<CanHom<&'a S, &'a Self>>
fn can_hom<'a, S>(&'a self, from: &'a S) -> Option<CanHom<&'a S, &'a Self>>
from -> self
, if it exists.Source§fn can_iso<'a, S>(&'a self, from: &'a S) -> Option<CanIso<&'a S, &'a Self>>
fn can_iso<'a, S>(&'a self, from: &'a S) -> Option<CanIso<&'a S, &'a Self>>
from -> self
, if it exists.Source§fn into_int_hom(self) -> IntHom<Self>
fn into_int_hom(self) -> IntHom<Self>
Z -> self
that exists for any ring.Source§fn int_hom<'a>(&'a self) -> IntHom<&'a Self>
fn int_hom<'a>(&'a self) -> IntHom<&'a Self>
Z -> self
that exists for any ring.Source§fn sum<I>(&self, els: I) -> El<Self>where
I: IntoIterator<Item = El<Self>>,
fn sum<I>(&self, els: I) -> El<Self>where
I: IntoIterator<Item = El<Self>>,
Source§fn try_sum<I, E>(&self, els: I) -> Result<El<Self>, E>
fn try_sum<I, E>(&self, els: I) -> Result<El<Self>, E>
RingStore::sum()
if the producer of the ring elements
can fail, in which case summation is aborted and the error returned.Source§fn prod<I>(&self, els: I) -> El<Self>where
I: IntoIterator<Item = El<Self>>,
fn prod<I>(&self, els: I) -> El<Self>where
I: IntoIterator<Item = El<Self>>,
Source§fn pow(&self, x: El<Self>, power: usize) -> El<Self>
fn pow(&self, x: El<Self>, power: usize) -> El<Self>
Source§fn pow_gen<R: RingStore>(
&self,
x: El<Self>,
power: &El<R>,
integers: R,
) -> El<Self>where
R::Type: IntegerRing,
fn pow_gen<R: RingStore>(
&self,
x: El<Self>,
power: &El<R>,
integers: R,
) -> El<Self>where
R::Type: IntegerRing,
IntegerRing
. Read moreSource§fn format<'a>(
&'a self,
value: &'a El<Self>,
) -> RingElementDisplayWrapper<'a, Self>
fn format<'a>( &'a self, value: &'a El<Self>, ) -> RingElementDisplayWrapper<'a, Self>
std::fmt::Display
, to use as formatting parameter. Read moreSource§fn format_within<'a>(
&'a self,
value: &'a El<Self>,
within: EnvBindingStrength,
) -> RingElementDisplayWrapper<'a, Self>
fn format_within<'a>( &'a self, value: &'a El<Self>, within: EnvBindingStrength, ) -> RingElementDisplayWrapper<'a, Self>
std::fmt::Display
, to use as formatting parameter. As opposed to
RingStore::format()
, this function takes an additional argument to
specify the context the result is printed in, which is used to determine
whether to put the value in parenthesis or not. Read more