Skip to main content

Crate use_eigen

Crate use_eigen 

Source
Expand description

§use-eigen

Small eigenvalue, eigenvector, and eigensystem primitives for RustUse.
Structural linear-algebra vocabulary for eigenpairs and eigenspaces without claiming to solve arbitrary eigenproblems.

Rust 1.95.0+ Edition 2024 Eigen primitives License MIT or Apache-2.0

§Install

[dependencies]
use-eigen = "0.0.6"

§Foundation

use-eigen provides a deliberately small structural surface for representing eigenvalues, eigenvectors, eigenpairs, eigensystems, multiplicities, and eigenspaces. The crate is intended to establish shared vocabulary and explicit data ownership for RustUse code that needs eigen-related concepts without pulling in a numerical solver stack.

This first version does not compute eigenvalues for arbitrary matrices. It stores and validates the conceptual pieces you already have, and leaves full numerical eigensolvers to future specialized crates or later well-tested work.

Explicit wrappers
Eigenvalue and Eigenvector make scalar and coordinate intent visible at the type level.
Structural grouping
Eigenpair, Eigensystem, and EigenSpace group related eigen data without implying any solver implementation.
Validated construction
Empty eigenvectors, eigensystems, and eigenspace bases are rejected with explicit EigenError values.
Helper groupPrimary itemsBest fit
Scalar wrappersEigenvalueCode that wants explicit eigenvalue intent instead of a raw scalar
Vector wrappersEigenvector, EigenErrorCode that wants validated coordinate storage for eigenvectors
Pair and system dataEigenpair, EigensystemCode that already has eigen data and needs a lightweight storage model
Space and countsEigenSpace, EigenMultiplicityCode that wants eigenspace or multiplicity concepts without solver machinery

§When to use directly

Choose use-eigen directly when you want explicit eigen-related data types but do not want a broader numerical linear-algebra dependency.

ScenarioUse use-eigen directly?Why
You need to store an eigenvalue and matching eigenvectorYesEigenpair keeps the relationship explicit and lightweight
You need a validated, non-empty eigenvector wrapperYesConstruction rejects empty coordinate storage through EigenError
You need a full numerical eigensolverNoThat is intentionally outside this crate’s current scope
You want one facade for multiple math domainsUsually nouse-math can compose this crate with the rest of the RustUse math surface

§Scope

  • use-eigen is about small structural types for eigen-related concepts.
  • It does not attempt QR, power-iteration, Jacobi, or generalized eigenvalue solvers.
  • It does not claim that any stored vector has been verified against a matrix.
  • It keeps construction explicit and dependency-free so higher-level crates can compose it later.

§Examples

§Create an eigenvalue

use use_eigen::Eigenvalue;

let lambda = Eigenvalue::new(3.0);

assert_eq!(*lambda.as_ref(), 3.0);

§Create an eigenvector

use use_eigen::Eigenvector;

let vector = Eigenvector::new(vec![1.0, 0.0])?;

assert_eq!(vector.coordinates(), &[1.0, 0.0]);

§Create an eigenpair

use use_eigen::{Eigenpair, Eigenvalue, Eigenvector};

let pair = Eigenpair::new(
    Eigenvalue::new(3.0),
    Eigenvector::new(vec![1.0, 0.0])?,
);

assert_eq!(*pair.value().as_ref(), 3.0);
assert_eq!(pair.vector().coordinates(), &[1.0, 0.0]);

§Create an eigensystem

use use_eigen::{Eigenpair, Eigensystem, Eigenvalue, Eigenvector};

let system = Eigensystem::new(vec![
    Eigenpair::new(
        Eigenvalue::new(2.0),
        Eigenvector::new(vec![1.0, 0.0])?,
    ),
    Eigenpair::new(
        Eigenvalue::new(5.0),
        Eigenvector::new(vec![0.0, 1.0])?,
    ),
])?;

assert_eq!(system.len(), 2);

§Status

use-eigen is a concrete pre-1.0 crate in the RustUse math workspace. The current surface is intentionally structural, explicit, and dependency-free. Future numerical eigensolvers may be added later or delegated to a more specialized crate once they can be implemented and tested rigorously. Small structural eigenvalue primitives for RustUse.

Re-exports§

pub use eigenpair::Eigenpair;
pub use eigenspace::EigenSpace;
pub use eigensystem::Eigensystem;
pub use eigenvalue::Eigenvalue;
pub use eigenvector::Eigenvector;
pub use error::EigenError;
pub use multiplicity::EigenMultiplicity;

Modules§

eigenpair
eigenspace
eigensystem
eigenvalue
eigenvector
error
multiplicity