Tag Info

New answers tagged

0

A multidimensional array behaves like paging of n elements. Say you have a set of two numbers a and b. You decide, that your pagesize should be 1. Then you find the first element on the first page and the second element on the second page. This is equivalent to saying, you have an array of arrays; each subarray containing only one element. This could also ...


-1

The formula assumes that the array indices are zero based (the first element is at position 0) and it is perfectly correct. I assume that you made the classical mistake we all did in the beginning by counting from point 1, as an older colleague pointed out to me the first time I did it...


0

If your matrix can be accessed as a 2D array (x, y), then your problem generalises to new(x, y) = old(x, y) * (1 - 0.2) + old(x + 1, y) * 0.2 for all but the last column. The last column is a special case. Either use new(x, y) = old(x, y) * (1 - 0.2) for that column only, or else pad your source array with an extra column of zeros first and then you ...



Top 50 recent answers are included