56 template<
typename Treal,
typename Tmatrix,
typename Tvector>
59 Lanczos(Tmatrix
const & AA, Tvector
const & startVec,
60 int maxIt = 100,
int cap = 100)
64 Treal
const ONE = 1.0;
69 v[0] *= (ONE /
v[0].eucl());
78 Treal
const ONE = 1.0;
80 v[0] *= (ONE / startVec.eucl());
115 void getEigVector(Tvector& eigVec, Treal
const *
const eVecTri)
const;
116 virtual void update() = 0;
123 template<
typename Treal,
typename Tmatrix,
typename Tvector>
125 if (j + 1 >= capacity)
126 increaseCapacity(capacity * 2);
127 Treal
const ONE = 1.0;
128 A.matVecProd(r, v[j]);
130 r += (-alpha) * v[j];
132 r += (-beta) * v[j-1];
133 v[j-1].writeToFile();
137 v[j+1] *= ONE / beta;
138 Tri.increase(alpha, beta);
146 template<
typename Treal,
typename Tmatrix,
typename Tvector>
157 eigVec *= eVecTri[0];
158 for (
int ind = 1; ind <= j - 2; ++ind) {
159 v[ind].readFromFile();
160 eigVec += eVecTri[ind] * v[ind];
161 v[ind].writeToFile();
163 eigVec += eVecTri[j-1] * v[j-1];
166 template<
typename Treal,
typename Tmatrix,
typename Tvector>
169 assert(newCapacity > capacity);
171 capacity = newCapacity;
172 Tvector* new_v =
new Tvector[capacity];
176 for (
int ind = 0; ind <= j - 2; ind++){
177 v[ind].readFromFile();
179 new_v[ind].writeToFile();
181 for (
int ind = j - 1; ind <= j; ind++){