diff --git a/NEWS.md b/NEWS.md index 5c514027923d82..eb20a4742b9574 100644 --- a/NEWS.md +++ b/NEWS.md @@ -47,6 +47,9 @@ Library improvements * Linear algebra: + * All dimensions indexed by scalars are now dropped, whereas previously only + trailing scalar dimensions would be omitted from the result. + * New `normalize` and `normalize!` convenience functions for normalizing vectors ([#13681]). diff --git a/doc/manual/arrays.rst b/doc/manual/arrays.rst index 653be83e228a04..bac395a6a19997 100644 --- a/doc/manual/arrays.rst +++ b/doc/manual/arrays.rst @@ -233,8 +233,8 @@ where each ``I_k`` may be: The result ``X`` generally has dimensions ``(length(I_1), length(I_2), ..., length(I_n))``, with location ``(i_1, i_2, ..., i_n)`` of ``X`` containing the value -``A[I_1[i_1], I_2[i_2], ..., I_n[i_n]]``. Trailing dimensions -indexed with scalars are dropped. For example, the dimensions of ``A[I, 1]`` will be +``A[I_1[i_1], I_2[i_2], ..., I_n[i_n]]``. All dimensions indexed with scalars are +dropped. For example, the result of ``A[2, I, 3]`` will be a vector with size ``(length(I),)``. Boolean vectors are first transformed with ``find``; the size of a dimension indexed by a boolean vector will be the number of true values in the vector. As a special part of this syntax, the ``end`` keyword may be used to represent the last