mxGetIr (C and Fortran) - Get ir array of sparse matrix

C Syntax

#include "matrix.h"
mwIndex *mxGetIr(const mxArray *pm);

Fortran Syntax

mwPointer mxGetIr(pm)
mwPointer pm

Arguments

pm

Pointer to a sparse mxArray

Returns

A pointer to the first element in the ir array, if successful, and NULL in C (0 in Fortran) otherwise. Possible causes of failure include

Description

Use mxGetIr 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, 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.

C Examples

See fulltosparse.c in the refbook subdirectory of the examples directory.

Additional examples:

See Also

mxGetJc, mxGetNzmax, mxSetIr, mxSetJc, mxSetNzmax

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS