help-octave
[Top][All Lists]
Advanced

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

Re: Iterating over a ND-array


From: Søren Hauberg
Subject: Re: Iterating over a ND-array
Date: Wed, 25 May 2005 18:45:38 +0200
User-agent: Mozilla Thunderbird 1.0.2 (X11/20050404)

I just calculated the total number of elements and accessed them by using a single index, like you suggested.

Thanks,
Søren

Stefan van der Walt wrote:
You can either calculate the total nr of elements and access them one
by one, or recursively iterate over all dimensions.

Either way, you'll probably need dims() , Array<int> and elem().
David Bateman will be able to give you good best advice on this one.

Regards
Stefan

On Wed, May 25, 2005 at 10:34:26AM +0200, S?ren Hauberg wrote:

Hi
Again in C++, is there an easy way to iterate over all the elements of an ND matrix (ArrayN)?

/Søren



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------





-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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