#![allow(missing_docs)]
use ops::{Op, Additive};
use structure::GroupApprox;
use structure::Group;
pub trait GroupAbelianApprox<O: Op>
: GroupApprox<O>
{
fn prop_is_commutative_approx(args: (Self, Self)) -> bool {
let (a, b) = (|| args.0.clone(), || args.1.clone());
(a().approx(b())).approx_eq(&b().approx(a()))
}
}
impl_marker!(GroupAbelianApprox<Additive>; i8, i16, i32, i64);
pub trait GroupAbelian<O: Op>
: GroupAbelianApprox<O>
+ Group<O>
{
fn prop_is_commutative(args: (Self, Self)) -> bool {
let (a, b) = (|| args.0.clone(), || args.1.clone());
a().operate(b()) == b().operate(a())
}
}
impl_marker!(GroupAbelian<Additive>; i8, i16, i32, i64);