Boost logo

Ublas :

From: Yoder, Jeffrey - SSD (Jeffrey.Yoder_at_[hidden])
Date: 2006-11-17 08:01:16

Thanks for the insight. That all makes sense. This came up when I was
adding boost serialization to a class and got: error C2039: 'serialize'
: is not a member of 'std::vector<_Ty>'.

I thought this meant I needed to use boost vectors so I switched to them
but found my push_back method then wouldn't compile. As it turns out,
all I needed to do was add #include <boost/serialization/vector.hpp> and
the std::vector works fine.

Thanks again for your response Michael!

-----Original Message-----
From: ublas-bounces_at_[hidden]
[mailto:ublas-bounces_at_[hidden]] On Behalf Of Michael Stevens
Sent: Thursday, November 16, 2006 4:43 PM
To: ublas mailing list
Subject: Re: [ublas] vectors


On Thursday, 16. November 2006 19:18, Yoder, Jeffrey - SSD wrote:
> Why don't boost vectors offer a push or push_back type method? It
> odd to require external maintenance of the current vector size, or the
> use of a separate call to a size method, or creation of an iterator
> to add a value to the end of the vector.

The informal reason is that dense uBLAS vectors are not STL vectors,
they just
happen to have the same name!

An STL vector provide indexible storage with an efficient growth
stratergy for
appended element. The later requires the notion of capacity and storage
doubling when the current capacity is exceeded.

A uBLAS vector provide indexible storage with an algebraic size (the
size in a
linear algebra expression) that is identical to storage capacity

Without adding the notion of capacity you cannot implement the push
with the same semantics as STL does. If we wanted such a function for
ease of
use it would be better to call it something else to avoid confusion!

Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
ublas mailing list
This e-mail and any files transmitted with it are proprietary and intended solely
for the use of the individual or entity to whom they are addressed. If you have
received this e-mail in error please notify the sender. Please note that any views
or opinions presented in this e-mail are solely those of the author and do not
necessarily represent those of ITT, Inc. The recipient should check
this e-mail and any attachments for the presence of viruses. ITT accepts
no liability for any damage caused by any virus transmitted by this e-mail.