|
224 | 224 |
|
225 | 225 | BlockBandedMatrix{T}(A::AbstractMatrix, block_sizes::BlockBandedSizes) where T = |
226 | 226 | BlockSkylineMatrix{T}(A, block_sizes) |
| 227 | + |
227 | 228 |
|
228 | 229 | ## |
229 | 230 | # Special cases |
@@ -343,19 +344,21 @@ julia> BlockBandedMatrix(B, (1,1)) |
343 | 344 | """ |
344 | 345 | BlockBandedMatrix(A::AbstractMatrix, lu::NTuple{2,Int}) = BlockBandedMatrix(A, BlockBandedSizes(axes(A), lu...)) |
345 | 346 |
|
346 | | -function convert(::Type{BlockSkylineMatrix}, A::AbstractMatrix) |
| 347 | +function convert(::Type{BlockSkylineMatrix{T}}, A::AbstractMatrix) where T |
347 | 348 | block_sizes = BlockSkylineSizes(axes(A), colblockbandwidths(A)...) |
348 | | - |
349 | | - copyto!(BlockSkylineMatrix{eltype(A)}(undef, block_sizes), A) |
| 349 | + copyto!(BlockSkylineMatrix{T}(undef, block_sizes), A) |
350 | 350 | end |
351 | 351 |
|
352 | | -function convert(::Type{BlockBandedMatrix}, A::AbstractMatrix) |
353 | | - convert(BlockSkylineMatrix, A) |
354 | | -end |
| 352 | +convert(::Type{BlockSkylineMatrix}, A::AbstractMatrix) = convert(BlockSkylineMatrix{eltype(A)}, A) |
| 353 | + |
| 354 | +convert(::Type{BlockBandedMatrix}, A::AbstractMatrix) = convert(BlockSkylineMatrix, A) |
| 355 | +convert(::Type{BlockBandedMatrix{T}}, A::AbstractMatrix) where T = convert(BlockSkylineMatrix{T}, A) |
| 356 | + |
355 | 357 |
|
356 | 358 |
|
357 | 359 | BlockSkylineMatrix(A::AbstractMatrix) = convert(BlockSkylineMatrix, A) |
358 | 360 | BlockBandedMatrix(A::AbstractMatrix) = convert(BlockBandedMatrix, A) |
| 361 | +BlockBandedMatrix{T}(A::AbstractMatrix) where T = convert(BlockBandedMatrix{T}, A) |
359 | 362 |
|
360 | 363 | similar(A::BlockSkylineMatrix, T::Type=eltype(A), bs::BlockSkylineSizes=A.block_sizes) = |
361 | 364 | BlockSkylineMatrix{T}(undef, bs) |
|
0 commit comments