deallog.push("Power method");
- VECTOR* Vy = memory.alloc (); VECTOR& y = *Vy; y.reinit (x);
- VECTOR* Vr = memory.alloc (); VECTOR& r = *Vr; r.reinit (x);
+ VECTOR* Vy = this->memory.alloc (); VECTOR& y = *Vy; y.reinit (x);
+ VECTOR* Vr = this->memory.alloc (); VECTOR& r = *Vr; r.reinit (x);
double length = x.l2_norm ();
double old_length = 0.;
// Check the change of the eigenvalue
// Brrr, this is not really a good criterion
- conv = control().check (iter, fabs(1./length-1./old_length));
+ conv = this->control().check (iter, fabs(1./length-1./old_length));
}
- memory.free(Vy);
- memory.free(Vr);
+ this->memory.free(Vy);
+ this->memory.free(Vr);
deallog.pop();
// in case of failure: throw
// exception
- if (control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (control().last_step(),
- control().last_value());
+ if (this->control().last_check() != SolverControl::success)
+ throw SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value());
// otherwise exit as normal
}
ReductionControl inner_control (A.m(), 1.e-16, 1.e-8, false, false);
PreconditionIdentity prec;
SolverCG<VECTOR>
- solver(inner_control, memory);
+ solver(inner_control, this->memory);
// Next step for recomputing the shift
unsigned int goal = 10;
// Auxiliary vector
- VECTOR* Vy = memory.alloc (); VECTOR& y = *Vy; y.reinit (x);
- VECTOR* Vr = memory.alloc (); VECTOR& r = *Vr; r.reinit (x);
+ VECTOR* Vy = this->memory.alloc (); VECTOR& y = *Vy; y.reinit (x);
+ VECTOR* Vr = this->memory.alloc (); VECTOR& r = *Vr; r.reinit (x);
double length = x.l2_norm ();
double old_length = 0.;
y.equ (value, x);
double res = A.residual (r,x,y);
// Check the residual
- conv = control().check (iter, res);
+ conv = this->control().check (iter, res);
} else {
- conv = control().check (iter, fabs(1./value-1./old_value));
+ conv = this->control().check (iter, fabs(1./value-1./old_value));
}
old_value = value;
}
- memory.free(Vy);
- memory.free(Vr);
+ this->memory.free(Vy);
+ this->memory.free(Vr);
deallog.pop();
// in case of failure: throw
// exception
- if (control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (control().last_step(),
- control().last_value());
+ if (this->control().last_check() != SolverControl::success)
+ throw SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value());
// otherwise exit as normal
}
deallog.push("QMRS");
// Memory allocation
- Vv = memory.alloc();
- Vp = memory.alloc();
- Vq = memory.alloc();
- Vt = memory.alloc();
- Vd = memory.alloc();
+ Vv = this->memory.alloc();
+ Vp = this->memory.alloc();
+ Vq = this->memory.alloc();
+ Vt = this->memory.alloc();
+ Vd = this->memory.alloc();
Vx = &x;
Vb = &b;
while (state);
// Deallocate Memory
- memory.free(Vv);
- memory.free(Vp);
- memory.free(Vq);
- memory.free(Vt);
- memory.free(Vd);
+ this->memory.free(Vv);
+ this->memory.free(Vp);
+ this->memory.free(Vq);
+ this->memory.free(Vt);
+ this->memory.free(Vd);
// Output
deallog.pop();
// in case of failure: throw
// exception
- if (control().last_check() != SolverControl::success)
- throw SolverControl::NoConvergence (control().last_step(),
- control().last_value());
+ if (this->control().last_check() != SolverControl::success)
+ throw SolverControl::NoConvergence (this->control().last_step(),
+ this->control().last_value());
// otherwise exit as normal
};
v.sadd(-1.,1.,b);
res = v.l2_norm();
- if (control().check(step, res) == SolverControl::success)
+ if (this->control().check(step, res) == SolverControl::success)
return false;
p = v;
}
else
res = sqrt((it+1)*tau);
- state = control().check(step,res);
+ state = this->control().check(step,res);
if ((state == SolverControl::success)
|| (state == SolverControl::failure))
return false;