[petsc-dev] MatMatMult double dispatch

Dmitry Karpeev karpeev at mcs.anl.gov
Fri Oct 28 16:00:56 CDT 2011


Why does the double dispatch for A*B only looks for the implementation in
B's FList?
Is there any deep reason for this?

If I implement a new Mat type, say MATFOO, and want to make it be able pre-
and post-multiply
an existing type MATBAR, it looks like I have to add "MatMatMult_foo_bar_C"
to MATBAR's FList,
which is annoying, since I don't want to have to touch MATBAR's constructor
code.
I acknowledge that there is a certain amount of ambiguity possible, if both
MATFOO and MATBAR
had "MatMatMult_foo_bar_C" on their FLists, but one or the other would
predictably take precedence.

If nobody objects, I will add another search on A's FList.

Dmitry.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20111028/0104d55b/attachment.html>


More information about the petsc-dev mailing list