help-octave
[Top][All Lists]
Advanced

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

Re: Efficiently iterating over Nd array in oct file


From: Jordi Gutiérrez Hermoso
Subject: Re: Efficiently iterating over Nd array in oct file
Date: Mon, 25 Apr 2011 18:13:47 -0500

2011/4/25 Søren Hauberg <address@hidden>:
> man, 25 04 2011 kl. 09:24 -0500, skrev Jordi Gutiérrez Hermoso:
>> I'm agonising over an implementation detail of bwlabeln. I need to
>> iterate over each voxel of boolNDArray *and* consider each voxel's
>> neighbours. If I use a linear index and just iterate up to
>> boolNDArray::nelem(), I would have to call ind2sub for each pixel in
>> order to consider its neighbours, and I'm trying to avoid that call. I
>> was hoping for something like Array<idx_vector>::next() if such a
>> function existed or to impement it myself. Any other suggestions?
>
> I never found a good way of doing it :-( You can see what we did in
> 'convn' -- I think it is similar to your needs.

Thanks, Søren. I guess you mean the gymnastics around
liboctave/oct-convn.cc:85 ?

- Jordi G. H.


reply via email to

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