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> From<Loop<'a, T>> for Quasigroup<'a, T>
impl<'a, T: Copy + PartialEq> From<Loop<'a, T>> for Quasigroup<'a, T>
source§fn from(loop_: Loop<'a, T>) -> Quasigroup<'a, T>
fn from(loop_: Loop<'a, T>) -> Quasigroup<'a, T>
Converts to this type from the input type.