Boost logo

Ublas :

Subject: [ublas] storing matrix proxies, uninitialized rows
From: Mark Lohry (mlohry_at_[hidden])
Date: 2011-08-24 15:16:46

Apologies for the novice nature of the question, but I haven't been able
to find an answer, likely due to not knowing how to phrase it.

Is it possible for one object to store a proxy/slice/row reference to
part of a matrix owned by another object? i.e. I'd like to have
something like:

using namespace boost::numeric::ublas;
class A{
  matrix<double> Mat;
  B foo;

class B {
matrix_row<matrix<double> > R;
void SetRow( matrix_row<matrix<double> > rowin ){R=rowin;}

such that class B can modify it's part of the matrix contained in A, and
A can modify the same matrix which B's proxy sees?

Thanks in advance.