Barry Smith <[email protected]> writes: > We should add MatResidual() to the basic Mat methods (note this is the > same as MatMultSub() if we had such a thing) then all the many places > in PETSc where we have MatMult(); MatAXPY/AYPX();
* VecAXPY > can be replace with that one call and PCMGSetResidual() and > PCMGResidualDefault() would just disappear. We could have > MatResidual_Default() that did the usual MatMult followed by VecAYPX() > but each Mat implementation can implement an optimized one if they > want. An alternative would be to add a scalar parameter to MatMultAdd. To make the caching safe, the Mat impl would record the State of the Vec for which it was caching a triangular application. Perhaps PetscObjects should get a 64-bit unique ID assigned by a global counter, or even a slightly longer hash of information that should never repeat. Caching the pointer leaves the ABA problem.
pgpqd7QqFKAIV.pgp
Description: PGP signature
