Andrey,

uBlas' storage resize without an argument is an overload with preserve=false, so those two are equivalent.

Take a look at storage.hpp for the implementation.

Best
Nasos



Date: Tue, 20 Jul 2010 15:03:52 -0500
From: asadchev@gmail.com
To: ublas@lists.boost.org
Subject: [ublas] possible redundant copy

hello, I am not sure if this is intended, but it appears that there is redundant copy in
matrix.hpp

139         // Resizing
 140         BOOST_UBLAS_INLINE
 141         void resize (size_type size1, size_type size2, bool preserve = true) {
 142             if (preserve) {
 143                 self_type temporary (size1, size2);
 144                 detail::matrix_resize_preserve<layout_type> (*this, temporary);
 145             }
 146             else {
 147                 data ().resize (layout_type::storage_size (size1, size2));
 148                 size1_ = size1;
 149                 size2_ = size2;
 150             }
 151         }

should line 147 read

 data ().resize (layout_type::storage_size (size1, size2), false);

thank you



The New Busy think 9 to 5 is a cute idea. Combine multiple calendars with Hotmail. Get busy.