Blitz logo

Blitz Support :

From: Fernando Perez (fperez_at_[hidden])
Date: 2003-10-07 16:14:58


Hi all,

I was trying to put some shape checks into a program, and I ran into the
following problem. This code (U and T are blitz Arrays ):

    cout << U.shape()(Range(1,toEnd)) << endl;
    cout << T.shape()(Range(fromStart,toEnd-1)) << endl;

Does not work. I basically need to check (using python syntax) that

U.shape[1:] == T.shape[:-1]

and I was trying to put the above C++ into an assert() call. But it seems
that TinyVectors (which .shape() returns) do not support indexing via range
objects. Is this a fundamental limitation imposed by performance
considerations? If so, in order to perform the above checks, do I need to
simply write a loop by hand, or is there any way to do it using the Blitz
array syntax?

Thanks in advance for any help,

Fernando.