From 36983222e803c61c56f49d943a76ccb8dc8eddd0 Mon Sep 17 00:00:00 2001 From: Jiri Pittner Date: Tue, 10 Feb 2026 15:18:56 +0100 Subject: [PATCH] improevd lanczos --- lanczos.h | 16 +++++++++++++--- t.cc | 9 +++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lanczos.h b/lanczos.h index d7ab205..b4b756c 100644 --- a/lanczos.h +++ b/lanczos.h @@ -114,11 +114,21 @@ for(j=1; j vec3(n); for(int k=0; k vec3(n); + s0->get(vec3,k); + f = vec3.dot(vec2); + vec2.axpy(-f,vec3); + } } vec2.normalize(); } diff --git a/t.cc b/t.cc index d023ad5..c835e60 100644 --- a/t.cc +++ b/t.cc @@ -61,6 +61,11 @@ inline int randind(const int n) complex mycident (const complex&x) {return x;} +void randomguess(NRVec &v) +{ +v.randomize(1); +} + void printme(const NRPerm &p) { PERM_RANK_TYPE rank=p.rank(); @@ -4678,8 +4683,8 @@ NRVec r(m); NRVec *eivecs = new NRVec[m]; cout <<"Exact energies " <