ir
is, as you guessed, the row-index of non-empty rows. For the column-index things are somewhat more complicated but fully documented in Mathworks mex-Function documentation.
Pasted from http://www.mathworks.de/de/help/matlab/apiref/mxsetir.html:
If the jth column of the sparse mxArray has any nonzero elements:
jc[j] is the index in ir, pr, and pi (if it exists) of the first nonzero element in the jth column.
jc[j+1]-1 is the index of the last nonzero element in the jth column.
For the jth column of the sparse matrix, jc[j] is the total number of nonzero elements in all preceding columns.
The number of nonzero elements in the jth column of the sparse mxArray is:
jc[j+1] - jc[j];
Also check the documention on mxSetIr
.
Assuming you also have access to matlab, you should probably check the mex examples linked from the docs.