[pooma-dev] (Minor) Pooma Tutorial Questions
James Crotinger
jcrotinger at mac.com
Fri Mar 23 13:59:10 UTC 2001
on 3/22/01 10:33 AM, Julian C. Cummings at cummings at linkline.com wrote:
> I asked about introducing iterators
> for DynamicArrays, since they are inherently 1D
> data structures.
The problem, I believe, is that multi-patch dynamic arrays only look 1D.
Implementation wise they're not like a 1D array at all; i.e. they are not in
a single contiguous block of memory. Thus the iterator has to have an
if-test. If people are willing to live with this (as they seem to be for
indexing, which also has this problem if done on the whole multi-patch
dynamic array), the using an iterator would avoid he need to have the
particles numbered. On the other hand, without numbering and the ability to
do
for (i = 0; i < size; ++i) a(i);
the array 'a' is not very array-like. I think the above has to be possible
if we're calling a an Array. If we want to have a ParticleSet that can only
be iterated through, that would be a different data structure.
Jim
More information about the pooma-dev
mailing list