Skip to main content

Module fd_solvers

Module fd_solvers 

Source
Expand description

Finite-difference (PDE) solvers for 1-D, 2-D and 3-D problems, one scheme per file — numerical kernels only, independent of any payoff or grid, so they are usable as a standalone FD toolkit.

Linear kernels (consumed by the equity FD engine, equity::finite_difference):

  • tridiagonal: the Thomas algorithm for A x = d with a tridiagonal A — the workhorse of every implicit 1-D step;
  • [brennan_schwartz]: the Brennan-Schwartz sweep for the linear complementarity problem A x = d, x >= exercise of American exercise (one-sided obstacle, exact, O(n));
  • [psor]: projected SOR for the general LCP — two-sided obstacles (callable/putable structures) and the smoother inside splitting schemes.

Multi-dimensional machinery (for two/three-factor models such as Heston or hybrid equity-rates):

  • axis_operator: TensorGrid + AxisOperator — per-axis tridiagonal operators with node-varying coefficients, with explicit application and line-by-line implicit solves;
  • adi: the Douglas and Hundsdorfer-Verwer ADI time steppers over those operators, with mixed-derivative terms (correlation) handled explicitly. One axis with no mixed term reduces exactly to the 1-D theta scheme.

Craig-Sneyd / Modified Craig-Sneyd steppers would slot into adi alongside the existing two if ever needed.

Re-exports§

pub use adi::douglas_step;
pub use adi::hundsdorfer_verwer_step;
pub use axis_operator::AxisOperator;
pub use axis_operator::TensorGrid;
pub use brennan_schwartz::brennan_schwartz;
pub use psor::psor;
pub use psor::PsorResult;
pub use tridiagonal::thomas_algorithm;

Modules§

adi
ADI (alternating direction implicit) time steppers for 1-D, 2-D and 3-D parabolic PDEs u_t = sum_k A_k u + A_0 u, where each A_k is a per-axis tridiagonal AxisOperator and A_0 is an optional explicitly-treated part (typically the mixed derivatives of correlated factors, e.g. the rho S v u_Sv term of Heston).
axis_operator
Per-axis tridiagonal operators on tensor-product grids — the building block for 1-D, 2-D and 3-D finite-difference schemes.
brennan_schwartz
Brennan-Schwartz solve of the American-exercise linear complementarity problem on a tridiagonal system.
psor
Projected SOR (PSOR): iterative solve of the tridiagonal linear complementarity problem with one- or two-sided obstacles.
tridiagonal
The Thomas algorithm: direct O(n) solve of a tridiagonal system.