// Prototype for specialize methods (can and should be overloaded) void Matrix::AddMSinvZImpl(Number alpha, const Vector& S, const Vector& Z, Vector& X) const { SmartPtr<Vector> tmp = S.MakeNew(); tmp->AddVectorQuotient(1., Z, S, 0.); MultVector(alpha, *tmp, 1., X); }
void ScaledMatrix::AddMSinvZImpl(Number alpha, const Vector& S, const Vector& Z, Vector& X) const { DBG_ASSERT(false && "Got the ScaledMatrix::AddMSinvZImpl. Should implement specialized method!"); SmartPtr<Vector> tmp = S.MakeNew(); tmp->AddVectorQuotient(1., Z, S, 0.); MultVector(alpha, *tmp, 1., X); }