numerics 0.1.0
Loading...
Searching...
No Matches
thomas.hpp
Go to the documentation of this file.
1/// @file factorization/thomas.hpp
2/// @brief Thomas algorithm for tridiagonal systems.
3///
4/// Solves \f$a_{i-1}x_{i-1}+b_i x_i+c_i x_{i+1}=d_i\f$ in \f$O(n)\f$.
5#pragma once
6
7#include "core/policy.hpp"
8#include "core/types.hpp"
9#include "core/vector.hpp"
10
11namespace num {
12
13void thomas(const Vector& a,
14 const Vector& b,
15 const Vector& c,
16 const Vector& d,
17 Vector& x,
18 Backend backend = lapack_backend);
19
20} // namespace num
Backend enum and default backend selection.
Core type definitions.
Backend
Definition policy.hpp:7
void thomas(const Vector &a, const Vector &b, const Vector &c, const Vector &d, Vector &x, Backend backend=lapack_backend)
Definition thomas.cpp:12
constexpr Backend lapack_backend
Definition policy.hpp:66
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
Definition vector.hpp:129
Dense vector storage and operations.