freepooma-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Status


From: Mark Mitchell
Subject: Re: Status
Date: Mon, 09 Jul 2001 08:57:36 -0700



--On Saturday, July 07, 2001 11:23:04 AM -0600 Scott Haney <address@hidden> wrote:

I finally have a design for a POOMA relations package that I like and
have implemented it and started to perform some testing.

Excellent.

   Pooma::newRelationFunctor(ComputeKineticEnergy(), K, m, v);
   Pooma::newRelationFunctionPtr(computePotentialEnergy, U, m, h);
   Pooma::newRelationMemberPtr(obj, &ComputeVelocity::doit, v, p, m);

FYI, the STL in most places just uses one function, like this:

 template <typename T>
 void newRelation(T t) { ... t() ... }

which works with functors and function pointers automatically, and
with the pointer-to-member case via an adaptor; I think there
is something like `member_function' that returns a new functor so that
you can say:

newRelation (member_function(obj, &ComputeVelocity::doit), v, p, m)

It's not clear to me that we should try to imitate the STL in any way
in POOMA -- but its conventions are now used by lots of people, so it
might be good to gradually move the interfaces in that direction.  It's
also worth noting that compilers are working hard on optimizing those
constructs, so if POOMA looks like the STL, that might have positive
side-effects as well.

Doing things that way also makes for a nice concept-based view of
what the arguments are; they are things that are Callable.

And, of course, if you go this way you only have to write one function
instead of three...

--
Mark Mitchell                address@hidden
CodeSourcery, LLC            http://www.codesourcery.com

reply via email to

[Prev in Thread] Current Thread [Next in Thread]