1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//! Safe Rust wrapper around ARPACK-NG.
//!
//! Provides safe drivers for the supported eigenproblem variants
//! (real-symmetric Lanczos and complex Arnoldi). Callers that need
//! to drive ARPACK manually should depend on `arpack-sys` directly.
//!
//! # Example
//!
//! Smallest eigenvalue of `diag(1, 2, 3)`:
//!
//! ```
//! use arpack::{Options, smallest_eigenpair_f64};
//!
//! let diag = [1.0_f64, 2.0, 3.0];
//! let n = diag.len();
//!
//! let solution = smallest_eigenpair_f64(
//! n,
//! |x, y| {
//! for i in 0..n {
//! y[i] = diag[i] * x[i];
//! }
//! },
//! &Options::default(),
//! )
//! .expect("ARPACK converged");
//!
//! assert!((solution.eigenvalue - 1.0).abs() < 1e-9);
//! ```
//!
//! # Current limitations
//!
//! Each driver exposes only the smallest eigenpair (`nev = 1`)
//! with a fixed `which` selector — `"SA"` (smallest algebraic)
//! for the real-symmetric Lanczos driver, `"SR"` (smallest real
//! part) for the complex Arnoldi driver. Multi-eigenvalue
//! extraction (`nev > 1`) and a configurable `which` selector
//! are tracked at <https://github.com/ultimatile/arpack-rs/issues/1>.
pub use Error;
pub use EigSolution;
// Crate-root re-exports for the symmetric driver were the public API
// before the `arnoldi` module landed; preserve them so existing
// callers do not need to update their imports. The Arnoldi module's
// own `Options` lives at `arpack::arnoldi::Options` to avoid
// colliding with the symmetric one re-exported here.
pub use ;