On Fri, 20 Jun 2008, John Peterson wrote:

> On Fri, Jun 20, 2008 at 8:53 AM, Roy Stogner <[EMAIL PROTECTED]> wrote:
>>
>> On Fri, 20 Jun 2008, John Peterson wrote:
>>
>>> Since you can call all of the routines and it will just drop the ones
>>> it's not using, that's one way to go.  On the PETSc side I wish it
>>> could be cleaner...why have two totally separate function names
>>> instead of just letting the arguments' types determine the behavior?
>>
>> It's been *that* long since you used C without the ++, huh?
>
> I know you were joking but AFAIK, in C you can still do if tests...
>
> void f(int arg)
> {
>  if (arg==1)
>   // do one behavior, call MPIAIJ...
>
>  if (arg==2)
>    // do another behavior
> }

Yeah, but that only works if you've got an "enum what_type_am_i"
member variable to test, and if you hide all non-common struct
variables behind a "void *" or something.  You still can't have both
f(SparseMatrix) and f(BlockSparseMatrix) in C unless SparseMatrix and
BlockSparseMatrix are the exact same type in the compiler's eyes.
---
Roy

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to