use abstalg::Domain;
use mask::Mask;
mod algebra;
mod basis;
mod mask;
mod metric;
mod multivector;
mod scalar;
#[allow(unused_imports)]
pub use algebra::{SynAlgebra, SynBasis, SynMultivector};
#[allow(unused_imports)]
pub use basis::{BasisScalar, BasisSpace, Frame};
#[allow(unused_imports)]
pub use metric::Metric;
pub use scalar::{Scalar, ScalarSpace};
#[allow(dead_code)]
pub trait AnalyticOps {
fn abs(self) -> Self;
fn sqrt(self) -> Self;
fn exp(self) -> Self;
fn ln(self) -> Self;
fn sin(self) -> Self;
fn cos(self) -> Self;
fn sinh(self) -> Self;
fn cosh(self) -> Self;
fn asinh(self) -> Self;
fn atan2(self, other: Self) -> Self;
fn powi(self, exp: i32) -> Self;
}
pub trait Graded: Domain {
type Grade;
type Output;
fn grade_of(&self, elem: &Self::Elem) -> Self::Grade;
fn grade_by(&self, elem: &Self::Elem, grade: Self::Grade) -> Self::Output;
}
pub trait Duality: Domain {
type Psuedo;
type Output;
fn dual(&self, elem: &Self::Elem, psuedo: &Self::Psuedo) -> Self::Output;
fn undual(&self, elem: &Self::Elem, psuedo: &Self::Psuedo) -> Self::Output;
}
pub trait Involution: Domain {
type Output;
#[must_use]
fn automorphism(&self, elem: Self::Elem) -> Self::Output;
#[must_use]
fn reverse(&self, elem: Self::Elem) -> Self::Output;
fn conjugate(&self, elem: Self::Elem) -> Self::Output;
}
pub trait InnerProduct: Domain {
type Output;
fn inner(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
pub trait ExteriorProduct: Domain {
type Output;
fn wedge(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
pub trait RegressiveProduct: Domain {
type Output;
fn antiwedge(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait CommutatorProduct: Domain {
type Output;
fn commutate(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait AnticommutatorProduct: Domain {
type Output;
fn anticommutate(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
pub trait LeftContraction: Domain {
type Output;
fn contract_onto(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
pub trait RightContraction: Domain {
type Output;
fn contract_by(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait ScalarProduct: Domain {
type Output;
fn scalar_product(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait DotProduct: Domain {
type Output;
fn dot(&self, lhs: &Self::Elem, rhs: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait Divisibility: Domain {
fn try_div(&self, _elem1: &Self::Elem, _elem2: &Self::Elem) -> Option<Self::Elem>;
}
#[allow(dead_code)]
pub trait Positivity: Domain {
fn is_positive(&self, elem: &Self::Elem) -> bool;
}
#[allow(dead_code)]
pub trait SquareRoot: Domain {
type Output;
fn sqrt(&self, elem: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait Exponential: Domain {
type Output;
fn exp(&self, elem: &Self::Elem) -> Self::Output;
fn ln(&self, elem: &Self::Elem) -> Self::Output;
}
#[allow(dead_code)]
pub trait GeometricProducts:
InnerProduct
+ ExteriorProduct
+ RegressiveProduct
+ CommutatorProduct
+ AnticommutatorProduct
+ LeftContraction
+ RightContraction
+ ScalarProduct
+ DotProduct
+ Sized
{
}
#[allow(dead_code)]
pub trait CliffordAlgebra:
Domain + Graded + Duality + Involution + GeometricProducts + Divisibility + Exponential
{
}