coordinates to index
c2i(nrows, x, y)
nrows
number of rows in the matrix
x
the row coordinate
y
the col coordinate
the index into the matrix
David L Gibbs