Boost logo

Ublas :

Subject: [ublas] Adapt an externally allocated array to matrix?
From: liu chang (liuchangjohn_at_[hidden])
Date: 2009-04-30 04:19:08


Is it possible to adapt a C array allocated elsewhere as the storage
of a dense matrix/vector? i.e.

matrix<float, row_major, ???> a(size1, size2, float*);

There's no mention of this in the documentation, but it looks like a
custom storage class can play the trick.

As this is required whenever boost::ublas interfaces with other linear
algebra libraries, I'm sure someone has an implementation floating
around somewhere. Simply using "float*" doesn't work though :(