Testing Accuracy of Tridiagonal Matrix Computation

#1
So I implemented a lanczos algorithm which tridiagonalizes a real symmetric matrix. However, I don't know if my result is accurate. How would I be able to test if the algorithm is working correctly?

Edit: One other question. If you tridiagonalize a matrix, then compute the Singular Value Decomposition, then re-compute the matrix with say 'k' singular values, isn't the resulting matrix going to also be tridiagonalized? In which case, how can you apply the SVD of a tridiagonal matrix back to the original matrix?
 
Last edited: