From: Vardan Akopian (vakopian_at_[hidden])
Date: 2006-02-10 15:08:51
I've always used the shallow_array_adaptor for that purpose.
Here is our discussion about that
And here is a little example how I use it
Note: I still haven't update to 1.33.x, so YMMV
P.S. Is there a way to search the ublas mailing list archives direcly
from there? Or do we need to laverage google? It's so hard to find old
On 2/10/06, Gunter Winkler <guwi17_at_[hidden]> wrote:
> I have the following problem:
> I have a pointer to a double array: const double *data;
> and an integer size
> I would like to use this as a vector in ublas routines.
> I expected that
> carray_adaptor<const double> shared(size, data);
> vector<const double, carray_adaptor<const double> > v(size, shared);
> does the job. Unfortunately it does not compile because the copy constructor
> of carray_adaptor is private. But this make the adaptor quite useless,
> because I am not able to convert it into a vector_expression (without copying
> the data).
> What is the rigth way to solve my problem?
> Should we support a syntax like
> vector<double> v(size);
> matrix<double> m(size, size);
> const double *external_data;
> v = prod(m, external_vector_adaptor(size, external_data));
> this would be very convenient.
> ublas mailing list