*/
SmartPointer<const MATRIX> A;
+ /**
+ * Auxiliary vector.
+ */
+ VECTOR aux;
/**
* Shift parameter.
*/
ShiftedMatrix<MATRIX>::vmult (VECTOR& dst, const VECTOR& src) const
{
A.vmult(dst, src);
- dst.add(sigma, src);
+ if (sigma != 0.)
+ dst.add(sigma, src);
}
const VECTOR& rhs) const
{
A.vmult(dst, src);
- dst.add(sigma, src);
+ if (sigma != 0.)
+ dst.add(sigma, src);
dst.sadd(-1.,1.,rhs);
return dst.l2_norm ();
}
const VECTOR& src) const
{
A.vmult(dst, src);
- dst.add(sigma, src);
+ if (sigma != 0.)
+ {
+ aux.reinit(dst);
+ M.vmult(aux, src);
+ dst.add(sigma, aux);
+ }
}
const VECTOR& rhs) const
{
A.vmult(dst, src);
- dst.add(sigma, src);
+ if (sigma != 0.)
+ {
+ aux.reinit(dst);
+ M.vmult(aux, src);
+ dst.add(sigma, aux);
+ }
dst.sadd(-1.,1.,rhs);
return dst.l2_norm ();
}
In the beginning the Universe was created. This has made a lot of
people very angry and has been widely regarded as a bad move.
Douglas Adams