Line data Source code
1 27 : spfind(A::SparseMatrixCSC) = findnz(A) 2 : 3 9 : function spfind(A::SparseT) 4 9 : i, j, v = findnz(A') 5 9 : j, i, v 6 : end 7 : 8 : 9 : # NOTE: obsolete 10 : # SparseArrays.nnz(A::SparseT) = nnz(A') 11 : 12 2 : function spfind(predicate, A::SparseOp) 13 2 : i, j, v = spfind(A) 14 2 : k = findall(predicate, v) 15 2 : i[k], j[k], v[k] 16 : end 17 : 18 : """ 19 : i, j, v = spfind(A) 20 : j, i, v = spfind(A') 21 : i, j, v = spfind(predicate, A) 22 : 23 : Same as `findnz` (but works also for the **adjoint** `A'`) with 24 : optional filtering by `predicate` on values `v`. 25 : 26 : !!! note 27 : `SparseArrays` does not (yet?) define some functions on 28 : transposed sparse matrices (`Adjoint{...}` types). 29 : """ spfind