Re: Multidimensional Packed Bit Array
- From: "colin" <colin.rowe1@xxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Dec 2007 13:10:57 GMT
ok lets put it another way with leters instead of numbers wich might be
clearer...
for an array with dimensions of
a=new MyBitType[n3,n2,n1];
....contains n1*n2*n3 elements
so if you want to map a 3 dim array into a single dim array
MyBitType[] b=new MyBitType[n3*n2*n1];
a[x,y,z]
....becomes
b[x*n2*n1+y*n1+z]
although I warn you ive not finished my first cup of coffee of the morning
yet so
cant garantee its corect.
.... i find the hardest things to explain are the things that seem so obvious
to me.
ofc this is assuming the MyBitType takes care of the actual 1 dimensional
bitfield itself
wich is fairly easy but can be explained if needed.
Colin =^.^=
<christery@xxxxxxxxx> wrote in message
news:2719db8a-063a-400d-aaed-e6cd8a0d6411@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
the offset and multiplier for each dimension is simply the total size of
the
lower order dimension.
so for an array a[3,3,3]
would be 27 bits big, a[x,y,z] -> BitArrayStore[x*9+y*3+z]
Colin =^.^=
just dont get it, should be 3*3*3=27,
x*9+y*3+z is what? new mathematics? what is x,y,z? 3*9+3*3+3 != 27
just dont get it *as always*
But u are probably correct...
//CY
.
- References:
- Multidimensional Packed Bit Array
- From: Thomas Bruckner
- Re: Multidimensional Packed Bit Array
- From: colin
- Re: Multidimensional Packed Bit Array
- From: christery
- Multidimensional Packed Bit Array
- Prev by Date: Re: Own assembly fails to load when vs2008 is not installed on target machine
- Next by Date: Tab Control - First Event...Again
- Previous by thread: Re: Multidimensional Packed Bit Array
- Next by thread: Re: Multidimensional Packed Bit Array
- Index(es):
Relevant Pages
|
Loading