Skip to main content

rustyqlib/core/fd_solvers/
mod.rs

1//! Finite-difference (PDE) solvers for 1-D, 2-D and 3-D problems, one
2//! scheme per file — numerical kernels only, independent of any payoff or
3//! grid, so they are usable as a standalone FD toolkit.
4//!
5//! **Linear kernels** (consumed by the equity FD engine,
6//! [`equity::finite_difference`](crate::equity::finite_difference)):
7//!
8//! - [`tridiagonal`]: the Thomas algorithm for `A x = d` with a
9//!   tridiagonal `A` — the workhorse of every implicit 1-D step;
10//! - [`brennan_schwartz`]: the Brennan-Schwartz sweep for the linear
11//!   complementarity problem `A x = d, x >= exercise` of American
12//!   exercise (one-sided obstacle, exact, O(n));
13//! - [`psor`]: projected SOR for the general LCP — two-sided obstacles
14//!   (callable/putable structures) and the smoother inside splitting
15//!   schemes.
16//!
17//! **Multi-dimensional machinery** (for two/three-factor models such as
18//! Heston or hybrid equity-rates):
19//!
20//! - [`axis_operator`]: [`TensorGrid`](axis_operator::TensorGrid) +
21//!   [`AxisOperator`](axis_operator::AxisOperator) — per-axis tridiagonal
22//!   operators with node-varying coefficients, with explicit application
23//!   and line-by-line implicit solves;
24//! - [`adi`]: the Douglas and Hundsdorfer-Verwer ADI time steppers over
25//!   those operators, with mixed-derivative terms (correlation) handled
26//!   explicitly. One axis with no mixed term reduces exactly to the 1-D
27//!   theta scheme.
28//!
29//! Craig-Sneyd / Modified Craig-Sneyd steppers would slot into [`adi`]
30//! alongside the existing two if ever needed.
31
32pub mod adi;
33pub mod axis_operator;
34pub mod brennan_schwartz;
35pub mod psor;
36pub mod tridiagonal;
37
38pub use adi::{douglas_step, hundsdorfer_verwer_step};
39pub use axis_operator::{AxisOperator, TensorGrid};
40pub use brennan_schwartz::brennan_schwartz;
41pub use psor::{psor, PsorResult};
42pub use tridiagonal::thomas_algorithm;