Subject: Re: [ublas] storage -- unbounded_array
From: oswin krause (oswin.krause_at_[hidden])
Date: 2014-07-22 13:00:44
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 mismatch?
> ublas mailing list
> Sent to: Oswin.Krause_at_[hidden]