Skip to main content

Module direct

Module direct 

Source
Expand description

Direct sparse solver via dense LU factorization.

Provides a simple direct solve path for small-to-medium sparse systems by delegating to the dense LU factorization and solve routines. This is useful as a fallback when iterative methods fail to converge or when the system is small enough that direct methods are competitive.

For large sparse systems, use the iterative solvers (CG, BiCGSTAB, GMRES) which are much more memory-efficient.

Functionsยง

direct_solve
Solves A * X = B directly using dense LU factorization.
prefer_direct_solver
Returns true if the direct sparse solver (dense LU) is preferred over iterative methods for the given system dimensions and density.