Condition number estimation in Rust
This crate implements the matrix 1-norm estimator by Higham and Tisseur (Algorithm 2.4 on page 7 (1190)) in the linked PDF.
It uses the excellent rust-ndarray crate for matrix storage.
Todo
Right now, this crate only returns the 1-norm, and further allocates anew on every call
to normest1. It does not currently yield the vectors necessary to calculate the actual
condition number. This isn't hard to do, but needs to be implemented... Outstanding are:
- Return vectors required for calculating the 1-norm;
- Create a struct holding the necessary temporaries to repeatedly call
normest1without extra allocation. - Implement extra tests to mimic the numerical experiments in Higham and Tisseur.
- Make some nice docs.
Example usage
The example below generates a random matrix a and estimates its 1-norm. On average, this gives
pretty good results. Of course, there are some matrices where this algorithm severely underestimates
the actual 1-norm. See Higham and Tisseur for more.
Important: You need to explicitly link to a BLAS + LAPACK provider such as openblas_src.
See the explanations given at the blas-lapack-rs organization.
extern crate openblas_src; // Need to declare `openblas_src` (or some other BLAS provider) explicitly to link to a BLAS library.
use ;
use RandomExt;
use ;
use StandardNormal;
use Xoshiro256Plus;