feanor_math::wrapper

Struct RingElementWrapper

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

Source

pub const fn new(ring: R, element: El<R>) -> Self

Creates a new RingElementWrapper wrapping the given element of the given ring.

Source

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.

Source

pub fn pow_ref(&self, power: usize) -> Self
where R: Clone,

Raises the stored element to the given power.

Source

pub fn unwrap(self) -> El<R>

Returns the stored element.

Source

pub fn unwrap_ref(&self) -> &El<R>

Returns the stored element as reference.

Source

pub fn parent(&self) -> &R

Returns a reference to the ring that this element belongs to.

Trait Implementations§

Source§

impl<'a, 'b, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, R: RingStore> Add<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, R: RingStore + Clone> Add<&'a RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, R: RingStore> Add<RingElementWrapper<R>> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: RingStore> Add<RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, R: RingStore + Clone> Add<i32> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: RingStore> Add<i32> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl<R: RingStore> Add for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Self) -> Self::Output

Performs the + operation. Read more
Source§

impl<'a, R: RingStore> AddAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

fn add_assign(&mut self, rhs: &'a Self)

Performs the += operation. Read more
Source§

impl<R: RingStore> AddAssign<i32> for RingElementWrapper<R>

Source§

fn add_assign(&mut self, rhs: i32)

Performs the += operation. Read more
Source§

impl<R: RingStore> AddAssign for RingElementWrapper<R>

Source§

fn add_assign(&mut self, rhs: Self)

Performs the += operation. Read more
Source§

impl<R: RingStore + Clone> Clone for RingElementWrapper<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: RingStore> Debug for RingElementWrapper<R>

Source§

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

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

impl<R: RingStore> Deref for RingElementWrapper<R>

Source§

type Target = <<R as RingStore>::Type as RingBase>::Element

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<R: RingStore> Display for RingElementWrapper<R>

Source§

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

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

impl<'a, 'b, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, R: RingStore + Clone> Div<&'a RingElementWrapper<R>> for i32
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, R: RingStore + Clone> Div<RingElementWrapper<R>> for &'a RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: RingStore> Div<RingElementWrapper<R>> for i32
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'a, R: RingStore + Clone> Div<i32> for &'a RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: RingStore> Div<i32> for RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: RingStore> Div for RingElementWrapper<R>
where R::Type: Field,

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the / operation. Read more
Source§

impl<R: RingStore> Hash for RingElementWrapper<R>
where R::Type: HashableElRing,

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<'a, 'b, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, R: RingStore> Mul<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, R: RingStore + Clone> Mul<&'a RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, R: RingStore> Mul<RingElementWrapper<R>> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: RingStore> Mul<RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, R: RingStore + Clone> Mul<i32> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: RingStore> Mul<i32> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl<R: RingStore> Mul for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Self) -> Self::Output

Performs the * operation. Read more
Source§

impl<'a, R: RingStore> MulAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

fn mul_assign(&mut self, rhs: &'a Self)

Performs the *= operation. Read more
Source§

impl<R: RingStore> MulAssign<i32> for RingElementWrapper<R>

Source§

fn mul_assign(&mut self, rhs: i32)

Performs the *= operation. Read more
Source§

impl<R: RingStore> MulAssign for RingElementWrapper<R>

Source§

fn mul_assign(&mut self, rhs: Self)

Performs the *= operation. Read more
Source§

impl<R: RingStore> PartialEq for RingElementWrapper<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<'a, 'b, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for &'b RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, R: RingStore> Sub<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, R: RingStore + Clone> Sub<&'a RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: &'a RingElementWrapper<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, R: RingStore> Sub<RingElementWrapper<R>> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: RingStore> Sub<RingElementWrapper<R>> for i32

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: RingElementWrapper<R>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, R: RingStore + Clone> Sub<i32> for &'a RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: RingStore> Sub<i32> for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl<R: RingStore> Sub for RingElementWrapper<R>

Source§

type Output = RingElementWrapper<R>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Self) -> Self::Output

Performs the - operation. Read more
Source§

impl<'a, R: RingStore> SubAssign<&'a RingElementWrapper<R>> for RingElementWrapper<R>

Source§

fn sub_assign(&mut self, rhs: &'a Self)

Performs the -= operation. Read more
Source§

impl<R: RingStore> SubAssign<i32> for RingElementWrapper<R>

Source§

fn sub_assign(&mut self, rhs: i32)

Performs the -= operation. Read more
Source§

impl<R: RingStore> SubAssign for RingElementWrapper<R>

Source§

fn sub_assign(&mut self, rhs: Self)

Performs the -= operation. Read more
Source§

impl<R: RingStore + Copy> Copy for RingElementWrapper<R>
where El<R>: Copy,

Source§

impl<R: RingStore> Eq for RingElementWrapper<R>

Auto Trait Implementations§

§

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

§

impl<R> RefUnwindSafe for RingElementWrapper<R>

§

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

§

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

§

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

§

impl<R> UnwindSafe for RingElementWrapper<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<'a, R, C> ConvolutionAlgorithm<R> for C
where R: RingBase + ?Sized, C: Deref, <C as Deref>::Target: ConvolutionAlgorithm<R>,

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

Elementwise adds the convolution of lhs and rhs to dst. Read more
Source§

fn supports_ring<S>(&self, ring: S) -> bool
where S: RingStore<Type = R> + Copy,

Returns whether this convolution algorithm supports computations of the given ring. Read more
Source§

impl<R> DivisibilityRingStore for R

Source§

fn checked_left_div(&self, lhs: &El<Self>, rhs: &El<Self>) -> Option<El<Self>>

Source§

fn divides_left(&self, lhs: &El<Self>, rhs: &El<Self>) -> bool

Source§

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

Source§

fn checked_div(&self, lhs: &El<Self>, rhs: &El<Self>) -> Option<El<Self>>

Source§

fn divides(&self, lhs: &El<Self>, rhs: &El<Self>) -> bool

Source§

fn invert(&self, lhs: &El<Self>) -> Option<El<Self>>

Source§

impl<R> EuclideanRingStore for R

Source§

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

Source§

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

Source§

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

Source§

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

Source§

impl<T, R> FFTAlgorithm<R> for T
where R: RingBase + ?Sized, T: Deref, <T as Deref>::Target: FFTAlgorithm<R>,

Source§

fn len(&self) -> usize

This FFTTable can compute the FFT of arrays of this length.
Source§

fn root_of_unity<S>(&self, ring: S) -> &<R as RingBase>::Element
where S: RingStore<Type = R> + Copy,

The root of unity used for the FFT. While all primitive 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 more
Source§

fn unordered_fft_permutation(&self, i: usize) -> usize

On input i, returns j such that unordered_fft(values)[i] contains the evaluation at zeta^(-j) of values (note the -, which is standard convention for Fourier transforms). Here zeta is the value returned by FFTAlgorithm::root_of_unity(). Read more
Source§

fn unordered_fft_permutation_inv(&self, i: usize) -> usize

The inverse of 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)
where V: SwappableVectorViewMut<<R as RingBase>::Element>, S: RingStore<Type = R> + Copy,

Computes the Fourier transform of the given 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 more
Source§

fn inv_fft<V, S>(&self, values: V, ring: S)
where V: SwappableVectorViewMut<<R as RingBase>::Element>, S: RingStore<Type = R> + Copy,

Computes the Fourier transform of the given 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 more
Source§

fn unordered_fft<V, S>(&self, values: V, ring: S)
where V: SwappableVectorViewMut<<R as RingBase>::Element>, S: RingStore<Type = R> + Copy,

Computes the Fourier transform of the given values, but the output values are arbitrarily permuted (in a way compatible with FFTAlgorithm::unordered_inv_fft()). Read more
Source§

fn unordered_inv_fft<V, S>(&self, values: V, ring: S)
where V: SwappableVectorViewMut<<R as RingBase>::Element>, S: RingStore<Type = R> + Copy,

Inverse to FFTAlgorithm::unordered_fft(), with basically the same contract.
Source§

impl<R> FiniteRingStore for R
where R: RingStore, <R as RingStore>::Type: FiniteRing,

Source§

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

Source§

fn random_element<G: FnMut() -> u64>(&self, rng: G) -> El<Self>

Source§

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

Source§

impl<R> FreeAlgebraStore for R
where R: RingStore, <R as RingStore>::Type: FreeAlgebra,

Source§

fn canonical_gen(&self) -> El<Self>

Source§

fn rank(&self) -> usize

Source§

fn trace(&self, el: El<Self>) -> El<<Self::Type as RingExtension>::BaseRing>

Source§

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>

Source§

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

Source§

fn generating_poly<P, H>(&self, poly_ring: P, hom: H) -> El<P>

Returns the generating polynomial of this ring, i.e. the monic polynomial 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>

If this ring is a field, returns a wrapper around this ring that implements crate::field::FieldStore. Read more
Source§

fn poly_repr<P, H>(&self, to: P, el: &El<Self>, hom: H) -> El<P>

Returns the polynomial representation of the given element 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>

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§

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

Source§

fn with_wrapped_generator<'a, F, const M: usize>( &'a self, f: F, ) -> [El<Self>; M]
where F: FnOnce(&RingElementWrapper<&'a Self>) -> [RingElementWrapper<&'a Self>; M],

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<R> HashableElRingStore for R

Source§

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

Source§

fn default_hash(&self, el: &El<Self>) -> u64

Computes a hash of the given element using some default hasher. Read more
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> LinSolveRingStore for R
where R: RingStore, <R as RingStore>::Type: LinSolveRing,

Source§

fn solve_right<V1, V2, V3>( &self, lhs: SubmatrixMut<'_, V1, El<Self>>, rhs: SubmatrixMut<'_, V2, El<Self>>, out: SubmatrixMut<'_, V3, El<Self>>, ) -> SolveResult
where V1: AsPointerToSlice<El<Self>>, V2: AsPointerToSlice<El<Self>>, V3: AsPointerToSlice<El<Self>>,

Solves a linear system lhs * X = rhs. Read more
Source§

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, ) -> SolveResult
where V1: AsPointerToSlice<El<Self>>, V2: AsPointerToSlice<El<Self>>, V3: AsPointerToSlice<El<Self>>, A: Allocator,

Solves a linear system lhs * X = rhs. Read more
Source§

impl<R, T> MatmulAlgorithm<R> for T
where R: RingBase + ?Sized, T: Deref, <T as Deref>::Target: MatmulAlgorithm<R>,

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,

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

Computes the matrix product of lhs and rhs, and stores the result in dst. 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<'a, R, C> PreparedConvolutionAlgorithm<R> for C

Source§

type PreparedConvolutionOperand = <<C as Deref>::Target as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand

Source§

fn prepare_convolution_operand<S, V>( &self, val: V, ring: S, ) -> <C as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand
where S: RingStore<Type = R> + Copy, V: VectorView<<R as RingBase>::Element>,

Source§

fn compute_convolution_lhs_prepared<S, V>( &self, lhs: &<C as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand, rhs: V, dst: &mut [<R as RingBase>::Element], ring: S, )
where S: RingStore<Type = R> + Copy, V: VectorView<<R as RingBase>::Element>,

Source§

fn compute_convolution_prepared<S>( &self, lhs: &<C as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand, rhs: &<C as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand, dst: &mut [<R as RingBase>::Element], ring: S, )
where S: RingStore<Type = R> + Copy,

Source§

fn compute_convolution_rhs_prepared<S, V>( &self, lhs: V, rhs: &<C as PreparedConvolutionAlgorithm<R>>::PreparedConvolutionOperand, dst: &mut [<R as RingBase>::Element], ring: S, )
where S: RingStore<Type = R> + Copy, V: VectorView<<R as RingBase>::Element>,

Source§

fn compute_convolution_inner_product_lhs_prepared<'b, S, I, V>( &self, values: I, dst: &mut [<R as RingBase>::Element], ring: S, )

Source§

fn compute_convolution_inner_product_prepared<'b, S, I>( &self, values: I, dst: &mut [<R as RingBase>::Element], ring: S, )

Source§

impl<R> PrincipalIdealRingStore for R

Source§

fn checked_div_min(&self, lhs: &El<Self>, rhs: &El<Self>) -> Option<El<Self>>

Source§

fn extended_ideal_gen( &self, lhs: &El<Self>, rhs: &El<Self>, ) -> (El<Self>, El<Self>, El<Self>)

Source§

fn ideal_gen(&self, lhs: &El<Self>, rhs: &El<Self>) -> El<Self>

Source§

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

Source§

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

Source§

fn gcd(&self, lhs: &El<Self>, rhs: &El<Self>) -> El<Self>

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<R> RingExtensionStore for R

Source§

fn base_ring(&self) -> &<Self::Type as RingExtension>::BaseRing

Source§

fn into_inclusion(self) -> Inclusion<Self>

Returns the inclusion map of the base ring R -> self.
Source§

fn inclusion<'a>(&'a self) -> Inclusion<&'a Self>

Returns the inclusion map of the base ring R -> self.
Source§

impl<'a, S> RingStore for S
where S: Deref, <S as Deref>::Target: RingStore,

Source§

type Type = <<S as Deref>::Target as RingStore>::Type

The type of the stored ring.
Source§

fn get_ring<'b>(&'b self) -> &'b <S as RingStore>::Type

Returns a reference to the stored ring.
Source§

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

Source§

fn add_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)

Source§

fn add_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)

Source§

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

Source§

fn sub_self_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)

Source§

fn negate_inplace(&self, lhs: &mut El<Self>)

Source§

fn mul_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)

Source§

fn mul_assign_ref(&self, lhs: &mut El<Self>, rhs: &El<Self>)

Source§

fn zero(&self) -> El<Self>

Source§

fn one(&self) -> El<Self>

Source§

fn neg_one(&self) -> El<Self>

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn is_commutative(&self) -> bool

Source§

fn is_noetherian(&self) -> bool

Source§

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

Source§

fn sub_assign(&self, lhs: &mut El<Self>, rhs: El<Self>)

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

fn square(&self, value: &mut El<Self>)

Source§

fn coerce<S>(&self, from: &S, el: El<S>) -> El<Self>
where S: RingStore, Self::Type: CanHomFrom<S::Type>,

Tries to map the given element into this ring. Read more
Source§

fn into_identity(self) -> Identity<Self>

Returns the identity map self -> self.
Source§

fn identity<'a>(&'a self) -> Identity<&'a Self>

Returns the identity map self -> self.
Source§

fn into_can_hom<S>(self, from: S) -> Result<CanHom<S, Self>, (S, Self)>
where Self: Sized, S: RingStore, Self::Type: CanHomFrom<S::Type>,

Returns the canonical homomorphism 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)>
where Self: Sized, S: RingStore, Self::Type: CanIsoFromTo<S::Type>,

Returns the canonical isomorphism 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>>
where S: RingStore, Self::Type: CanHomFrom<S::Type>,

Returns the canonical homomorphism from -> self, if it exists.
Source§

fn can_iso<'a, S>(&'a self, from: &'a S) -> Option<CanIso<&'a S, &'a Self>>
where S: RingStore, Self::Type: CanIsoFromTo<S::Type>,

Returns the canonical isomorphism from -> self, if it exists.
Source§

fn into_int_hom(self) -> IntHom<Self>

Returns the homomorphism Z -> self that exists for any ring.
Source§

fn int_hom<'a>(&'a self) -> IntHom<&'a Self>

Returns the homomorphism Z -> self that exists for any ring.
Source§

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

Computes the sum of all elements returned by the iterator. Read more
Source§

fn try_sum<I, E>(&self, els: I) -> Result<El<Self>, E>
where I: IntoIterator<Item = Result<El<Self>, E>>,

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

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

fn pow(&self, x: El<Self>, power: usize) -> El<Self>

Raises the given element to the given power.
Source§

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

Raises the given element to the given power, which should be a positive integer belonging to an arbitrary IntegerRing. Read more
Source§

fn format<'a>( &'a self, value: &'a El<Self>, ) -> RingElementDisplayWrapper<'a, Self>

Returns an object that represents the given ring element and implements std::fmt::Display, to use as formatting parameter. Read more
Source§

fn println(&self, value: &El<Self>)

Prints the given element. Use for quick & dirty debugging.
Source§

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

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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> ZnRingStore for R
where R: RingStore, <R as RingStore>::Type: ZnRing,