Skip to content

num::factor_block_lu

Defined in header <linear/factorization/block_tridiagonal.hpp>

block_lu_factor factor_block_lu(const spmat &A, view<const idx> levels,
                                real scale = 1.0);

Factor a block-tridiagonal matrix by block LU without row pivoting.

The caller guarantees nonzero pivots in the block ordering, as for a nonsingular M-matrix, whose diagonal Schur blocks stay nonsingular M-matrices.

Parameters

  • A: Square sparse matrix whose nonzeros stay within adjacent level blocks.
  • levels: One level label per row; arbitrary values, compressed internally.
  • scale: Uniform scaling applied while assembling, so factor(scale*A) needs no copy.

Exceptions

  • std::invalid_argument: If A is not square, the level count is wrong, or a nonzero couples non-adjacent blocks.
  • std::runtime_error: If a diagonal Schur block has a zero pivot.