Skip to content

num::lu_diagonal_shift_derivative

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

template <std::floating_point T>
mat<T> lu_diagonal_shift_derivative(const lu_result<T> &f);

Derivative of the packed factors in \(A+sI=L_sU_s\) at \(s=0\).

The returned matrix uses the same packed layout as lu_result: entries on and above the diagonal contain \(\dot U\), and entries below it contain \(\dot L\). Since \(L_s\) is unit lower triangular, its diagonal derivative is zero and is not stored. This differentiates the Doolittle recurrence directly and costs one additional dense factorization pass; it does not form an inverse or refactor a shifted matrix.

Exceptions

  • std::invalid_argument: If f is singular or was computed with row pivoting.