Skip to contents

This function solves the system Ax = d, where A is an NxN tridiagonal matrix.

Usage

solve_thomas(a, b, c, d)

Arguments

a

A numeric vector representing the sub-diagonal of A. Must have length N-1.

b

A numeric vector representing the main diagonal of A. Must have length N.

c

A numeric vector representing the super-diagonal of A. Must have length N-1.

d

A numeric vector representing the right-hand side vector. Must have length N.

Value

A numeric vector containing the solution x.