Skip to content

Conversation

@nalimilan
Copy link
Member

As discussed at #24910. Part of #10593. Performance seems roughly equivalent (but I couldn't use @benchmark since BenchmarkTools currently doesn't load on master).

The first commit fixes for things that have been missed by #24774.

@nalimilan nalimilan added the search & find The find* family of functions label Jan 12, 2018
@ararslan ararslan added the deprecation This change introduces or involves a deprecation label Jan 12, 2018
The BitArray method was missed when changing the AbstractArray method to
return CartesianIndices for multidimensional arrays. Also fix the find(x)
docstring which was inconsistent with the find(f, x) one.

@deprecate findin(a, b) find(occursin(b), a)

@deprecate findn(x::AbstractArray) (I = find(!iszero, x); (getindex.(I, 1), getindex.(I, 2)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth trying to support non-2d arrays?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I've added a method for vectors and another for general arrays, and restricted this one to matrices.

…rtesian indices

Also make find(::Function, ::SparseMatrixCSC) slightly more efficient by avoiding an
intermediate allocation of index vectors.
@JeffBezanson JeffBezanson merged commit 1c68f8a into master Jan 15, 2018
@JeffBezanson JeffBezanson deleted the nl/findn branch January 15, 2018 01:17
DilumAluthge added a commit that referenced this pull request Oct 14, 2023
Note: In #25532, `findn(x::AbstractArray)` was deprecated in favor of `findall(!iszero, x)`. However, the word `findn` will still appear in various places, such as `HISTORY.md`, so we should probably ignore it from `codespell`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

deprecation This change introduces or involves a deprecation search & find The find* family of functions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants