pub fn tridiagonal_solve<T: GpuFloat>(
_handle: &SolverHandle,
lower: &[T],
diag: &[T],
upper: &[T],
rhs: &mut [T],
n: usize,
) -> SolverResult<()>Expand description
Solves a tridiagonal system using the Thomas algorithm (sequential).
The system is: lower[i] * x[i-1] + diag[i] * x[i] + upper[i] * x[i+1] = rhs[i]
where lower[0] corresponds to a_1 (the sub-diagonal starting at row 1).
On exit, rhs is overwritten with the solution vector x.
§Arguments
_handle— solver handle (reserved for future GPU-accelerated variants).lower— sub-diagonal array of lengthn - 1.diag— main diagonal array of lengthn.upper— super-diagonal array of lengthn - 1.rhs— right-hand side of lengthn, overwritten with the solution.n— system dimension.
§Errors
Returns SolverError::DimensionMismatch if array lengths are invalid.
Returns SolverError::SingularMatrix if a zero pivot is encountered.