29 Nov
2007
29 Nov
'07
7:23 p.m.
Am Donnerstag 29 November 2007 20:05:20 schrieb Sohail Somani:
On Thu, 29 Nov 2007 19:54:35 +0100, Maik Beckmann wrote:
PLEASE don't use ublas matrices as pointers! They are not made for this (no virtual destructors for performace reasons). If you want to avoid copying, allways use references.
I hope you weren't suggesting to do this:
// probably won't even compile, and will // hurt you if it does. vector_slice<T> & s = subslice(...);
A slice is a lightweight object, copying doesn't hurt. No, the hint isn't related to slices and ranges. It's just: typedef boost::numeric::ublas::matrix<double> matrix_type; matrix_type At; // .... fill At ... matrix_type& cfo = mx; vs. matrix_type* cfo = &mx;