Function solve_cyc_tridiag_nonsym (o2scl_linalg)

O2scl : Function List

template<class vec_t, class vec2_t, class vec3_t, class vec4_t, class vec5_t, class mem_t, class mem_vec_t, class fp_t>
void o2scl_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?

template<class vec_t, class vec2_t, class vec3_t, class vec4_t, class vec5_t, class fp_t>
void o2scl_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)

Solve an asymmetric cyclic tridiagonal linear system.