
Originally Posted by
SoftwareTester
As i think my problem is a mathematical one I post it here, if I should be somewhere else please tell me where.
I have a multiple array (5 or 6 dimensions each being of same size) where only elements with different indexcombinations are being filled (i.e. if element [1,2,3,4,5,6] being filled element [6,5,4,3,2,1] will NOT be filled) so I want to store all elements of such a multiple array in a lineairarray and compute the indexes for each element as it saves a lot of memory.
in code
N = 20; // maximum number of an element in each dimension
MaxIndex= N * ((N+1)/2) * ((N+2)/3) * ((N+3)/4) * ((N+4)/5) * ((N+5)/6);
long[] Array = new long [MaxIndex];
[snip]