Functions solve_cyc_tridiag_nonsym¶
-
template<class
vec_t
, classvec2_t
, classvec3_t
, classvec4_t
, classvec5_t
, classmem_t
, classmem_vec_t
>
voido2scl_linalg
::
solve_cyc_tridiag_nonsym
(const vec_t &diag, const vec2_t &abovediag, const vec3_t &belowdiag, const vec4_t &rhs, vec5_t &x, size_t N, mem_t &m)¶ Solve an asymmetric cyclic tridiagonal linear system with user-specified memory.
This function solves the system \( A x = b \) where \( A \) is a matrix of the form
* * diag[0] abovediag[0] 0 ..... belowdiag[N-1] * belowdiag[0] diag[1] abovediag[1] ..... * 0 belowdiag[1] diag[2] * 0 0 belowdiag[2] ..... * ... ... * abovediag[N-1] ...
This function solves the following system without the corner elements and then use Sherman-Morrison formula to compensate for them.
- Idea for Future:
Offer an option to avoid throwing on divide by zero?