+ 2
This appears to give a decent C++ description. Note: don't steal their code. Read it, understand what it does & how, and write your own. Yours should not be the same as every programmer does things differently.
https://www.quantstart.com/articles/Tridiagonal-Matrix-Algorithm-Thomas-Algorithm-in-C