Blitz logo

Blitz Support :

From: Julian Cummings (cummings_at_[hidden])
Date: 2004-01-06 14:15:12


Hello Manuel,

I think this is a bug on my part. I rewrote that code in iter.h to
eliminate some other problems. But the assignment of rhs.stack_ to
stack_ should really be a loop over all N_rank elements, assigning each
pointer in the stack. I have repaired the code in the repository.
Thanks for catching this bug!

Regards, Julian C.

Manuel Gamito wrote:

>Hello,
>
>Here is a little piece of code that compiles fine with
>Blitz 0.6 but fails with Blitz 0.7. The compiler is gcc
>3.3.2
>
> typedef blitz::Array<int,2> IntArray;
>
> IntArray ia;
> IntArray::iterator it(ia);
>
> it = ia.begin();
>
>The output of the compiler is:
>
>/usr/local/blitz/include/blitz/array/iter.h: In member
>function `void blitz::ConstPointerStack<P_numtype,
>N_rank>::operator=(const
>blitz::ConstPointerStack<P_numtype, N_rank>&) [with
>P_numtype = int, int N_rank = 2]':
>teste.cc:12: instantiated from here
>/usr/local/blitz/include/blitz/array/iter.h:40: error: ISO
>C++ forbids assignment of arrays
>
>I went to check the Blitz code in blitz/array/iter.h and,
>indeed, ArrayIterator is derived from ConstArrayIterator,
>which, in turn, contains two ConstPointerStack objects. The
>ConstPointerStack class contains an array stack_[N_rank] as
>a private member.
>
>ConstPointerStack defines an assignment operator which
>tries to copy between two arrays with the statement "stack_
>= rhs.stack_" (iter.h, line 36). I wonder if the intention
>is just to copy the pointer to the start of the array.
>
>Does this mean that, in 0.7, it is no longer possible to
>use iterator assignment?
>
>manuel gamito
>
>_______________________________________________
>Blitz-support mailing list
>Blitz-support_at_[hidden]
>http://www.oonumerics.org/mailman/listinfo.cgi/blitz-support
>
>

-- 
Dr. Julian C. Cummings                       E-mail: cummings_at_[hidden]
California Institute of Technology           Phone:  626-395-2543
1200 E. California Blvd., Mail Code 158-79   Fax:    626-584-5917
Pasadena, CA 91125