Boost logo

Boost Users :

Subject: [Boost-users] proto for array expressions
From: Daniel Oberhoff (daniel_at_[hidden])
Date: 2008-12-18 16:19:25


Hi,

I have skimmed over the new proto library a few times now. I am kind of
excited about a clean implementation of ET. I have used blitz++ in a
project before, but am disappointed, because it breaks unexpectedly in
places, where it seems the et engine is just not smart enough, even
though the expression makes a lot of sense. I ended up having to
handcode a lot of things, avoiding which was the very reason I ever
used blitz. So now I am back at hand coing in a new projects, using
nothing but a few good iterators.

Now with proto I was wondering how hard it would be to build an et
engine for array math. Basically I am interested in general tensor
notation, and the resulting expressions should be iteratable
efficiently. think (advanced example):

a_ij = b_i * (c_j - sum(d_ijk, k = [i-1,1])

so there should be math on the indices possible, and I should be able
to iterate the expression to avoid direct index lookups wich are
expensive with arrays, where indices must be multiplied by strides to
get the memory address. other goodies would be optional range checks
and the ability to pass subexpressions to template functions. also
interesting might be transformations to automatically optimize
expressions.

a nice start would be maybe something simpler like just

a_ij = b_i * (c_j - sum(d_ijk, k)

where k is summed fully (over the whole range in d_ijk).

can anymone give me an estimate on how hard this would be and where to start?

Best

Daniel Oberhoff
Fraunhofer FIT
St. Augustin
Birlinghoven


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net