[Lapackpp-devel] tridiagonal
Status: Beta
Brought to you by:
cstim
From: Do bi <mrc...@ya...> - 2006-07-31 18:11:38
|
Please can anyone hint me how to correctly form a tridiagonal? I wrote this and tried to print the value, but it was wrong. LaVectorDouble x(M), b(M), const Diag(M), DiagL(M-1), DiagU(M-1); for (int i=0; i< M; i++) Diag(i)=1+2*alfa*0; for (int i=0; i< M-1; i++) DiagL(i)=-alfa; for (int i=0; i< M-1; i++) DiagU(i)=-alfa; for (int i=0; i< M-1; i++) cout << DiagL(i) << endl; LaTridiagMatDouble Mat(M); Mat.diag(0)=Diag; Mat.diag(-1)=DiagL; Mat.diag(1)=DiagU; //for (int i=0; i< M-1; i++) //cout << Diag(i) << endl; cout << Mat(0,0) << endl; --------------------------------- Yahoo! Music Unlimited - Access over 1 million songs.Try it free. |