Skip to main content

Module

Trait Module 

Source
pub trait Module<R: Ring>: AbelianGroup {
    // 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".

Implementations on Foreign Types§

Source§

impl Module<f32> for f32

Source§

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

Source§

impl Module<f64> for f64

Source§

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

Source§

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

Source§

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

Implementors§