1-dimensional array
Ru
Posts: 2
In the URL below, it states that a limitation of the Javelin is that is only uses 1-dimensional arrays?
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part3/Chapter23/Javelin.html
How can I use the index to simulate 2-D arrays?
Does this mean that image processes with the Javelin is out of the question?
-Ru
http://www.particle.kth.se/~lindsey/JavaCourse/Book/Part3/Chapter23/Javelin.html
How can I use the index to simulate 2-D arrays?
Does this mean that image processes with the Javelin is out of the question?
-Ru
Comments
must do the index calculation yourself.
For example a 2-dimensional array myArray[noparse][[/noparse]12][noparse][[/noparse]5]
This will have 60 entries so you define
int[noparse]/noparse myArray = new int[noparse][[/noparse]12*5]; //indexes 0 to 59
To index using [noparse][[/noparse]x][noparse][[/noparse]y] you calculate
int index = x*5 + y
where x is 0 to 11 and y is 0 to 4
regards peter