27 Nov
2002
27 Nov
'02
8:53 a.m.
On Wednesday 27 November 2002 04:10, Stephen Crowley wrote:
It is possible for a vector and a matrix to share the same storage, as long as the dimensions agree?
Some of the algorithms I am implementing require some objects to be treated as an arbitrarily sized matrix, and sometimes as a vector, and it would be convient to have a matrix and a vector share the same memory.
I suppose you want to treat one particular row or column of the matrix as a vector. You can do for instance : matrix< double > m(10,10) ; matrix_row< matrix< double > > row(m,0) ; // first row of matrix m