pub trait MonoidCtx {
    type Val: Clone;

    // Required methods
    fn e(&self) -> Self::Val;
    fn op(&self, left: &Self::Val, right: &Self::Val) -> Self::Val;
}
Expand description

モノイド

  • [Monoid::Val] : データの型 $S$
  • [Monoid::e] : 単位元を返す関数 $\varnothing \to S$
  • [Monoid::op] : 演算 $S\times S \to S$

Required Associated Types§

Source

type Val: Clone

データの型 ($S$)

Required Methods§

Source

fn e(&self) -> Self::Val

単位元 ($\varnothing \to S$)

Source

fn op(&self, left: &Self::Val, right: &Self::Val) -> Self::Val

演算 ($S \times S \to S$)

Implementors§

Source§

impl<T> MonoidCtx for AddMod<T>
where T: Clone + Zero + Add + Rem<Output = T>,

Source§

type Val = T

Source§

impl<T> MonoidCtx for MulMod<T>
where T: Clone + One + Mul + Rem<Output = T>,

Source§

type Val = T

Source§

impl<const K: usize, T: Clone> MonoidCtx for KBest<K, T>

Source§

type Val = [Option<T>; K]