Skip to content

Commit 3709e54

Browse files
committed
Doc and news for dropping scalar dimensions
1 parent 4d3abff commit 3709e54

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

NEWS.md

+3
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ Library improvements
4747

4848
* Linear algebra:
4949

50+
* All dimensions indexed by scalars are now dropped, whereas previously only
51+
trailing scalar dimensions would be omitted from the result.
52+
5053
* New `normalize` and `normalize!` convenience functions for normalizing
5154
vectors ([#13681]).
5255

doc/manual/arrays.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,8 @@ where each ``I_k`` may be:
233233
The result ``X`` generally has dimensions
234234
``(length(I_1), length(I_2), ..., length(I_n))``, with location
235235
``(i_1, i_2, ..., i_n)`` of ``X`` containing the value
236-
``A[I_1[i_1], I_2[i_2], ..., I_n[i_n]]``. Trailing dimensions
237-
indexed with scalars are dropped. For example, the dimensions of ``A[I, 1]`` will be
236+
``A[I_1[i_1], I_2[i_2], ..., I_n[i_n]]``. All dimensions indexed with scalars are
237+
dropped. For example, the result of ``A[2, I, 3]`` will be a vector with size
238238
``(length(I),)``. Boolean vectors are first transformed with ``find``; the size of
239239
a dimension indexed by a boolean vector will be the number of true values in the vector.
240240
As a special part of this syntax, the ``end`` keyword may be used to represent the last

0 commit comments

Comments
 (0)