From: Peter V. <Pet...@es...> - 2003-03-29 22:59:23
|
> I am new to VXL, I want to compute the eigenvalue and eigenvector from > 3x3 Hessian Matrix, but I do know how to compute using VXL, could you > give me some example illustrating how to do this in VXL? Did you try using vnl/algo/vnl_symmetric_eigensystem ? Here is an example of use, distilled from vnl/tests/test_symmetric_eigensystem.cxx : #include <vcl_iostream.h> #include <vnl/algo/vnl_symmetric_eigensystem.h> int main() { double Sdata[36] = { 30.0000, -3.4273, 13.9254, 13.7049, -2.4446, 20.2380, -3.4273, 13.7049, -2.4446, 1.3659, 3.6702, -0.2282, 13.9254, -2.4446, 20.2380, 3.6702, -0.2282, 28.6779, 13.7049, 1.3659, 3.6702, 12.5273, -1.6045, 3.9419, -2.4446, 3.6702, -0.2282, -1.6045, 3.9419, 2.5821, 20.2380, -0.2282, 28.6779, 3.9419, 2.5821, 44.0636, }; vnl_matrix<double> S(Sdata, 6,6); vnl_symmetric_eigensystem<double> eig(S); vcl_cout<<"Eigenvalues: "; for (int i=0;i<6;++i) vcl_cout<<eig.get_eigenvalue(i)<<' '; vcl_cout<<vcl_endl; } -- Peter. |