Commit 52ba2abd by Francois Gygi

fixed calculation with lower part of matrix.

added calculation using symmetrized matrix.
added calculation of eigenvectors.


git-svn-id: http://qboxcode.org/svn/qb/trunk@1543 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 53094b88
......@@ -148,6 +148,9 @@ int main(int argc, char **argv)
a[i*n+j] = aij;
}
}
// compute eigenvectors
jobz = 'v';
dsyev_(&jobz,&uplo,&n,&a[0],&n,&w_sym[0],&wrk[0],&lwrk,&info);
assert(info==0);
......@@ -170,4 +173,24 @@ int main(int argc, char **argv)
cout << setw(8) << (int) (Ha2cm1 * sqrt(w_sym[i]));
cout << endl;
}
ofstream vecfile("dynmat_eigvec.dat");
for ( int j = 0; j < n; j++ )
{
vecfile << "# mode " << j+1 << " frequency = ";
if ( w_sym[j] < 0.0 )
vecfile << setw(8) << (int) (Ha2cm1 * sqrt(-w_sym[j])) << " I";
else
vecfile << setw(8) << (int) (Ha2cm1 * sqrt(w_sym[j]));
vecfile << " cm-1" << endl;
vecfile << setprecision(8);
vecfile.setf(ios::fixed, ios::floatfield);
vecfile.setf(ios::right, ios::adjustfield);
for ( int i = 0; i < n; i+=3 )
vecfile << i/3+1 << " "
<< setw(12) << a[j*n+i] << " "
<< setw(12) << a[j*n+i+1] << " "
<< setw(12) << a[j*n+i+2] << endl;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment