Skip to main content

Module

Trait Module 

Source
pub trait Module<R>: AbelianGroup
where R: Ring,
{ // Required method fn scale(self, scalar: R) -> Self; }
Expand description

A module over a ring R — an abelian group with scalar multiplication.

Laws:

  • a.scale(R::one()) == a
  • a.scale(r).scale(s) == a.scale(r.mul(s))
  • a.combine(b).scale(r) == a.scale(r).combine(b.scale(r))
  • a.scale(r.add(s)) == a.scale(r).combine(a.scale(s))

Required Methods§

Source

fn scale(self, scalar: R) -> Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Module<f32> for f32

Source§

fn scale(self, scalar: f32) -> f32

Source§

impl Module<f64> for f64

Source§

fn scale(self, scalar: f64) -> f64

Source§

impl<F> Module<F> for (F, F)
where F: Field + AbelianGroup,

Source§

fn scale(self, scalar: F) -> (F, F)

Implementors§