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
11
namespace
num
{
12
13
void
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
policy.hpp
Backend enum and default backend selection.
types.hpp
Core type definitions.
num
Definition
quadrature.hpp:8
num::Backend
Backend
Definition
policy.hpp:7
num::thomas
void thomas(const Vector &a, const Vector &b, const Vector &c, const Vector &d, Vector &x, Backend backend=lapack_backend)
Definition
thomas.cpp:12
num::lapack_backend
constexpr Backend lapack_backend
Definition
policy.hpp:66
num::Vector
BasicVector< real > Vector
Real-valued dense vector with full backend dispatch (CPU + GPU)
Definition
vector.hpp:129
vector.hpp
Dense vector storage and operations.
include
linalg
factorization
thomas.hpp
Generated by
1.9.8