numerics 0.1.0
Loading...
Searching...
No Matches
tridiag_complex.hpp
Go to the documentation of this file.
1/// @file factorization/tridiag_complex.hpp
2/// @brief Precomputed Thomas solver for constant-coefficient complex systems.
3///
4/// Solves \f$a x_{k-1}+b x_k+c x_{k+1}=d_k\f$ with fixed \f$a,b,c\f$.
5#pragma once
6
7#include "core/types.hpp"
8#include <complex>
9#include <vector>
10
11namespace num {
12
14 using cplx = std::complex<double>;
15
16 std::vector<cplx> c_mod;
17 std::vector<cplx> inv_b;
18 int n = 0;
20
21 void factor(int n_, cplx a_, cplx b_, cplx c_);
22
23 void solve(std::vector<cplx>& d) const;
24};
25
26} // namespace num
Core type definitions.
std::complex< real > cplx
Definition types.hpp:12
std::vector< cplx > inv_b
void solve(std::vector< cplx > &d) const
std::complex< double > cplx
void factor(int n_, cplx a_, cplx b_, cplx c_)
std::vector< cplx > c_mod