Function solve_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_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 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[0]       diag[1]  abovediag[1]   .....
*             0  belowdiag[1]       diag[2]
*             0             0  belowdiag[2]   .....
This function uses plain Gauss elimination, not bothering with the zeroes.

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_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 tridiagonal linear system.