BZDEV: Re: Initial thoughts about tensors

From: jeremic@sokocalo.cee.clarkson.edu
Date: Thu Jul 02 1998 - 16:32:30 EST


On 21 Jun, Steve Karmesin wrote:
> At 03:56 PM 6/18/98 -0400, jeremic@sokocalo.cee.clarkson.edu wrote:
>

>
> The idea of putting a bunch of stuff in the types of the tensors is that
> you could then do:
>
> tensor test = TensorMultiply(A,B)
>
> and let the overload resolution take care of the rest. This does require
> some trickery in the types -- it probably can't be reasonably done without
> an engine-like technique.
>

Hello All,

Just got back from hot, humid and smokey Florida!

Actually I was thinking about doing parsing of indices during
compilation stage (with expression templates) and then if parser finds
a match it replaces the general operator*() for tensors with a
specialized and tuned function that does the job. If the match is not
found than generic operator*() kicks in.

There are actually only couple of indicial combinations for tensor
multiplications which are coming again and again. Like:
A("ijkl")*B("kl") and similar. These cases should be taken care of with
a specialized operators*() while the others (less than 5%) can be
handled with a generic operator*().

Other applications (I am personaly interested in computational
mechanics) might have other important combinations of indices during
multiplications but that can be incorporated as well.

One might also take triple products (like: A("ijkl")*B("klm")*C("jmp")
) and build expression templates for them as well. It will increase the
code size but it will certainly speed up computations.

Best regards, Boris

Boris Jeremic Phone (315) 268-4435
Assistant Professor Fax (315) 268-7985
Department of Civil and Jeremic@Polaris.Clarkson.edu
Environmental Engineering http://www.clarkson.edu/~jeremic
Clarkson University
Potsdam, NY 13699-5710

--------------------- blitz-dev list --------------------------------
* To subscribe/unsubscribe: mail to majordomo@oonumerics.org, with
"subscribe blitz-dev" or "unsubscribe blitz-dev" in the body of the message
* Blitz++ web page: http://oonumerics.org/blitz/



This archive was generated by hypermail 2b29 : Wed Feb 20 2002 - 04:30:05 EST