Boost logo

Ublas :

From: Georg Baum (Georg.Baum_at_[hidden])
Date: 2005-04-06 10:08:35


Hi,

I have a (maybe stupid) question: Why has ublas::vector no push_back method? I
know that one often knows the size in advance before filling a vector, and
that it might not be possible to implement this for sparse vectors, and that
it is inefficient for large vectors in general, but sometimes I need to read
in a vector from a file and don't know the size in advance. push_back() would
be very handy in these cases.

Of course I can read in a std::vector and then copy it, or resize the vector
each step, but both methods are a bit clumsy.

Or are there other reasons for not providing push_back()?

Georg