| MATLAB Application Program Interface | Search  Help Desk |
| mxGetIr | Examples See Also |
Get the ir array of a sparse matrix
C Syntax
#include "matrix.h" int *mxGetIr(const mxArray *array_ptr);
Arguments
array_ptrmxArray.
Returns
A pointer to the first element in their array, if successful. Otherwise, returns NULL. Possible causes of failure include:
mxArray.
NULL array_ptr. (This usually means that an earlier call to mxCreateSparse failed.)
Description
UsemxGetIr to obtain the starting address of the ir array. The ir array is an array of integers; the length of the ir array is typically nzmax values. For example, if nzmax equals 100, then the ir array should contain 100 integers.
Each value in an ir array indicates a row (offset by 1) at which a nonzero element can be found. (The jc array is an index that indirectly specifies a column where nonzero elements can be found.)
For details on the ir and jc arrays, see mxSetIr and mxSetJc.
Examples
Seefulltosparse.c in the refbook subdirectory of the examples directory.
For additional examples, see explore.c in the mex subdirectory of the examples directory; see mxsetdimensions.c and mxsetnzmax.c in the mx subdirectory of the examples directory.
See Also
mxGetJc, mxGetNzmax, mxSetIr, mxSetJc, mxSetNzmax