From: kronbichler Date: Sun, 11 May 2014 09:57:47 +0000 (+0000) Subject: Sort eigenvalues. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e60df1bb1b235a285a204c12c17805ef2b3e78b;p=dealii-svn.git Sort eigenvalues. git-svn-id: https://svn.dealii.org/trunk@32898 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/lac/solver_gmres.h b/deal.II/include/deal.II/lac/solver_gmres.h index 84133ceace..4c76e8c984 100644 --- a/deal.II/include/deal.II/lac/solver_gmres.h +++ b/deal.II/include/deal.II/lac/solver_gmres.h @@ -441,6 +441,13 @@ namespace internal } return *data[i-offset]; } + + // A comparator for better printing eigenvalues + bool complex_less_pred(const std::complex &x, + const std::complex &y) + { + return x.real() < y.real() || (x.real() == y.real() && x.imag() < y.imag()); + } } } @@ -831,9 +838,16 @@ SolverGMRES::solve (const MATRIX &A, for (unsigned int j=0; j > eigenvalues(dim); + for (unsigned int i=0; i