cartan_manifolds/lib.rs
1// ~/cartan/cartan-manifolds/src/lib.rs
2
3//! Concrete Riemannian manifold implementations.
4//!
5//! Each manifold implements the traits from `cartan-core` using
6//! `nalgebra` `SVector` and `SMatrix` types for statically-sized storage.
7//!
8//! ## Available manifolds
9//!
10//! - [`Euclidean<N>`] -- R^N with the flat metric (trivial baseline)
11//! - [`Sphere<N>`] -- S^{N-1} in R^N with round metric
12//! - [`SpecialOrthogonal<N>`] -- SO(N) with bi-invariant metric
13//! - [`SpecialEuclidean<N>`] -- SE(N) with product metric
14//! - [`Corr<N>`] -- Corr(N) correlation matrices with Frobenius metric (flat)
15//! - [`Spd<N>`] -- SPD(N) with affine-invariant metric (Cartan-Hadamard)
16//! - [`Grassmann<N, K>`] -- Gr(N, K) with canonical metric
17//!
18//! ## no_std support
19//!
20//! `cartan-manifolds` is `no_std`-compatible when the `std` feature is disabled:
21//!
22//! ```toml
23//! cartan-manifolds = { version = "0.1", default-features = false, features = ["alloc"] }
24//! ```
25//!
26//! Available without `std` (requires `alloc`):
27//! [`Euclidean<N>`], [`Sphere<N>`], [`SpecialOrthogonal<N>`], [`SpecialEuclidean<N>`],
28//! [`Grassmann<N, K>`]
29//!
30//! Requires `std` (eigendecomposition or imports from qtensor):
31//! [`QTensor3`], [`Corr<N>`], [`Spd<N>`], [`FrameField3D`]
32
33#![cfg_attr(not(feature = "std"), no_std)]
34
35#[cfg(feature = "alloc")]
36extern crate alloc;
37
38// corr, frame_field, qtensor, spd use symmetric_eigen() from nalgebra (Jacobi); requires std.
39// grassmann uses DMatrix/SVD but NOT symmetric_eigen; requires alloc.
40#[cfg(feature = "std")]
41pub mod corr;
42pub mod euclidean;
43#[cfg(feature = "std")]
44pub mod frame_field;
45#[cfg(feature = "alloc")]
46pub mod grassmann;
47#[cfg(feature = "std")]
48pub mod qtensor;
49pub mod se;
50pub mod so;
51#[cfg(feature = "std")]
52pub mod spd;
53pub mod sphere;
54pub mod util;
55
56#[cfg(feature = "std")]
57pub use corr::Corr;
58pub use euclidean::Euclidean;
59#[cfg(feature = "std")]
60pub use frame_field::{FrameField3D, d2_gauge_fix};
61#[cfg(feature = "alloc")]
62pub use grassmann::Grassmann;
63#[cfg(feature = "std")]
64pub use qtensor::QTensor3;
65pub use se::{SEPoint, SETangent, SpecialEuclidean};
66pub use so::SpecialOrthogonal;
67#[cfg(feature = "std")]
68pub use spd::Spd;
69pub use sphere::Sphere;