Revision 1265 trunk/src/linad99/dveigen.cpp
dveigen.cpp (revision 1265)  

21  21 
} 
22  22 
dvar_matrix m1=symmetrize(m); 
23  23 
int n=m1.rowsize(); 
24 
int cmin=m1.colmin(); 

25 
int rmin=m1.rowmin(); 

26  24 
m1.colshift(1); // set minimum column and row indices to 1 
27  25 
m1.rowshift(1); 
28  26 
dvar_vector diag(1,n); 
...  ...  
30  28  
31  29 
tri_dag(m1,diag,off_diag); 
32  30  
33 
get_eigen(diag,off_diag,m1); // eigenvalues are returned in diag


34 
// eigenvalues are returned in columns of z


31 
// eigenvalues are returned in diag 

32 
get_eigen(diag,off_diag,m1);


35  33  
34 
// eigenvalues are returned in columns of z 

36  35 
return diag; 
37  
38  36 
} 
39  37  
40  38 
/** Householder transformation for eigenvalue computation. 
...  ...  
183  181 
ADUNCONST(dvar_vector,d) 
184  182 
ADUNCONST(dvar_vector,e) 
185  183 
int n=d.size(); 
186 
int m,l,iter,i,k;


184 
int m,l,iter,i; 

187  185 
dvariable s,r,p,g,f,dd,c,b; 
188  186  
189  187 
for (i=2;i<=n;i++) e[i1]=e[i]; 
...  ...  
229  227 
g=c*rb; 
230  228 
/* Next loop can be omitted if eigenvectors not wanted */ 
231  229 
#ifdef EIGEN_VECTORS 
232 
for (k=1;k<=n;k++) 

230 
for (int k=1;k<=n;k++)


233  231 
{ 
234  232 
f=z[k][i+1]; 
235  233 
z[k][i+1]=s*z[k][i]+c*f; 
...  ...  
270  268  
271  269  
272  270 
int n=d.size(); 
273 
int m,l,iter,i,k;


271 
int m,l,iter,i; 

274  272 
dvariable s,r,p,g,f,dd,c,b; 
275  273  
276  274 
for (i=2;i<=n;i++) e[i1]=e[i]; 
Also available in: Unified diff