
Hi. Happy new year! I have couple of questions on uBlas. 1) On the boost user guide I read: "However unbounded_array is aimed at optimal performance. Therefore unbounded_array does not model a Sequence like std::vector does". I do not quite understand this statement. An std::vector is memory contiguous and access happens by offset. How can an unbounded beat this? 2) In the matrix<> template class I cannot find the concept of leading dimension. E.g. in a row major matrix 3x3 matrix the lead dimension could be 4, meaning that in reality I have a 3x4 matrix, but I just use a 3x3 (i.e. I have some slack at the end of each row). Is there a way to specify it? This is the way BLAS and LAPACK are designed, and it becomes particularly important when using hi-performance implementation of BLAS on x86, like Intel MKL, which require 16-byte alignment of each row. I thought about allocating a larger matrix, and then taking a range on it, but that does not seem the natural thing to do. Thanks a lot. -- View this message in context: http://old.nabble.com/ublas-questions-tp27024487p27024487.html Sent from the Boost - Dev mailing list archive at Nabble.com.

On Tue, Jan 5, 2010 at 3:06 PM, markus2004x <markus2004x@yahoo.com> wrote:
1) On the boost user guide I read: "However unbounded_array is aimed at optimal performance. Therefore unbounded_array does not model a Sequence like std::vector does". I do not quite understand this statement. An std::vector is memory contiguous and access happens by offset. How can an unbounded beat this?
I suppose that optimal performance was written with regards to memory consumption: unbounded_array consume just enough memory to store the number of object that it was asked to (it is not the case for std::vector, cause it requires amortized allocation time when growing and does so by allocating more than it actually requires). Under-laying container is still a contiguous array, so access time through operator[] is identical to std::vector. Btw, there is a typo in the doc page: "When resized unbounded_array will reallocate it's... " should be "its" not "it's", I think. http://www.boost.org/doc/libs/1_41_0/libs/numeric/ublas/doc/unbounded_array.... Cannot help for 2). Sorry. Sylvain

markus2004x wrote:
I have couple of questions on uBlas.
There exists also a ublas mailing list: ublas@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/ublas Regards, Thomas
participants (3)
-
markus2004x
-
Sylvain Bougerel
-
Thomas Klimpel