Expand description
Discrete algebra spine.
This crate hosts the Semiring trait, the standard
semiring instances, and a generic dense / coordinate-list sparse matrix with
power and Kleene-closure engines. Graph reachability and all-pairs shortest
paths are derived from these (boolean closure, min-plus closure, counting
powers) rather than re-implemented per algorithm.
Boundary: depends only on thiserror (and later num-bigint). It must never
depend on sim-lib-rank or any music crate.
Re-exports§
pub use boolean::BoolRing;pub use cookbook::SemiringMatrixDemo;pub use cookbook::semiring_matrix_demo;pub use counting::Counting;pub use error::AlgebraError;pub use gf2::Gf2;pub use matrix::AlgebraLimits;pub use matrix::Matrix;pub use real::RealF64;pub use semiring::Semiring;pub use sparse::SparseEntry;pub use sparse::SparseMatrix;pub use tropical_max::MaxPlus;pub use tropical_min::MinPlus;pub use views::DiagonalView;pub use views::IdentityView;pub use views::PermutationView;
Modules§
- boolean
- The boolean semiring
(OR, AND). Closure gives transitive reachability. - closure
- Kleene closure
A* = I + A + A^2 + ...over a closed semiring. - cookbook
- Deterministic cookbook builders for discrete algebra recipes.
- counting
- The counting semiring over
BigUint. Powers count walks; closure counts paths in a nilpotent (acyclic) setting. - error
- Error type for the discrete algebra spine.
- gf2
- The two-element field GF(2):
addis XOR,mulis AND. Used for linear algebra overZ/2(rank, coding theory). - matrix
- Generic dense matrix over a
Semiring, with semiring matrix multiply. - power
- Matrix power by square-and-multiply.
A^k[i][j]over the counting semiring counts walks of lengthk; over min-plus it boundsk-edge shortest paths. - real
- The real semiring over
f64with ordinary+and*, plus a total order for algorithms that need to compare entries. Nostar(left as default). - semiring
- The
Semiringtrait: the algebraic core of the discrete-math family. - sparse
- Coordinate-list sparse matrix over a
Semiring. - tropical_
max - The bounded max-plus (tropical) semiring.
- tropical_
min - The bounded min-plus (tropical) semiring.
- views
- Implicit matrix views that act without materializing dense storage.
Statics§
- RECIPES
- Cookbook recipes for this lib, embedded at build time.