Skip to content

Commit 109592e

Browse files
authored
eltype bugfix in default_BlockMatrix (#402)
* eltype bugfix in default_BlockMatrix * import packages
1 parent 5241779 commit 109592e

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.8.4"
3+
version = "0.8.5"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Operators/Operator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ function BlockBandedMatrix(S::Operator)
765765
end
766766

767767
function default_BlockMatrix(S::Operator)
768-
ret = PseudoBlockArray(zeros(size(S)),
768+
ret = PseudoBlockArray(zeros(eltype(S), size(S)),
769769
AbstractVector{Int}(blocklengths(rangespace(S))),
770770
AbstractVector{Int}(blocklengths(domainspace(S))))
771771
ret .= S

test/runtests.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ using ApproxFunBase
22
using ApproxFunBase:
33
using Aqua
44
using BandedMatrices
5+
using BlockArrays
6+
using BlockBandedMatrices
57
using DomainSets
68
using FillArrays
79
using InfiniteArrays
@@ -359,6 +361,21 @@ end
359361
ApproxFunBase.mul_coefficients!(Operator(2I), v)
360362
@test v Float64[2i^2 for i in 1:4]
361363
end
364+
@testset "Matrix types" begin
365+
F = Multiplication(Fun(PointSpace(1:3)), PointSpace(1:3))
366+
function test_matrices(F)
367+
A = AbstractMatrix(F)
368+
@test Matrix(F) == BandedMatrix(F) == BlockBandedMatrix(F) == ApproxFunBase.RaggedMatrix(F) == A
369+
DefBlk = ApproxFunBase.default_BlockMatrix(F)
370+
DefBBlk = ApproxFunBase.default_BlockBandedMatrix(F)
371+
DefB = ApproxFunBase.default_BandedMatrix(F)
372+
DefM = ApproxFunBase.default_Matrix(F)
373+
DefR = ApproxFunBase.default_RaggedMatrix(F)
374+
@test DefBlk == DefBBlk == DefB == DefM == DefR == A
375+
end
376+
test_matrices(F)
377+
test_matrices(im*F)
378+
end
362379
end
363380

364381
@testset "RowVector" begin

0 commit comments

Comments
 (0)