Boost logo

Ublas :

From: Hongzheng Wang (wanghz_at_[hidden])
Date: 2008-06-01 08:26:53


Hello,

Thank you for your explanation.

On Sun, Jun 1, 2008 at 5:50 PM, Dima Sorkin
<dsorkin_at_[hidden]> wrote:

> AFAIK, it is to adapt a raw array and then use its contents (by copying).
> Otherwise how would you create a ublas::vector from a raw data ?

My doubt is why not just use std::copy like algorithm to initialize
ublas::vector from raw data, given that the data is eventually copied.
 After all, ublas::vector/matrix seem to be STL-compatible containers.
 Are there any special considerations in design?

> For the aim of aliasing the data, there is a shallow_array_adaptor.
> The concept of how a shallow array should work is not closed,
> there were many other ideas, between them carray_adaptor in 1.32 release.

I noticed shallow_array_adaptor but ignored it because the comments in
the sources say it is dangerous. An evidence is that the macro
BOOST_UBLAS_SHALLOW_ARRAY_ADAPTOR is disabled as default. I think
shallow_array_adaptor is the answer I am looking for, although its
syntax and semantics is not so stable yet, just as you warned against.

-- 
HZ