Struct feanor_math::ring::RingRef
source · pub struct RingRef<'a, R: RingBase + ?Sized> { /* private fields */ }Expand description
The second most basic crate::ring::RingStore. Similarly to
crate::ring::RingValue it is just a no-op container.
§Why do we need this in addition to crate::ring::RingValue?
The role of RingRef is much more niche than the role of crate::ring::RingValue.
However, it might happen that we want to implement crate::ring::RingBase-functions (or traits on the
same level, e.g. crate::ring::CanHomFrom, crate::divisibility::DivisibilityRing),
and use more high-level techniques for that (e.g. complex algorithms, for example crate::algorithms::eea
or crate::algorithms::sqr_mul). In this case, we only have a reference to a crate::ring::RingBase
object, but require a crate::ring::RingStore object to use the algorithm.
Implementations§
Trait Implementations§
source§impl<'a, R: RingBase + ?Sized> RingStore for RingRef<'a, R>
impl<'a, R: RingBase + ?Sized> RingStore for RingRef<'a, R>
type Type = R
fn get_ring(&self) -> &R
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>
See
RingBase::zero()source§fn one(&self) -> El<Self>
fn one(&self) -> El<Self>
See
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>)
fn coerce<S>(&self, from: &S, el: El<S>) -> El<Self>
source§fn into_identity(self) -> Identity<Self>
fn into_identity(self) -> Identity<Self>
Returns the identity map
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)>
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)>
fn into_can_iso<S>(self, from: S) -> Result<CanIso<S, Self>, (S, Self)>
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>>
fn can_hom<'a, S>(&'a self, from: &'a S) -> Option<CanHom<&'a S, &'a Self>>
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>>
fn can_iso<'a, S>(&'a self, from: &'a S) -> Option<CanIso<&'a S, &'a Self>>
Returns the canonical isomorphism
from -> self, if it exists.source§fn into_int_hom(self) -> IntHom<Self>
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>
fn int_hom<'a>(&'a self) -> IntHom<&'a Self>
Returns the homomorphism
Z -> self that exists for any ring.fn sum<I>(&self, els: I) -> El<Self>
fn prod<I>(&self, els: I) -> El<Self>
fn pow(&self, x: El<Self>, power: usize) -> El<Self>
fn pow_gen<R: IntegerRingStore>(
&self,
x: El<Self>,
power: &El<R>,
integers: R,
) -> El<Self>where
R::Type: IntegerRing,
source§fn format<'a>(
&'a self,
value: &'a El<Self>,
) -> RingElementDisplayWrapper<'a, Self>
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 morefn println(&self, value: &El<Self>)
fn characteristic<I: IntegerRingStore>(&self, ZZ: &I) -> Option<El<I>>where
I::Type: IntegerRing,
impl<'a, R: RingBase + ?Sized> Copy for RingRef<'a, R>
Auto Trait Implementations§
impl<'a, R> Freeze for RingRef<'a, R>where
R: ?Sized,
impl<'a, R> RefUnwindSafe for RingRef<'a, R>where
R: RefUnwindSafe + ?Sized,
impl<'a, R> Send for RingRef<'a, R>
impl<'a, R> Sync for RingRef<'a, R>
impl<'a, R> Unpin for RingRef<'a, R>where
R: ?Sized,
impl<'a, R> UnwindSafe for RingRef<'a, R>where
R: RefUnwindSafe + ?Sized,
Blanket Implementations§
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
Mutably borrows from an owned value. Read more