User`s guide

External Interfaces/API
21-35
External Interfaces/API
New Types for Declaring Size and Index Values
Version 7.3 (R2006b) defines two new types for API arguments and return values. These
are
mwSize — represents size values, such as array dimensions and number of elements.
mwIndex — represents index values, such as indices into arrays.
Using these types in array declarations replaces more specific type declarations such as
int or INTEGER*4. In general, using these types consistently in your C or Fortran source
files can insulate your code from changes in the API implementation that might take
place between different versions of MATLAB.
The mwSize and mwIndex types are required when working with functions that access
sparse arrays on a 64-bit system. This is described in the release note on “Sparse Arrays
on 64-bit Systems” on page 21-35, below.
Note: In Fortran, mwSize and mwIndex are implemented as preprocessor macros. To use
these types in Fortran code, add the declaration #include "fintrf.h" in your source
file and build your MEX-files using the Fortran preprocessor.
Sparse Arrays on 64-bit Systems
The internal storage of sparse arrays on 64-bit systems has changed in the R2006b
release. Due to this change, you will need to
Change declaration statements in your source code so that you use the new
types mwSize and mwIndex in place of specific type declarations such as int or
INTEGER*4. This is described in the section “New Types for Declaring Size and Index
Values” on page 21-35, above.
Recompile all MEX-files that interact with sparse arrays using the new -
largeArrayDims switch. For more information about the -largeArrayDims switch,
see the section “New MEX Switch” on page 21-36, below.
See the section on ??? to find out if you will need to make any modifications to your
existing MEX code to accommodate these changes.