Commit 7131dc78 authored by David Bommes's avatar David Bommes
Browse files

print eigenvector infos

git-svn-id: http://www.openflipper.org/svnrepo/CoMISo/trunk@222 1355f012-dd97-4b2f-ae87-10fa9f823a57
parent 6b1a8096
......@@ -14,6 +14,7 @@
#include <iostream>
#include <map>
#include <math.h>
#include <Eigen/Dense>
//== FORWARDDECLARATIONS ======================================================
......@@ -160,6 +161,22 @@ public:
std::cerr << "(" << it.row() << "," << it.col() << ") -> " << *it << std::endl;
}
void print_eigenvalues()
{
Eigen::MatrixXd A = Eigen::MatrixXd::Zero(n_rows_, n_cols_);
iterator it = begin();
for(; it != end(); ++it)
A(it.row(),it.col()) = *it;
Eigen::EigenSolver<Eigen::MatrixXd> eigensolver(A);
if (eigensolver.info() != Eigen::Success) abort();
std::cout << "The eigenvalues of A are:\n" << eigensolver.eigenvalues() << std::endl;
// std::cout << "Here's a matrix whose columns are eigenvectors of A \n"
// << "corresponding to these eigenvalues:\n"
// << eigensolver.eigenvectors() << std::endl;
}
private:
......
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