Boost logo

Ublas :

Subject: Re: [ublas] possible redundant copy
From: Nasos Iliopoulos (nasos_i_at_[hidden])
Date: 2010-07-21 07:06:17


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_at_[hidden]
To: ublas_at_[hidden]
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.
http://www.windowslive.com/campaign/thenewbusy?tile=multicalendar&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_5