Re: vector view of a matrix

Janusz opechowski <[email protected]> Tue, 3 Feb 2004 05:44:52 +0000 (GMT)
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
hello !

Say :

int n ; // size of square matrix
double *a ;  //pointer to memory of a row matrix 

typedef mtl::external_vec<double > mvec;

mvec b(a,n*n); // b is all you need

cheers
Janusz








 --- Hugues Demers <[email protected]> wrote:
> Hi,
> 
> I just discovered the MTL and I think it would fit
> my needs perfectly.
> Now I would like to know if it's possible to have a
> vector view of a
> matrix. Suppose a have this matrix:
> 
> M = [1 2]
>     [3 4]
> 
> I want to have this view on it 
> 
> V = [1 2 3 4]. 
> 
> I don't want to duplicate the memory. Iterators
> won't do, because I want
> to be able to do something like:
> 
> dot( V, V ). 
> 
> Is it possible to have those two representations?
> 
> Sorry, if I missed this in the doc, but it's rather
> poor on the subject.
> 
> Thank you,
> Hugues Demers
> _______________________________________________
> This list is archived at
http://www.osl.iu.edu/MailArchives/mtl-devel/ 

________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping" 
your friends today! Download Messenger Now 
http://uk.messenger.yahoo.com/download/index.html
_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/