The fact that the matrix is tridiagonal is VERY important - this reduces the complexity of the problem from O (N ^ 3) to O (N). You can probably get some acceleration due to the fact that it is also symmetrical, but it will not be so dramatic.
A method for solving a tridiagonal system is here: http://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm .
Also note that you do not need to store all elements of the N ^ 2 matrix, since almost all of them will be zeros. You just need one vector of length N (for the diagonal) and two lengths of N-1 for sub- and super-diagonals. And since your matrix is symmetrical, the sub- and super-diagonals are the same.
Hope this is helpful ...
source share