I am working on a project in numerical analysis which I have to program in C (using Lapack and Blas). Matrix is given which is tridiagonal and "almost" symmetric (one element is to be changed to make it symmetric). In order to calculate certain eigenvalues and eigenvectors I am planning to use dsyevx() routine which works only for symmetric matrices. Is there any routine for orthogonal similarity transformation to make it symmetric, or should I opt for different routine for calculating eigenvalues of general $N\times N$ matrix?
Asked
Active
Viewed 127 times
1
-
1What happen if you just make it symmetric? – nicoguaro Feb 10 '18 at 23:51
-
I am not sure if my spectrum will stay the same. On the other hand by doing similarity transformation spectrum surely won't change. – Tino Feb 11 '18 at 11:08
-
It won't preserve your spectrum. That's why I asked, you can just try it! – nicoguaro Feb 11 '18 at 12:07
-
1Why do you think your matrix is similar to a symmetric one? The fact that most non-symmetric matrices are not is what makes the non-symmetric eigenvalue problem hard(er). – Ian Bush Feb 11 '18 at 12:10
-
As far as I can see LAPACK does not supply special eigenvalue routines for non-symmetric tridiagonal matrices, so you'll have to use one of the general routines, probably dgeevx (see http://www.netlib.org/lapack/explore-html/d9/d8e/group__double_g_eeigen.html). But maybe if the changed term is small in some sense you could solve the symmetric case and then use perturbation theory? – Ian Bush Feb 11 '18 at 12:20
-
@IanBush I got my matrix by doing finite difference discretization on second order ODE. Usually those matrices turn out to be tridiagonal - symmetric. Due to not having access to values of the function at both endpoints (only the first derivative at the first endpoint) matrix turned out to be non-symmetric but the problem states that it is similar to a symmetric matrix. The term which is to be changed is proportional to step size squared, so in some sense I could try to solve the symmetric case and make some error bound. – Tino Feb 11 '18 at 12:45
-
4Maybe you should consider an alternate way of applying the boundary conditions so that the matrix is tridiagonal and symmetric. Take a look at this post, https://scicomp.stackexchange.com/questions/26183/iteratively-solving-3d-poisson-equation-in-matlab/26187#26187, for a discussion and, in particular, the link to a book by Leveque. – Bill Greene Feb 11 '18 at 13:26