Skip to content

Commit 037bb58

Browse files
committed
Doc and news for dropping scalar dimensions
1 parent 172cff3 commit 037bb58

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

NEWS.md

+9-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,15 @@ Library improvements
3737

3838
* New method for generic QR with column pivoting ([#13480]).
3939

40-
* A new `SparseVector` type allows for one-dimensional sparse arrays. Slicing
41-
and reshaping sparse matrices now return vectors when appropriate. The
42-
`sparsevec` function returns a one-dimensional sparse vector instead of a
43-
one-column sparse matrix.
40+
* Arrays:
41+
42+
* A new `SparseVector` type allows for one-dimensional sparse arrays. Slicing
43+
and reshaping sparse matrices now return vectors when appropriate. The
44+
`sparsevec` function returns a one-dimensional sparse vector instead of a
45+
one-column sparse matrix.
46+
47+
* All dimensions indexed by scalars are now dropped, whereas previously only
48+
trailing scalar dimensions would be omitted from the result.
4449

4550
Deprecated or removed
4651
---------------------

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)