Subject: Re: [ublas] storage -- unbounded_array
From: Alexey Luchko (soulne4ny_at_[hidden])
Date: 2014-07-22 11:25:27
I understood that Storage makes a copy. I accept it.
It would be a really short way to create a *copy* of a `double data[M*N]` like:
matrix<double> mat(M, N, unbounded_array(begin(data), end(data));
And the Storage concept makes me to expect it works stating there
should be a range copy constructor. However neither bounded, nor
unbounded array storage classes provide the thing. That is the point.
It would be nice the range copy constructor. But more significant the
concepts and implementation should match :)
2014-07-22 20:00 GMT+03:00 oswin krause <oswin.krause_at_[hidden]>:
> Hi Alex,
> I assume you want to create a vector/matrix from some provided external
> piece of memory and not a vector/matrix using c-arrays (because the latter
> is implemented in uBLAS and works pretty well). So take some advise from
> someone who went down the first road:
> The storage concept is not compatible with what you want to do. It -and
> everything that uses it - assumes that storage can be *copied* and is owned
> by a *single* vector/matrix. Essentially the whole concept of implementing a
> vector using external storage as a vector_container is seriously flawed and
> it can only be safely implemented as a new vector_proxy in the style of
> vector_range (only that it does not access another vector but the c-array).
> I don't know what the current status is but i heard that people wanted to do
> add this kind of proxy to uBLAS. Also there are already a few projects which
> want to "replace some custom code preserving existing API" (for example my
> own). Maybe all you want to do is already done in one of these projects.
> On 22.07.2014 16:44, Alexey Luchko wrote:
>> Hi folks,
>> I'm trying to start with boost uBLAS.
>> My intention is to replace some custom code preserving existing API.
>> The first goal is to create vector and matrix from a C array.
>> I've found that Storage concept offers range constructor, however both
>> bounded and unbounded array storages do not provide it.
>> First of all, it is disappointing. Is there a special purpose for the
>> ublas mailing list
>> Sent to: Oswin.Krause_at_[hidden]
> ublas mailing list
> Sent to: soulne4ny_at_[hidden]