Skip to content

Commit 83a6108

Browse files
committed
Fix matmul
1 parent e3b61cd commit 83a6108

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

src/BlockArraysExtensions/blockedunitrange.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ end
3636
# Take a collection of axes and mortar them
3737
# into a single blocked axis.
3838
function mortar_axis(axs)
39+
return blockrange(axs)
40+
end
41+
function mortar_axis(axs::Vector{<:Base.OneTo{<:Integer}})
3942
return blockedrange(length.(axs))
4043
end
4144

src/abstractblocksparsearray/abstractblocksparsearray.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ end
1919

2020
# Specialized in order to fix ambiguity error with `BlockArrays`.
2121
function Base.getindex(a::AbstractBlockSparseArray{<:Any,N}, I::Vararg{Int,N}) where {N}
22-
return @interface BlockSparseArrayInterface() getindex(a, I...)
22+
return @interface interface(a) getindex(a, I...)
2323
end
2424

2525
# Specialized in order to fix ambiguity error with `BlockArrays`.
2626
function Base.getindex(a::AbstractBlockSparseArray{<:Any,0})
27-
return @interface BlockSparseArrayInterface() getindex(a)
27+
return @interface interface(a) getindex(a)
2828
end
2929

3030
## # Fix ambiguity error with `BlockArrays`.
@@ -39,21 +39,21 @@ end
3939
##
4040
## # Fix ambiguity error with `BlockArrays`.
4141
## function Base.getindex(a::AbstractBlockSparseArray, I::Vararg{AbstractVector})
42-
## ## return @interface BlockSparseArrayInterface() getindex(a, I...)
42+
## ## return @interface interface(a) getindex(a, I...)
4343
## return ArrayLayouts.layout_getindex(a, I...)
4444
## end
4545

4646
# Specialized in order to fix ambiguity error with `BlockArrays`.
4747
function Base.setindex!(
4848
a::AbstractBlockSparseArray{<:Any,N}, value, I::Vararg{Int,N}
4949
) where {N}
50-
@interface BlockSparseArrayInterface() setindex!(a, value, I...)
50+
@interface interface(a) setindex!(a, value, I...)
5151
return a
5252
end
5353

5454
# Fix ambiguity error.
5555
function Base.setindex!(a::AbstractBlockSparseArray{<:Any,0}, value)
56-
@interface BlockSparseArrayInterface() setindex!(a, value)
56+
@interface interface(a) setindex!(a, value)
5757
return a
5858
end
5959

src/abstractblocksparsearray/arraylayouts.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ function Base.similar(
2727
elt::Type,
2828
axes,
2929
) where {A,B}
30-
# TODO: Check that this equals `similartype(blocktype(B), elt, axes)`,
31-
# or maybe promote them?
32-
output_blocktype = similartype(blocktype(A), elt, axes)
30+
# TODO: Use something like `Base.promote_op(*, A, B)` to determine the output block type.
31+
output_blocktype = similartype(blocktype(A), Type{elt}, Tuple{blockaxistype.(axes)...})
3332
return similar(BlockSparseArray{elt,length(axes),output_blocktype}, axes)
3433
end
3534

0 commit comments

Comments
 (0)