Loop-free submatrix extraction

"Michael Smolsky" <[email protected]> Sat, 22 Dec 2007 02:24:05 -0500
Newsgroups gmane.comp.lib.mtl.devel
Message-ID <[email protected]>
Peter,

Thank you for your detailed response.

I'm exploring MTL further. I hope you don't mind if I ask you some questions, the answers to which I couldn't find in the documentation.

I need to extract a submatrix of a matrix, in a way similar to:

octave:4> a=rand(4),b=a([1,2],[2,4])
a =

   0.622575   0.844744   0.424293   0.207615
   0.642011   0.102342   0.011919   0.168107
   0.774028   0.446422   0.076552   0.759136
   0.633285   0.792054   0.738877   0.982645

b =

   0.84474   0.20762
   0.10234   0.16811

Is there an elegant way of doing this, or I need to write loops? I feel optimistic having read about inserters in your documentation...

My matrix is dense for now, but I will probably need to apply this to a sparse matrix as well.

Thanks you in advance,

Michael.

> ----- Original Message -----
> From: "Peter Gottschling" <[email protected]>
> To: "General Matrix Template Library (MTL) list" <[email protected]>, "Matrix Template Library 4" <[email protected]>
> Subject: Re: MTL: MTL development road
> Date: Mon, 03 Dec 2007 10:53:38 +0100
> 
> 

-- 
Want an e-mail address like mine?
Get a free e-mail account today at www.mail.com!


_______________________________________________
This list is archived at http://www.osl.iu.edu/MailArchives/mtl-devel/