Skip to content

Commit

Permalink
Rename findn_nzs to findnz as part of #1539
Browse files Browse the repository at this point in the history
  • Loading branch information
ViralBShah committed Apr 4, 2013
1 parent f95a45b commit 3b939b2
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1245,7 +1245,7 @@ function findn{T}(A::AbstractArray{T})
end
end

function findn_nzs{T}(A::AbstractMatrix{T})
function findnz{T}(A::AbstractMatrix{T})
nnzA = nnz(A)
I = zeros(Int, nnzA)
J = zeros(Int, nnzA)
Expand Down
2 changes: 1 addition & 1 deletion base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ function findn(B::BitArray)
end
end

function findn_nzs(B::BitMatrix)
function findnz(B::BitMatrix)
I, J = findn(B)
return (I, J, trues(length(I)))
end
Expand Down
1 change: 1 addition & 0 deletions base/deprecated.jl
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ export PipeString
@deprecate parse_hex(T,s) parseint(T,s,16)
@deprecate parse_hex(s) parseint(s,16)
@deprecate wait_accept accept
@deprecate findn_nzs findnz

@deprecate expr(hd, a...) Expr(hd, a...)
@deprecate expr(hd, a::Array{Any,1}) Expr(hd, a...)
Expand Down
2 changes: 1 addition & 1 deletion base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ export
findmax,
findmin,
findn,
findn_nzs,
findnz,
findfirst,
findnext,
first,
Expand Down
6 changes: 3 additions & 3 deletions base/linalg/cholmod.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import Base.convert
import Base.copy
import Base.ctranspose
import Base.eltype
import Base.findn_nzs
import Base.findnz
import Base.getindex
import Base.hcat
import Base.isvalid
Expand Down Expand Up @@ -877,7 +877,7 @@ end
solve{T<:CHMVTypes}(L::CholmodFactor{T},B::VecOrMat{T},typ::Integer)=solve(L,CholmodDense(B),typ)
solve{T<:CHMVTypes}(L::CholmodFactor{T},B::CholmodDense{T}) = solve(L,B,CHOLMOD_A)

function findn_nzs{Tv,Ti}(A::CholmodSparse{Tv,Ti})
function findnz{Tv,Ti}(A::CholmodSparse{Tv,Ti})
jj = similar(A.rowval0) # expand A.colptr0 to a vector of indices
for j in 1:A.c.n, k in (A.colptr0[j]+1):A.colptr0[j+1]
jj[k] = j
Expand All @@ -899,7 +899,7 @@ function findn_nzs{Tv,Ti}(A::CholmodSparse{Tv,Ti})
(increment!(A.rowval0[ind]), jj[ind], A.nzval[ind])
end

findn_nzs(L::CholmodFactor) = findn_nzs(CholmodSparse(L))
findnz(L::CholmodFactor) = findnz(CholmodSparse(L))

function diag{Tv}(A::CholmodSparse{Tv})
minmn = min(size(A))
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/umfpack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export UmfpackLU,
import Base.(\)
import Base.Ac_ldiv_B
import Base.At_ldiv_B
import Base.findn_nzs
import Base.findnz
import Base.getindex
import Base.nnz
import Base.show
Expand Down
4 changes: 2 additions & 2 deletions base/sparse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ sparse(a::Vector) = sparsevec(a)

function sparse(A::Matrix)
m, n = size(A)
(I, J, V) = findn_nzs(A)
(I, J, V) = findnz(A)
return sparse_IJ_sorted!(I,J,V,m,n)
end

Expand Down Expand Up @@ -410,7 +410,7 @@ function findn{Tv,Ti}(S::SparseMatrixCSC{Tv,Ti})
return (I, J)
end

function findn_nzs{Tv,Ti}(S::SparseMatrixCSC{Tv,Ti})
function findnz{Tv,Ti}(S::SparseMatrixCSC{Tv,Ti})
numnz = nnz(S)
I = Array(Ti, numnz)
J = Array(Ti, numnz)
Expand Down
2 changes: 1 addition & 1 deletion test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ for i = 3:v1-1
end

b1 = randbool(n1, n2)
@check_bit_operation findn_nzs (Vector{Int}, Vector{Int}, BitArray) (b1,)
@check_bit_operation findnz (Vector{Int}, Vector{Int}, BitArray) (b1,)

timesofar("nnz&find")

Expand Down

0 comments on commit 3b939b2

Please sign in to comment.