Boost logo

Boost Users :

From: jhr.walter_at_[hidden]
Date: 2003-03-05 03:25:38


Hi,

> > Either use
> >
> > matrix_column<matrix<double> > v (m.column (2)); // proxy[1]
> >
> > or
> >
> > vector<double> v (m.column (2)); // copy
> >
>
> Thank you so much. That seems to be exactly what I was looking for.
>
> BTW.: It seems that "matrix_column<matrix<T> > c "can be used as a
> reference to any other 'vector-like' type, as the following also
> works:
>
> c = v; // v beeing a vector;
> c = m.row(2);
> c = m.col(0);

Nope. You're overwriting the referenced part of the matrix three times now.

> There is still an interesting point: While it is possible to assign a
> row to the matrix_column it is not possible to supply a row in the
> constructor call. What is the rationale behind this?

The constructor constructs the proxy, the assignment operator assigns to the
proxied elements.

> If the constructor also would accept a row I could use it as a
> parameter type for function calls when I want to express, that
> only 'data' types are expected and 'expressions' are not wanted.
> (Sorry for the sloppy formulation, I am not sure how to express this
> more concise.)

I hope, we'll be able to solve this, too.

Best,

Joerg


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net