From 3fb6535b382953bd1e775ac6ed2ac15f9ee2820c Mon Sep 17 00:00:00 2001 From: Matt Bauman Date: Tue, 6 Jun 2017 15:33:13 -0500 Subject: [PATCH] NEWS for to_indices (#19730) (#22152) * NEWS for to_indices (#19730) (cherry picked from commit 91f08bb0a5e0f5872d5e10baee3994f0dc62a201) --- NEWS.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/NEWS.md b/NEWS.md index 795e0b463338d..04f042cd9a5fe 100644 --- a/NEWS.md +++ b/NEWS.md @@ -328,6 +328,22 @@ Library improvements that dimension's length will be computed such that its product with all the other dimensions is equal to the length of the original array ([#19919]). + * The new `to_indices` function provides a uniform interface for index conversions, + taking an array and a tuple of indices as arguments and returning a tuple of + integers and/or arrays of supported scalar indices. It will throw an `ArgumentError` + for any unsupported indices, and the returned arrays should be iterated over (and + not indexed into) to support more efficient logical indexing ([#19730]). + + + Using colons (`:`) to represent a collection of indices is deprecated. They now must be + explicitly converted to a specialized array of integers with the `to_indices` function. +    As a result, the type of `SubArray`s that represent views over colon indices has changed. + + + Logical indexing is now more efficient. Logical arrays are converted by `to_indices` to + a lazy, iterable collection of indices that doesn't support indexing. A deprecation + provides indexing support with O(n) lookup. + + + The performance of indexing with `CartesianIndex`es is also improved in many situations. + * A new `titlecase` function was added, to capitalize the first character of each word within a string ([#19469]). * `any` and `all` now always short-circuit, and `mapreduce` never short-circuits ([#19543]). @@ -671,6 +687,7 @@ Command-line option changes [#19721]: https://github.com/JuliaLang/julia/issues/19721 [#19722]: https://github.com/JuliaLang/julia/issues/19722 [#19724]: https://github.com/JuliaLang/julia/issues/19724 +[#19730]: https://github.com/JuliaLang/julia/issues/19730 [#19737]: https://github.com/JuliaLang/julia/issues/19737 [#19741]: https://github.com/JuliaLang/julia/issues/19741 [#19766]: https://github.com/JuliaLang/julia/issues/19766