On Dec 10, 2007 3:52 PM, Neal Becker <ndbecker2@gmail.com> wrote:
Either I completely misunderstand something, or zero_vector is seriously broken:

int main() {
 ublas::zero_vector<double> zeros (10);
 copy (zeros.begin(), zeros.end(), ostream_iterator<double> (cout, " "));
}

I expect this to print 10 '0'.  Instead, it prints nothing.

That's probably because begin() and end() return an *indexed iterator* which might skip zeros.

A normal ("dense") vector behaves the way you want it to -- but in general I wouldn't count in it. You better check the indexed iterator concept again.

Cheers!
SG