clifford_codegen/lib.rs
1//! Code generator for optimized geometric algebra types.
2//!
3//! This crate provides tools to generate Rust code for geometric algebra
4//! operations. Given an algebra specification (signature + type definitions),
5//! it generates optimized, strongly-typed code for all products and operations.
6//!
7//! # Architecture
8//!
9//! - [`algebra`]: Core blade algebra computations (signs, products, grades)
10//! - [`discovery`]: Automatic entity discovery from geometric constraints
11//! - [`spec`]: TOML specification parsing and validation
12//! - [`codegen`]: Code generation from specifications
13//! - [`symbolic`]: Symbolic constraint verification (requires `symbolic` feature)
14//!
15//! # Example
16//!
17//! ```
18//! use clifford_codegen::algebra::{Algebra, Blade, ProductTable};
19//!
20//! // Create a 3D Euclidean algebra
21//! let algebra = Algebra::euclidean(3);
22//!
23//! // Build product table
24//! let table = ProductTable::new(&algebra);
25//!
26//! // Compute e1 * e2
27//! let e1 = Blade::basis(0);
28//! let e2 = Blade::basis(1);
29//! let (sign, result) = table.geometric(e1.index(), e2.index());
30//!
31//! assert_eq!(sign, 1);
32//! assert_eq!(result, 0b11); // e12
33//! ```
34
35pub mod algebra;
36pub mod codegen;
37pub mod discovery;
38pub mod spec;
39pub mod symbolic;