Skip to content

num::banded_factor

Defined in header <linear/banded/banded.hpp>

template <std::floating_point T, class Index>
bool banded_factor(T *ab, idx ldab, idx n, idx kl, idx ku, Index *ipiv) noexcept;

banded LU factorization with partial pivoting over LAPACK-compatible band storage, as LAPACK gbtf2.

ab is column-major with ldab >= 2*kl + ku + 1 rows; \(A_{ij}\) sits at band row kl + ku + i - j. A row swap can bring in entries up to kl + ku past the diagonal, so \(U\) has bandwidth kl + ku and fills the first kl band rows, which are zeroed here. The multipliers of \(L\) stay where each column's elimination wrote them: later swaps are not applied to them, so banded_solve interleaves the swaps with the forward substitution. Returns false if a pivot column is entirely zero.