Function navtk::solve_tridiagonal_overwrite
Defined in File linear_algebra.hpp
Function Documentation
-
Vector navtk::solve_tridiagonal_overwrite(Vector &low, Vector &mid, Vector &up, Vector &b)
Recursively solve a system of equations of the form Ax = b, where A is a tridiagonal matrix (zeros everywhere except on diagonal, and first upper and lower diagonals).
Uses the ‘overwrite’ algorithm; all inputs will be modified. See https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm.
- Parameters
low – Vector representation of lower diagonal of A, length N - 1.
mid – Vector representation of diagonal of A, length N. Diagonal must be free of zeros to avoid division by zero, but is not checked.
up – Vector representation of upper diagonal of A, length N - 1.
b – Solution vector of system to solve, length N.
- Returns
Vector x such that Ax = b.