Boost logo

Ublas :

From: Gunter Winkler (guwi17_at_[hidden])
Date: 2006-02-10 07:17:57


Hello,

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.

mfg
Gunter