Skip to main content

AddMon

Trait AddMon 

Source
pub trait AddMon:
    MathType
    + Zero
    + AddMonOps
    + AddAssign
    + for<'a> AddAssign<&'a Self>
where for<'a> &'a Self: AddMonOps<Self>,
{ // Provided method fn sum<A, I>(itr: I) -> Self where Self: AddAssign<A>, I: IntoIterator<Item = A> { ... } }
Expand description

An additive monoid: a set with associative, commutative addition + and identity Zero.

See: https://en.wikipedia.org/wiki/Monoid, https://en.wikipedia.org/wiki/Commutative_monoid

Provided Methods§

Source

fn sum<A, I>(itr: I) -> Self
where Self: AddAssign<A>, I: IntoIterator<Item = A>,

Sum an iterator into Self, folding with +=.

A is any type for which Self: AddAssign<A> — typically Self or &Self.

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 AddMon for BigInt

Source§

impl AddMon for i32

Source§

impl AddMon for i64

Source§

impl AddMon for i128

Implementors§

Source§

impl AddMon for FF2

Source§

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

Source§

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

Source§

impl<X, R> AddMon for Lc<X, R>
where X: LcKey, R: Ring, for<'x> &'x R: RingOps<R>,

Source§

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

Source§

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