Skip to main content

legume_numeric/
lib.rs

1//! Numeric / ML foundation for the legume ecosystem.
2//!
3//! Modules:
4//! - [`leiden`] — vendored CWTS/10x Leiden port (see `NOTICE`)
5//! - [`matrix`] — matrix IO, KNN, layout, stats (ex `matrix-util`)
6//! - `param` — parametric helpers (ex `matrix-param`)
7//! - `candle` — candle training helpers (ex `candle-util`; feature `candle`)
8//! - `mcmc` — MCMC diagnostics: effective sample size, split R̂ (feature `mcmc`)
9//!
10//! Features: `matrix` and `param` work on nalgebra `DMatrix` alone.
11//! `tensor` (default) adds candle `Tensor` support to the matrix code:
12//! conversions, tensor IO, sampling and fused ops. `ndarray` (default) adds
13//! ndarray `Array2` support: IO, sampling, `ndarray_stat`, `ndarray_gamma`
14//! and kNN from ndarray views. `candle` builds on `tensor`. A crate
15//! that only needs `DMatrix` sets `default-features = false` and links
16//! neither candle nor ndarray.
17
18pub mod leiden;
19
20/// candle-core, for crates that use `Tensor` through the `tensor` feature
21/// without a direct dependency on candle.
22#[cfg(feature = "tensor")]
23pub use candle_core;
24
25#[cfg(feature = "matrix")]
26pub mod matrix;
27
28#[cfg(feature = "param")]
29pub mod param;
30
31#[cfg(feature = "candle")]
32pub mod candle;
33
34#[cfg(feature = "mcmc")]
35pub mod mcmc;