mxGetIr (C and Fortran)
Sparse matrix IR array
C Syntax
#include "matrix.h" mwIndex *mxGetIr(const mxArray *pm);
Fortran Syntax
#include "fintrf.h" mwPointer mxGetIr(pm) mwPointer pm
Arguments
pmPointer to a sparse
mxArray
Returns
Pointer to the first element in the ir array, if successful, and
NULL in C (0 in Fortran) otherwise. Possible
causes of failure include:
Specifying a full (nonsparse)
mxArray.Specifying a value for
pmthat isNULLin C (0in Fortran). This failure usually means that an earlier call tomxCreateSparsefailed.
Description
Use mxGetIr to obtain the starting address of the
ir array. The ir array is an array of
integers. The length of ir is nzmax, the storage
allocated for the sparse array, or nnz, the number of nonzero matrix
elements. For example, if nzmax equals 100, then
the ir array contains 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
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","refbook","filename")]);
where filename is:
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","mx","filename")]);
where filename is:
To open an example, type:
edit([fullfile(matlabroot,"extern","examples","mex","filename")]);
where filename is:
See Also
mxGetJc,
mxGetNzmax,
mxSetIr,
mxSetJc,
mxSetNzmax,
nzmax, nnz
Version History
Introduced before R2006a