@@ -101,18 +101,21 @@ blockstype(a::BlockArray) = blockstype(typeof(a))
101101blocktype (arraytype:: Type{<:BlockArray} ) = eltype (blockstype (arraytype))
102102blocktype (a:: BlockArray ) = eltype (blocks (a))
103103
104- abstract type AbstractBlockSparseArrayInterface <: AbstractSparseArrayInterface end
104+ abstract type AbstractBlockSparseArrayInterface{N} <: AbstractSparseArrayInterface{N} end
105105
106106# TODO : Also support specifying the `blocktype` along with the `eltype`.
107- function DerivableInterfaces . arraytype (:: AbstractBlockSparseArrayInterface , T:: Type )
108- return BlockSparseArray{T}
107+ function Base . similar (:: AbstractBlockSparseArrayInterface , T:: Type , ax :: Tuple )
108+ return similar ( BlockSparseArray{T}, ax)
109109end
110110
111- struct BlockSparseArrayInterface <: AbstractBlockSparseArrayInterface end
111+ struct BlockSparseArrayInterface{N} <: AbstractBlockSparseArrayInterface{N} end
112+ BlockSparseArrayInterface (:: Val{N} ) where {N} = BlockSparseArrayInterface {N} ()
113+ BlockSparseArrayInterface {M} (:: Val{N} ) where {M,N} = BlockSparseArrayInterface {N} ()
114+ BlockSparseArrayInterface () = BlockSparseArrayInterface {Any} ()
112115
113- @interface :: AbstractBlockSparseArrayInterface BlockArrays. blocks (a:: AbstractArray ) = error (
114- " Not implemented"
115- )
116+ @interface :: AbstractBlockSparseArrayInterface function BlockArrays. blocks (a:: AbstractArray )
117+ return error ( " Not implemented" )
118+ end
116119
117120@interface :: AbstractBlockSparseArrayInterface function SparseArraysBase. isstored (
118121 a:: AbstractArray{<:Any,N} , I:: Vararg{Int,N}
0 commit comments