forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 11:21 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Problem with alglib::smatrixtdevdr()
PostPosted: Tue Oct 01, 2013 11:40 am 
Offline

Joined: Tue Oct 01, 2013 10:29 am
Posts: 2
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?


Top
 Profile  
 
 Post subject: Re: Problem with alglib::smatrixtdevdr()
PostPosted: Tue Oct 01, 2013 12:56 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
Can you post your matrix here? I will investigate this issue as soon as I have data to investigate :)


Top
 Profile  
 
 Post subject: Re: Problem with alglib::smatrixtdevdr()
PostPosted: Tue Oct 01, 2013 2:52 pm 
Offline

Joined: Tue Oct 01, 2013 10:29 am
Posts: 2
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 620 times
File comment: Bad
Main. smatrixtdevdr.cpp [1.72 KiB]
Downloaded 686 times
File comment: Good
Main. smatrixtdevdi.cpp [1.72 KiB]
Downloaded 594 times
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 42 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group