Skip to content

eltype bugfix in default_BlockMatrix #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.8.4"
version = "0.8.5"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
2 changes: 1 addition & 1 deletion src/Operators/Operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,7 @@ function BlockBandedMatrix(S::Operator)
end

function default_BlockMatrix(S::Operator)
ret = PseudoBlockArray(zeros(size(S)),
ret = PseudoBlockArray(zeros(eltype(S), size(S)),
AbstractVector{Int}(blocklengths(rangespace(S))),
AbstractVector{Int}(blocklengths(domainspace(S))))
ret .= S
Expand Down
17 changes: 17 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ using ApproxFunBase
using ApproxFunBase: ∞
using Aqua
using BandedMatrices
using BlockArrays
using BlockBandedMatrices
using DomainSets
using FillArrays
using InfiniteArrays
Expand Down Expand Up @@ -359,6 +361,21 @@ end
ApproxFunBase.mul_coefficients!(Operator(2I), v)
@test v ≈ Float64[2i^2 for i in 1:4]
end
@testset "Matrix types" begin
F = Multiplication(Fun(PointSpace(1:3)), PointSpace(1:3))
function test_matrices(F)
A = AbstractMatrix(F)
@test Matrix(F) == BandedMatrix(F) == BlockBandedMatrix(F) == ApproxFunBase.RaggedMatrix(F) == A
DefBlk = ApproxFunBase.default_BlockMatrix(F)
DefBBlk = ApproxFunBase.default_BlockBandedMatrix(F)
DefB = ApproxFunBase.default_BandedMatrix(F)
DefM = ApproxFunBase.default_Matrix(F)
DefR = ApproxFunBase.default_RaggedMatrix(F)
@test DefBlk == DefBBlk == DefB == DefM == DefR == A
end
test_matrices(F)
test_matrices(im*F)
end
end

@testset "RowVector" begin
Expand Down