![]() |
Blitz Support : |
From: Julian Cummings (cummings_at_[hidden])
Date: 2003-10-07 21:07:32
Hi Fernando,
Yes, I believe this bug has been mentioned previously. I think it is a
simple oversight and
that you can straightforwardly add the end() method. Note that there
are many other
STL-compliant features that are missing from the blitz::TinyVector
class. These and other
deficiencies have been addressed in the tvmet package, and I am now
working to integrate
tvmet as a replacement for the blitz TinyVector and TinyMatrix classes.
This work will
probably be completed and available in about one month, as my time permits.
Regards, Julian C.
Fernando Perez wrote:
> Hi all,
>
> Note: I'm using a CVS of blitz from a few weeks ago. I tried updating
> my CVS today, but SF seems to be unreachable, so my apologies in
> advance if this has been recently fixed and I missed it.
>
> The manual says for TinyVector:
>
> quote:
>
> TinyVector<T,N>::iterator end();
> TinyVector<T,N>::const_iterator end() const;
>
> Returns an STL-style iterator for the vector, positioned at the end of
> the data.
>
> /quote
>
> However, the following program (basically a TinyVector version of the
> iter.cpp example supplied with blitz):
>
> #include <blitz/array.h>
>
> using namespace blitz;
>
> int main()
> {
> TinyVector<int,5> A;
> A = 1,3,5,7,9;
>
> cout << "A = " << A << endl;
>
> // Use an iterator to list the array elements
> TinyVector<int,5>::iterator iter = A.begin(), end = A.end();
>
> while (iter != end) {
> cout << iter.position() << '\t' << (*iter) << endl;
> ++iter;
> }
> }
>
>
> fails to compile with:
>
> planck[blitz]> g++ iter.cpp
> iter.cpp: In function `int main()':
> iter.cpp:13: no matching function for call to `blitz::TinyVector<int,
> 5>::end()
>
> Is this an error in my usage, in the manual, or in the library? I
> tried compiling the supplied example which uses Array<> with
> iterators, and that one works fine. All I did was change the type of
> array to TinyVector.
>
> Thanks in advance for any help.
>
> Regards,
>
> Fernando.
>
> _______________________________________________
> 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