Skip to main content

Ring

Trait Ring 

Source
pub trait Ring:
    AddGrp
    + Mon
    + RingOps
where for<'a> &'a Self: RingOps<Self>,
{ // Required methods fn inv(&self) -> Option<Self>; fn is_unit(&self) -> bool; fn normalizing_unit(&self) -> Self; // Provided methods fn from_sign(s: Sign) -> Self { ... } fn normalized(&self) -> Self { ... } fn into_normalized(self) -> Self { ... } fn is_pm_one(&self) -> bool { ... } fn c_weight(&self) -> f64 { ... } }
Expand description

A ring: an AddGrp together with an associative multiplication · distributing over addition +, with multiplicative identity One.

See: https://en.wikipedia.org/wiki/Ring_(mathematics)

Required Methods§

Source

fn inv(&self) -> Option<Self>

Multiplicative inverse, if this element is a unit; otherwise None.

Source

fn is_unit(&self) -> bool

true iff this element is a unit (has a multiplicative inverse).

See: https://en.wikipedia.org/wiki/Unit_(ring_theory)

Source

fn normalizing_unit(&self) -> Self

A unit u such that self * u is the chosen canonical associate of self.

For example, in the normalizing unit of -n is -1 (giving n); in a field every nonzero element is its own normalizer (returning self.inv()).

See: https://en.wikipedia.org/wiki/Associate_element

Provided Methods§

Source

fn from_sign(s: Sign) -> Self

+1 if s is positive, -1 otherwise.

Source

fn normalized(&self) -> Self

The canonical associate of self (i.e. self * self.normalizing_unit()).

Source

fn into_normalized(self) -> Self

Like normalized, but consuming.

Source

fn is_pm_one(&self) -> bool

true iff self is +1 or -1.

Source

fn c_weight(&self) -> f64

Heuristic cost of working with this element, used by chain-reduction pivot selection. Default: 0.0 for zero, 1.0 otherwise.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Ring for BigInt

Source§

fn inv(&self) -> Option<Self>

Source§

fn is_unit(&self) -> bool

Source§

fn normalizing_unit(&self) -> Self

Source§

fn c_weight(&self) -> f64

Source§

impl Ring for i32

Source§

fn inv(&self) -> Option<Self>

Source§

fn is_unit(&self) -> bool

Source§

fn normalizing_unit(&self) -> Self

Source§

fn c_weight(&self) -> f64

Source§

impl Ring for i64

Source§

fn inv(&self) -> Option<Self>

Source§

fn is_unit(&self) -> bool

Source§

fn normalizing_unit(&self) -> Self

Source§

fn c_weight(&self) -> f64

Source§

impl Ring for i128

Source§

fn inv(&self) -> Option<Self>

Source§

fn is_unit(&self) -> bool

Source§

fn normalizing_unit(&self) -> Self

Source§

fn c_weight(&self) -> f64

Implementors§

Source§

impl Ring for FF2

Source§

impl<I, const D: i32> Ring for QuadInt<I, D>
where I: IntType, for<'x> &'x I: IntOps<I>,

Source§

impl<T> Ring for Ratio<T>
where T: EucRing, for<'x> &'x T: EucRingOps<T>,

Source§

impl<X, R> Ring for PolyBase<X, R>
where X: Mono, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

impl<const p: i32> Ring for FF<p>