Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change findfirst/findlast/findnext/findprev to return the same index type as keys() #25577

Merged
merged 2 commits into from
Jan 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,12 +370,12 @@ This section lists changes that do not have deprecation warnings.
* `findn(x::AbstractArray)` has been deprecated in favor of `findall(!iszero, x)`, which
now returns cartesian indices for multidimensional arrays (see below, [#25532]).

* `find` has been renamed to `findall`, and now returns the same type of indices
as `keys`/`pairs` for `AbstractArray`, `AbstractDict`, `AbstractString`, `Tuple`
and `NamedTuple` objects ([#24774], [#25545]).
In particular, this means that it returns `CartesianIndex` objects for matrices
and higher-dimensional arrays instead of linear indices as was previously the case.
Use `LinearIndices(a)[findall(f, a)]` to compute linear indices.
* `find` has been renamed to `findall`. `findall`, `findfirst`, `findlast`, `findnext`
now take and/or return the same type of indices as `keys`/`pairs` for `AbstractArray`,
`AbstractDict`, `AbstractString`, `Tuple` and `NamedTuple` objects ([#24774], [#25545]).
In particular, this means that they use `CartesianIndex` objects for matrices
and higher-dimensional arrays insted of linear indices as was previously the case.
Use `LinearIndices(a)[findall(f, a)]` and similar constructs to compute linear indices.

* `AbstractSet` objects are now considered equal by `==` and `isequal` if all of their
elements are equal ([#25368]). This has required changing the hashing algorithm
Expand Down
Loading