Skip to content

Instantly share code, notes, and snippets.

@bollu
Created September 12, 2018 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bollu/24763515906ca1b4388ecd7775461d84 to your computer and use it in GitHub Desktop.
Save bollu/24763515906ca1b4388ecd7775461d84 to your computer and use it in GitHub Desktop.
A[N][M][O]
A[x][y][z] = M * O * x + M * y + z
let y = O * 2
A[x][O * 2][z] = M * O * x + M * (O * 2) + z = M * O * (x + 2) + M * 0 + z = A[x + 2][2][z]
We will infer the array index as {x + 2, 2, z}.
If x = [1..N], we will assume that this array index was "incorrect", even
though if O * 2 < M, the above array access is correct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment