$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] proto for array expressions
From: Daniel Oberhoff (daniel_at_[hidden])
Date: 2008-12-19 02:19:46
On 2008-12-18 23:46:40 +0100, Eric Niebler <eric_at_[hidden]> said:
> Daniel Oberhoff wrote:
>> 
>> 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])
> 
> I don't understand your notation. What are a_ij et. al.?
Sorry, the underscripts where meant to be indices. So a is a 2d array, 
b and c are 1d arrays, and d is a 3d array. The statement says: to 
calculate a at a given index pair i,j (say 0,0) you substitute for i,j 
on the right. And the sum sums over the third index of the 3d array d. 
The notation further says that the bounds for the summation depend on 
what you substitute for i. So to fill the array a like that you need to 
substitute all values in the domian (say both indices run from 0 to 99 
for a 100x100 array), and for efficiency it would be best if the right 
hand side would result in an iterator that substitutes subsequent all 
values in series.
Best
Daniel