Skip to content

Commit

Permalink
Add news entry
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub committed Oct 8, 2024
1 parent fbe8e3d commit b8f94b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ Standard library changes
(callable via `cholesky[!](A, RowMaximum())`) ([#54619]).
* The number of default BLAS threads now respects process affinity, instead of
using total number of logical threads available on the system ([#55574]).
* A new function `zeroslike` is added that is used to generate the zero elements for matrix-valued banded matrices.
Custom array types may specialize this function to return an appropriate result. ([#55252])

#### Logging

Expand Down
8 changes: 4 additions & 4 deletions stdlib/LinearAlgebra/src/diagonal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ diagzero(D::Diagonal{M}, i, j) where {M<:AbstractMatrix} =
zeroslike(M::Type, ax::Vararg{Union{AbstractUnitRange, Integer}}) = zeroslike(M, ax)
"""
zeroslike(::Type{M}, ax::Tuple{AbstractUnitRange, Vararg{AbstractUnitRange}}) where {M<:AbstractMatrix}
zeroslike(::Type{M}, sz::Tuple{Integer, Vararg{Integer}}) where {M<:AbstractMatrix}
Return an appropriate zero-ed array similar to `M`, with either
the axes `ax`, or the `size` `map(length, ax)`.
This will be used as a structural zero element of a banded matrix. By default, `zeroslike` falls back to
using the size along each axis to construct the array.
Return an appropriate zero-ed array similar to `M`, with either the axes `ax` or the size `sz`.
This will be used as a structural zero element of a matrix-valued banded matrix.
By default, `zeroslike` falls back to using the size along each axis to construct the array.
"""
zeroslike(M::Type, ax::Tuple{AbstractUnitRange, Vararg{AbstractUnitRange}}) = zeroslike(M, map(length, ax))
zeroslike(M::Type, sz::Tuple{Integer, Vararg{Integer}}) = zeros(M, sz)
Expand Down

0 comments on commit b8f94b8

Please sign in to comment.