<br><br><div class="gmail_quote">On Tue, Nov 1, 2011 at 11:34 AM, Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I think Jed wants to set these all up to use the dispatch on type table, rather than attaching the methods to the objects.<br></blockquote><div><br></div><div>In fact, it could be done rather easily even in the most general case. For example, using a pair of variadic functions:</div>
<div>PetscMethodRegister(void (*f)(void), const char* name, const char* arg1Type, const char* arg2Type, ...)</div><div>PetscMethodQuery(void (**f)(void), const char* name, const char* arg1Type, const char* arg2Type, ...)</div>
<div>The only wrinkle here is the need to cast f to the right function pointer type.</div><div>Under the hood it's a simple search through an FList on the name and the arg types.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
<br>
On Nov 1, 2011, at 8:09 AM, Dmitry Karpeev wrote:<br>
<br>
> Is there any reason that there isn't dual dispatch support for these routines like there is for MatMatMult?<br>
> If there is no particular reason, I would like to add it, largely for the same reasons I'd like symmetric<br>
> dual dispatch for MatMatMult: the ability to add new implementations without screwing around with all of the<br>
> constructors.<br>
><br>
> Similar considerations would apply to the MatMat*Symbolic routines, as well as MatPtAP.<br>
> I still maintain that the right way to handle these is triple dispatch that depends on the type of the output<br>
> Mat as well, but that would only matter in a handful of corner cases.<br>
><br>
> And a minor question: wouldn't it be better to name these two functions MatTransposeMatMult and MatMatTransposeMult<br>
> respectively, so that the "Transpose" operation sits next to the matrix it operates on?<br>
<br>
</div></div> A' * B and A * B' ? Sounds reasonable.<br></blockquote><div>Yes: A'*B --> MatTransposeMatMult, and A*B' --> MatMatTransposeMult</div><div>Currently its A'*B --> MatMatTransposeMult (which, just by looking at the name, can be confused with A*B', it seems to me), and A*B' --> MatMatMultTranspose (which could be mistakenly interpreted as (A*B)'). This is an API change, of course, which might break some user code, but the fix is a trivial search-and-replace.</div>
<div>Shall I do it?</div><div><br></div><div>Dmitry. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Barry<br>
<br>
><br>
> Dmitry.<br>
<br>
</blockquote></div><br>