|
Ublas : |
From: Nico Galoppo (nico_at_[hidden])
Date: 2006-08-16 09:47:15
Thanks for your clarification, Georg. I'm sorry about the non-compilable code. I
understand I am pretty much force to use coordinate_vector<> as I don't know the
vector size at compile time, and compressed_vector<> doesn not have preserving
resize implemented.
I agree that the naming is unfortunate. It is exactly the source of my confusion.
Cheers,
--nico
Georg Baum wrote:
>
> That is simple: size is the mathematical size of the vector. non_zeros is
> the number of elements that can actually be stored (structural
> non-zeroes). All other elements are implicitly zero.
> Therefore you can't insert an element at position 300 if the vector is of
> mathematical size 10. You need at least
>
> cv_type v(301);
>
> It works too with append_element if you give the vector an initial size.
> IMO the name append_element is suboptimal: It suggests that it enlarges
> the mathematical size of the vector, but that is not the case.
>
> I also get a suspicious warning when compiling this code (using boost cvs)
> with gcc 4.1:
>
-- nico galoppo von borries | address: 119 fidelity st., carrboro comp. graphics phd. student | north carolina, 27510 USA UNC, chapel hill | phone: +1 (919) 962-1898 (office) | +1 (919) 942-4388 (home) | email: nico at cs dot unc dot edu | homepage: http://www.ngaloppo.org