pub struct Loop<'a, T> { /* private fields */ }Expand description
A quasigroup with identity
Loop is a representation of the abstract algebraic loop. Cancellativity
(ie. the Latin Square property) and identity preservation are both required
of its binary operation. Its construction involves a set (specifically an
AlgaeSet) and a BinaryOperation with the aforementioned properties.
Examples
use algae_rs::algaeset::AlgaeSet;
use algae_rs::mapping::{BinaryOperation, LoopOperation};
use algae_rs::magma::{Magmoid, Loop};
let mut add = LoopOperation::new(&|a, b| a + b, 0);
let mut quasigroup = Loop::new(
AlgaeSet::<i32>::all(),
&mut add,
0
);
let sum = quasigroup.with(1, 2);
assert!(sum.is_ok());
assert!(sum.unwrap() == 3);Implementations§
Trait Implementations§
source§impl<'a, T: Copy + PartialEq> Into<Quasigroup<'a, T>> for Loop<'a, T>
impl<'a, T: Copy + PartialEq> Into<Quasigroup<'a, T>> for Loop<'a, T>
source§fn into(self) -> Quasigroup<'a, T>
fn into(self) -> Quasigroup<'a, T>
Converts this type into the (usually inferred) input type.