From fbe1209f7e94a8a4fb0615820c2f176838ad9c20 Mon Sep 17 00:00:00 2001 From: Yong-Chull Jang Date: Wed, 31 Jan 2018 12:10:24 -0500 Subject: [PATCH] count converged eigenvalues not assuming candidates are sorted --- .../iterative/ImplicitlyRestartedBlockLanczos.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/algorithms/iterative/ImplicitlyRestartedBlockLanczos.h b/lib/algorithms/iterative/ImplicitlyRestartedBlockLanczos.h index 933f2882..70c9afeb 100644 --- a/lib/algorithms/iterative/ImplicitlyRestartedBlockLanczos.h +++ b/lib/algorithms/iterative/ImplicitlyRestartedBlockLanczos.h @@ -166,6 +166,7 @@ until convergence std::vector> lmd2(Nu,std::vector(Nm,0.0)); std::vector> lme2(Nu,std::vector(Nm,0.0)); std::vector eval2(Nm); + std::vector resid(Nk); Eigen::MatrixXcd Qt = Eigen::MatrixXcd::Zero(Nm,Nm); Eigen::MatrixXcd Q = Eigen::MatrixXcd::Zero(Nm,Nm); @@ -267,6 +268,7 @@ until convergence eval2[i] = vnum/vden; v -= eval2[i]*B[i]; RealD vv = norm2(v); + resid[i] = vv; std::cout.precision(13); clog << "[" << std::setw(3)<< std::setiosflags(std::ios_base::right) <