reefer 0.3.0

Optimizing proc-macro for geometric algebra
Documentation
// Small example port of the "Look, Ma, No Matrices!" helper functions into Rust using Reefer's PGA3D algebra.
// This is a work-in-progress example, need common subexpression elimination already at this point.

#[allow(unused_macros)]
#[reefer::algebra(f32, 4, 1)]
mod pga3d {
    basis!(e0 = N0 + P0);
    basis!(e1 = P1);
    basis!(e2 = P2);
    basis!(e3 = P3);

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Motor { 1, e23, e31, e12, e01, e02, e03, e0123 });

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Point { e032, e013, e021 });

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Direction { e032, e013, e021 });

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Line {
        e23,
        e31,
        e12,
        e01,
        e02,
        e03
    });

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Vector { e1, e2, e3 });

    #[derive(Debug, Clone, Copy, PartialEq)]
    shape!(Scalar { 1 });
}

fn main() {
    // build algebraic closures via `expr!` so the optimizer can rewrite them.
    let _sw_mp_calc = pga3d::expr!(|m: pga3d::Motor, p: pga3d::Point| m.sandwich(p));
    // todo: sandwich product explodes without CSE
}