Coded and tested tridiagonal matrix solver function