Skip to main content

lapack_inject/
lib.rs

1//! # lapack-inject
2//!
3//! LAPACK compatible interface backed by Fortran LAPACK function pointers.
4//!
5//! This crate allows you to use LAPACK functions while the actual computation
6//! is performed by Fortran LAPACK functions provided at runtime.
7//! This is useful for integrating with Python (scipy) or Julia (libblastrampoline)
8//! where Fortran LAPACK pointers are available.
9//!
10//! ## Usage
11//!
12//! ```ignore
13//! use lapack_inject::register_dgesv_lp64;
14//!
15//! // Register Fortran dgesv pointer (e.g., from scipy or Julia)
16//! unsafe {
17//!     let status = register_dgesv_lp64(dgesv_ptr);
18//!     assert_eq!(status, 0);
19//! }
20//!
21//! // Now lapack_inject exports dgesv_ symbol that can be used by other crates
22//! ```
23//!
24//! ## lapack-src/lapack-sys Compatibility
25//!
26//! This crate exports a generated subset of Fortran-style LAPACK symbols such
27//! as `dgesv_`, `dgetrf_`, and `dgesc2_`. Register LP64 or ILP64 function
28//! pointers at runtime, and this crate provides those symbols to downstream
29//! crates that expect a LAPACK provider.
30//!
31//! LAPACKE-style C entry points are exported for `dgesv`, `dgetrf`, `dgetri`,
32//! and `dpotrf`, including `_64` variants and row-major layout handling.
33//!
34//! ## Supported Functions
35//!
36//! The generated Fortran surface supports:
37//!
38//! - `xGESV`, `xGETRF`, `xGETRS`, `xGETRI`, `xPOTRF`
39//! - `xGESVD`
40//! - `xGEQRF`, real `xORGQR`, complex `xUNGQR`
41//! - `xTRTRS`
42//! - `s/dSYEV`, `c/zHEEV`
43//! - `xGEEV`
44//! - supplemental complete-pivoting LU routines `xGETC2` and `xGESC2`
45//!
46//! The default build keeps the consumer-facing Fortran symbols LP64-compatible.
47//! Register ILP64 host providers with the `_ilp64` registration functions; do not
48//! enable the `ilp64` feature just because the host provider is ILP64. The feature
49//! changes the consumer ABI too.
50
51mod backend;
52pub mod fortran;
53pub mod lapacke;
54mod types;
55
56pub use backend::*;
57pub use fortran::*;
58pub use lapacke::*;
59pub use types::*;