Skip to main content

Module ldlt

Module ldlt 

Source
Expand description

Symmetric Indefinite Factorization (LDL^T / Bunch-Kaufman).

Computes P * A * P^T = L * D * L^T where:

  • P is a permutation matrix (encoded in pivot_info)
  • L is unit lower triangular
  • D is block diagonal with 1x1 and 2x2 blocks

§Algorithm — Bunch-Kaufman Pivoting

At each step, the algorithm decides whether to use a 1x1 or 2x2 pivot by examining the magnitudes of diagonal and off-diagonal elements:

  1. Let alpha = (1 + sqrt(17)) / 8 (~0.6404).
  2. Find lambda = max |A[i, k]| for i != k (largest off-diagonal in column k).
  3. If |A[k,k]| >= alpha * lambda: use 1x1 pivot at position k.
  4. Otherwise, find sigma = max |A[i, r]| for i != r, where r is the row achieving lambda.
  5. If |A[k,k]| * sigma >= alpha * lambda^2: use 1x1 pivot.
  6. If |A[r,r]| >= alpha * sigma: use 1x1 pivot at position r (with swap).
  7. Otherwise: use 2x2 pivot at positions (k, r).

This guarantees bounded element growth in L.

Structs§

LdltResult
LDL^T factorization result.

Functions§

ldlt
Computes the Bunch-Kaufman LDL^T factorization of a symmetric indefinite matrix.
ldlt_solve
Solves A * x = b using the LDL^T factorization.