Skip to main content

rusolver/
lib.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Numerical linear algebra with explicit execution and failure contracts.
3//!
4//! Default: dependency-free, synchronous host FP64. No GPU tensor is implicitly
5//! downloaded and no existing ruda-tensor LU entry point is replaced.
6//! Optional `tensor`: native FP32 small batched LU/QR/Cholesky/eigen/CG kernels.
7//! `sparse` adapts ruSPARSE CSR; `collective` adapts existing ruCCL host TCP.
8//! Host SVD, complex decompositions, sparse LU and reverse-mode pullbacks are
9//! dependency-free. These APIs report limitations rather than densifying or
10//! changing the execution backend silently.
11//!
12//! This is an experimental numerical baseline, not LAPACK/cuSOLVER API parity.
13//! Dense inputs are nonempty, finite, row-major matrices; views also permit
14//! explicit positive strides and transposition. Numerical rank/pivot decisions
15//! use the supplied tolerance and do not estimate a condition number.
16mod error;
17mod matrix;
18mod numerics;
19mod lu;
20mod cholesky;
21mod qr;
22mod eigen;
23mod iterative;
24pub use error::{
25    SolverError, Tolerance
26};
27pub use matrix::{
28    Matrix, MatrixView
29};
30pub use numerics::{
31    l2_norm, relative_residual
32};
33pub use lu::Lu;
34pub use cholesky::{
35    Cholesky, CholeskyOptions
36};
37pub use qr::{
38    Qr, LeastSquares
39};
40pub use eigen::{
41    symmetric_eigen, EigenOptions, SymmetricEigen
42};
43pub use iterative::{
44    conjugate_gradient, CgOptions, CgReport, IterativeStatus,
45    IdentityPreconditioner, JacobiPreconditioner, LinearOperator, Preconditioner
46};
47#[cfg(feature = "sparse")]
48pub mod sparse;
49#[cfg(feature = "tensor")]
50pub mod tensor;
51#[cfg(test)]
52mod tests;
53
54mod svd;
55pub use svd::{Svd,SvdOptions};
56pub mod complex;
57pub mod sparse_direct;
58pub mod distributed;
59pub mod adjoint;
60#[cfg(test)]mod advanced_tests;
61
62#[cfg(test)]mod advanced_fixtures;
63
64/// Launch planning for explicit small-matrix warp-shared kernels.
65pub mod kernel_plan;