[Matrix-SIG] Re: blitz++ vs. NumPy?

James A. Crotinger jac@lanl.gov
Mon, 14 Dec 1998 10:09:20 -0700


At 10:11 AM 12/11/98 -0800, T.-Y. Brian Yang wrote:
>On Wed, 9 Dec 1998, "Paul F. Dubois" wrote:
>
>> Thinking more outside the box, and perhaps closer to what the original
>> poster may have intended, is the question, could/should NumPy be rewritten
>> to use Blitz in its implementation, or should a similar facility be
>> written
>> that wraps Blitz. I think those questions are worthy of study: clearly one
>> can do it, the question is, is it a good idea?
>> 
>> I'll look into it.

I'm not exactly sure what people are after here, but the true value of
Blitz and of the Pooma II Array class (http://www.acl.lanl.gov/pooma) is
that they do expression templates in order to avoid temporaries and binary
evaluation of expressions. There is no way to take direct advantage of
these from Python without doing C++ runtime code generation. One could, on
the other hand, try to do something like expression templates using Python
directly, overloading the operators to build a runtime parse tree for the
expression and then having the assignment operator perform the actual
calculation. Don't know how the overhead for doing this at runtime would
stack up compared to the overhead of direct binary evaluation. 

On the other hand, it is a useful goal to be able to interact with C++
codes that use Blitz (and Pooma II) arrays. If that is what you are after,
then I agree that this is a good idea. The SILOON project at LANL is
developing a tool that should be able to do this in a fairly automatic
manner. I hope to spend some time with them in January looking at how this
works with codes that use Pooma II arrays. They have a web site
(http://www.acl.lanl.gov/siloon) that has their first release (the DOWNLOAD
and ABOUT buttons are the only things on the web site that actually do
anything). Don't know if it is ready for prime time or not yet.

  Jim

------------------------------------------------------------------------
James A. Crotinger      Los Alamos National Lab     email: jac@lanl.gov
Technical Staff Member     CIC-ACL, MS B287         phone: 505-665-6022
Pooma Team               Los Alamos, NM 87545       fax:   505-665-4939