Re: passing and returning arrays by value

From: Todd Veldhuizen (tveldhui@extreme.indiana.edu)
Date: Mon Mar 08 1999 - 13:34:18 EST


Quang Thang writes:

> [...] I don't know if you thought of having a a function similar to the
> where() function but instead of returning an Array it would return a
> one dimensional vector of the indices in the Array that satisfy an
> expression. Then the vector can be used to perform indirection
> on the array. [...]

Yes, this would be good. I had meant to implement it back in the
summer when I did indirection, but ran out of time.

Ideally you could do both

Array<int,3> A(N,N,N); // ...

list<TinyVector<int,3> > p;
find_points(A > 0, p);

which would find the points satisfying "A > 0" and add them to the
list p; and

list<RectDomain<3> > r;
find_regions(A > 0, r);

which would find strips where "A > 0" and put them in r. In theory
these algorithms would not be hard to write, but they will require
some knowledge of blitz internals.

Cheers,
Todd



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