SAREK - Sparse Analyzer Real Et Komplex

Version 1.00 (19.7 KB) by James Tursa
The SAREK function analyzes a sparse matrix for integrity. Useful especially for checking sparse matrices built by 3rd party s/w.
5 Downloads
Updated 23 Jan 2024

View License

The sarek function analyzes a sparse matrix for integrity. Patterned after the original spok function by Tim Davis. Requires a C compiler to compile the C source code sarek.c into a mex routine. Should work for both R2017b- and R2018a+ MATLAB versions, but I am only able to test the R2018a+ version currently. Let me know if you find any issues. Self building.
Syntax:
bad = sarek(s)
Where s = A sparse matrix (real or complex, double or logical)
bad = Number of errors found
Checks for the following errors:
M < 0
N < 0
Nzmax < 1
Jc = NULL
Jc[0] ~= 0
Jc[N] > Nzmax
(M==0 || N==0) && Jc[N] ~= 0
Jc[j] < Jc[j-1]
Ir == NULL && Jc[N] > 0
Jc[j] > Nzmax
Ir[i] < 0 || Ir[i] >= M
Ir[i] <= Ir[i-1]
Pr == NULL && Jc[N] > 0
Pi == NULL && Jc[N] > 0
Pr[i] = 0 for real or logical matrices
Pr[i] = 0 && Pi[i] == 0 for complex matrices

Cite As

James Tursa (2024). SAREK - Sparse Analyzer Real Et Komplex (https://www.mathworks.com/matlabcentral/fileexchange/158161-sarek-sparse-analyzer-real-et-komplex), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2023b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.00