blitz-19980805.tar.gz is available.
It has a fairly complete implementation of indirection. Also, you
can see the documentation for indirection at
http://oonumerics.org/blitz/manual/blitz02.html#l84
I changed "list of subdomains" into "list of 1D strips".
This is easier to implement, and arguably equally efficient.
It is probably much easier to decompose arbitrary subdomains
into strips rather than rectangles, anyway.
Here's the list of strips example from the manual:
const int N = 7;
Array<int,2> A(N,N), B(N,N);
typedef TinyVector<int,2> coord;
A = 0;
B = 1;
double centre_i = (N-1)/2.0;
double centre_j = (N-1)/2.0;
double radius = 0.8 * N/2.0;
// circle will contain a list of strips which represent a circular
// subdomain.
list<RectDomain<2> > circle;
for (int i=0; i < N; ++i)
{
double jdist2 = pow2(radius) - pow2(i-centre_i);
if (jdist2 < 0.0)
continue;
int jdist = int(sqrt(jdist2));
coord startPos(i, int(centre_j - jdist));
circle.push_back(strip(startPos, secondDim, int(centre_j + jdist)));
}
// Set only those points in the circle subdomain to 1
A[circle] = B;
After this code, the A array contains:
0 0 0 0 0 0 0
0 0 1 1 1 0 0
0 1 1 1 1 1 0
0 1 1 1 1 1 0
0 1 1 1 1 1 0
0 0 1 1 1 0 0
0 0 0 0 0 0 0
--------------------- 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:06 EST