http://docs.google.com/viewer?a=v&q=cache:vUrcmZ9777sJ:www.nag.com/numeric/fl/manual20/pdf/F08/f08qff.pdf+dtrexc+info+%3D+1&hl=en&gl=us&pid=bl&srcid=ADGEESjzsYF639LVz0Krx1xLC8tNUoqwDcl93KGDFF7V2lIHVcMBsC3hlf1TCM1w65AP6KKb92ARl8tvOuetLDwq0B6hRodun7LepNhPhT-qGxnDvIANfdYCWkdv5ZOEqAHLUu7Rj2cr&sig=AHIEtbT2hxbdhCB-1gtrcR8vGxqWHA04zA
I coded the program in c. (the example in the above pdf.. towards the end)
- Code: Select all
#define SIZE 4
#define TRUE 1
main()
{
int i, j;
integer N = SIZE;
integer LDA = N;
integer INFO;
real a[SIZE*SIZE] = {0.80, 0, 0, 0,
-0.11, -.10, -.65, 0,
0.01 , 0.25, -0.1, 0.0,
0.03, 0.35, 0.2, -.1};
real wk[201];
integer LDVS = 1;
real vs[1*1];
FILE *fp;
fp = fopen("schurDecomposition.txt","w");
// printing the schur form (given)
for ( i= 0; i< SIZE; i++ )
{
for ( j= 0; j< SIZE; j++ )
fprintf(fp,"%0.4f\t", a[i+SIZE*j]);
fprintf(fp,"\n");
}
fprintf(fp,"\n");
char compq = 'N';
integer ilst = 1;
integer ifst = 2;
strexc_(&compq, &N, a, &LDA, vs, &LDVS, &ifst, &ilst, wk, &INFO);
printf("INFO = %ld\n", INFO);
// printing the schur form after re-ordering
for ( i= 0; i< SIZE; i++ )
{
for ( j= 0; j< SIZE; j++ )
fprintf(fp,"%0.4f\t", a[i+SIZE*j]);
fprintf(fp,"\n");
}
fclose(fp);
return 0;
}
The code is running but is not able to do the required thing, i.e shift the 1st eigen value to the 2nd one... as depicted in the fortran example pdf (towards the end). INFO = 1.. is coming
The fortran example shows it works for them, but for me with the same inputs its not working.
I think this is a very simple problem, but unfortunately I am doing some mistake, please help me solving this.

