forum.alglib.net
http://forum.alglib.net/

Problem with alglib::smatrixtdevdr()
http://forum.alglib.net/viewtopic.php?f=2&t=1014
Page 1 of 1

Author:  IlyaMischenko [ Tue Oct 01, 2013 11:40 am ]
Post subject:  Problem with alglib::smatrixtdevdr()

Hello, everybody!
I`m a newcomer. I started using ALGLIB recently and faced a problem.
I need an eigen-solver (symmetric tri-diagonal matrix). I tried three functions:
alglib::smatrixtdevd()
alglib::smatrixtdevdi()
alglib::smatrixtdevdr()
First two of them work almost normally, but the last one (for finding eigen pairs in a specified interval) gives 0 (or rarely 1) pair when it has to give a lot. What may be a problem?

Author:  Sergey.Bochkanov [ Tue Oct 01, 2013 12:56 pm ]
Post subject:  Re: Problem with alglib::smatrixtdevdr()

Can you post your matrix here? I will investigate this issue as soon as I have data to investigate :)

Author:  IlyaMischenko [ Tue Oct 01, 2013 2:52 pm ]
Post subject:  Re: Problem with alglib::smatrixtdevdr()

Thank you for the quick answer!
Here is an example of required matrix:

double S = 5. , k = 0.01 , hIk = 0.005 ;
int N = (int) (2*S+1) ;
double S2= S*(S+1) ;

for ( int i=0; i<N; i++ )
{ m1 = S-i ; m2 = 0-m1 ;
D[i] = m1*m2/S2 - k*(m1*m1+m2*m2)/(2*S2) - hIk*k*m1/S ;
E[i] = sqrt ( (S2-m1*(m1-1)) * (S2-m2*(m2+1)) ) / (2*S2) ; }

S is spin. It`s ought to be interger or half-integer.

I attach full source files too.
One of them (smatrixtdevdi) works well, another one (smatrixtdevdr) gives wrong answer.
I intended to send their outputs, but couldn`t attach more than three files.

Attachments:
File comment: Bad
Output. smatrixtdevdr.txt [1.01 KiB]
Downloaded 589 times
File comment: Bad
Main. smatrixtdevdr.cpp [1.72 KiB]
Downloaded 656 times
File comment: Good
Main. smatrixtdevdi.cpp [1.72 KiB]
Downloaded 564 times

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/