Re: A85: Matrices


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

Re: A85: Matrices



Of course, multiplication is always easiest if you have deminsions
that are a power of 2.

-mike pearce

>a common problem, the maxtrix is two dimensions, but your data is one
>dimension. easy solution
>
>result = (y-1) * max_x + X
>
>so basically if you had an array like this:
>
>
>1 2 3 4 5 6 7 8
>9 0 1 2 3 4 5 6
>7 8 9 0 1 2 3 4
>5 6 7 8 9 0 1 2
>
>
>(aka .db 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1,
>2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2)
>
>and you wanted to find the item in (2,3) it would be the (3-1) * 8 + 2
>item (the 18th .db)
>


Follow-Ups: References: