1#ifndef FUSED_ALGORITHMS_TRIDIAGONAL_H
2#define FUSED_ALGORITHMS_TRIDIAGONAL_H
88 template <
typename T, my_
size_t N>
95 static_assert(is_floating_point_v<T>,
96 "thomas_solve requires a floating-point scalar type");
113 dp(i) = dp(i) - w * c(i - 1);
114 bp(i) = bp(i) - w * bp(i - 1);
126 x(N - 1) = bp(N - 1) / dp(N - 1);
130 x(i) = (bp(i) - c(i) * x(i + 1)) / dp(i);
A discriminated union holding either a success value or an error.
Definition expected.h:86
Definition fused_vector.h:9
Global configuration for the tesseract tensor library.
#define my_size_t
Size/index type used throughout the library.
Definition config.h:126
#define PRECISION_TOLERANCE
Tolerance for floating-point comparisons (e.g. symmetry checks, Cholesky).
Definition config.h:117
A minimal, STL-free expected/result type for failable operations.
Runtime property descriptors and error codes for matrices.
constexpr T abs(T x) noexcept
Compute the absolute value of a numeric value.
Definition math_utils.h:48
Expected< FusedVector< T, N >, MatrixStatus > thomas_solve(const FusedVector< T, N > &a, const FusedVector< T, N > &d, const FusedVector< T, N > &c, const FusedVector< T, N > &b)
Solve a tridiagonal system Ax = b using the Thomas algorithm.
Definition tridiagonal.h:89
MatrixStatus
Error codes for matrix decomposition and solver algorithms.
Definition matrix_traits.h:33
constexpr remove_reference_t< T > && move(T &&t) noexcept
Cast to rvalue reference (replacement for std::move).
Definition simple_type_traits.h:178
Tag type for constructing an Expected in the error state.
Definition expected.h:30