Skip to content

Commit 13bb720

Browse files
authored
Make map/broadcast a bit more customizable (#152)
1 parent b83242d commit 13bb720

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "BlockSparseArrays"
22
uuid = "2c9a651f-6452-4ace-a6ac-809f4280fbb4"
33
authors = ["ITensor developers <[email protected]> and contributors"]
4-
version = "0.7.16"
4+
version = "0.7.17"
55

66
[deps]
77
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"

src/blocksparsearrayinterface/map.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ function viewblock_stored(a::AbstractArray{<:Any,N}, I::Block{N}) where {N}
2626
return viewblock_stored(a, Tuple(I)...)
2727
end
2828

29-
using FillArrays: Zeros
29+
using FillArrays: Zeros, fillsimilar
3030
# Get a view of a block if it is stored, otherwise return a lazy zeros.
3131
function viewblock_or_zeros(a::AbstractArray{<:Any,N}, I::Vararg{Block{1},N}) where {N}
3232
if isstored(a, I...)
3333
return viewblock_stored(a, I...)
3434
else
3535
block_ax = map((ax, i) -> eachblockaxis(ax)[Int(i)], axes(a), I)
36-
return Zeros{eltype(a)}(block_ax)
36+
return fillsimilar(Zeros{eltype(a)}(block_ax), block_ax)
3737
end
3838
end
3939
function viewblock_or_zeros(a::AbstractArray{<:Any,N}, I::Block{N}) where {N}

0 commit comments

Comments
 (0)