help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Efficient submatrix computation or matrix index looping


From: fuankarion
Subject: Re: Efficient submatrix computation or matrix index looping
Date: Fri, 20 May 2011 16:12:34 -0700 (PDT)

Ok, this is the context:

I'm interested in the elements around every element of a matrix (and the
element itself), say for every element al position i,j I want to get a
submatrix of the elements at positions:

i-1,j-1    i,j-1    i+1,j-1

i-1,j       i,j      i+1,j

i-1,j+1   i,j+1   i+1,j+1

This is not restricted to 3x3 submatrices, actually I want to get 8x8
submatrices and 16x16 submatrices arround every element, part of the problem
is that I have to do this for a large number of matrices.

My question is simple: How can I do this without looping through all the
possible combinations of the indexes i,j as this nested loop runs very slow
in octave.

I think that any of the folling might help me.

A function in octave API that automatically retrieves all the submatrices
A quick way to get all the indexes i,j, and build submatrices upon this
indexes
If I have to stick to the nested loop, I want to know how to use more than
one core to process a matrix, or to be able to process some matrices at the
same time.

Thanks
Fuanka

--
View this message in context: 
http://octave.1599824.n4.nabble.com/Efficient-submatrix-computation-or-matrix-index-looping-tp3539662p3539794.html
Sent from the Octave - General mailing list archive at Nabble.com.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]