Blitz logo

Blitz Support :

From: Dalal, Navneet (navneet.dalal_at_[hidden])
Date: 2003-06-20 09:42:54


Hi everybody,

I am wondering: Can I avoid writing explicit "for loops" in blitz?
for example:

Array<bool,3> lmax(30,40,50);
// initialize lmax somehow

// store indices (i,j,k) in trueIndices if lmax(i,j,k) is true
std::vector<TinyVector<int,3>> trueIndices;

// comes for loop for each indices.
{
        if (lmax(i,j,k) == true)
                // Add a TinyVector<int,3> (i,j,k) to true indices ...
}

This is just one example. How can I perform "for loops" on user defined
complex functions or expressions?

It is not that I am bit lazy in writing for loops, but that if someone
manually writes such for loops then ordering of loops will have to change
depending upon C-style/Fortran style structure of array.

thanks
navneet