logo       

Re: ublas::matrix sharing storage with ublas::vector: msg#00297

lib.boost.user

Subject: Re: ublas::matrix sharing storage with ublas::vector

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

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/EbFolB/TM
---------------------------------------------------------------------~->

Info: <http://www.boost.org>
Wiki: <http://www.crystalclearsoftware.com/cgi-bin/boost_wiki/wiki.pl>
Unsubscribe: <mailto:boost-users-unsubscribe@xxxxxxxxxxxxxxx>


Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise