#pragma once #include #include namespace AMDiS { // ||b - A*x|| template auto residuum(ISTLBCRSMatrix const& A, ISTLBlockVector const& x, ISTLBlockVector const& b) { auto r = b.vector(); A.matrix().mmv(x.vector(), r); return r.two_norm(); } // ||b - A*x|| / ||b|| template auto relResiduum(ISTLBCRSMatrix const& A, ISTLBlockVector const& x, ISTLBlockVector const& b) { return residuum(A,x,b) / b.vector().two_norm(); } } // end namespace AMDiS