diff --git a/Project.toml b/Project.toml index cc18e35..4bb3b26 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BlockBandedMatrices" uuid = "ffab5731-97b5-5995-9138-79e8c1846df0" -version = "0.13.5" +version = "0.13.2" [deps] ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a" diff --git a/src/BandedBlockBandedMatrix.jl b/src/BandedBlockBandedMatrix.jl index 33b7eda..8892187 100644 --- a/src/BandedBlockBandedMatrix.jl +++ b/src/BandedBlockBandedMatrix.jl @@ -237,6 +237,10 @@ convert(::Type{AbstractMatrix{T}}, B::BandedBlockBandedMatrix) where T = _Banded convert(::Type{AbstractArray{T}}, B::BandedBlockBandedMatrix{T}) where T = B convert(::Type{AbstractMatrix{T}}, B::BandedBlockBandedMatrix{T}) where T = B +copy(A::Adjoint{T,<:BandedBlockBandedMatrix}) where T = copy(parent(A))' +copy(A::Transpose{T,<:BandedBlockBandedMatrix}) where T = transpose(copy(parent(A))) + + similar(A::BandedBlockBandedMatrix, ::Type{T}, axes::NTuple{2,AbstractUnitRange{Int}}) where T = BandedBlockBandedMatrix{T}(undef, axes, blockbandwidths(A), subblockbandwidths(A)) diff --git a/test/test_bandedblockbanded.jl b/test/test_bandedblockbanded.jl index 8eb8e38..3409124 100644 --- a/test/test_bandedblockbanded.jl +++ b/test/test_bandedblockbanded.jl @@ -565,6 +565,19 @@ import ArrayLayouts: RangeCumsum A = _BandedBlockBandedMatrix(data, rows, cols, (l, u), (λ, μ)) @test similar(A, Float64, (Base.OneTo(5), axes(A,2))) isa BandedBlockBandedMatrix end + + @testset "adj/trans" begin + l , u = 2,1 + λ , μ = 1,2 + N = M = 4 + cols = rows = 1:N + data = reshape(Vector(1:(λ+μ+1)*(l+u+1)*sum(cols)), ((λ+μ+1)*(l+u+1), sum(cols))) + A = _BandedBlockBandedMatrix(data, rows,cols, (l,u), (λ,μ)) + @test copy(A') isa Adjoint + @test copy(A') == copy(A)' + @test copy(transpose(A)) isa Transpose + @test copy(transpose(A)) == transpose(copy(A)) + end end if false # turned off since tests have check-bounds=yes diff --git a/test/test_docstrings.jl b/test/test_docstrings.jl index 4fbd700..b2225c4 100644 --- a/test/test_docstrings.jl +++ b/test/test_docstrings.jl @@ -1,8 +1,5 @@ using Documenter @testset "docstrings" begin - # don't test docstrings on old versions to avoid failures due to changes in types - if VERSION >= v"1.9" - DocMeta.setdocmeta!(BlockBandedMatrices, :DocTestSetup, :(using BlockBandedMatrices); recursive=true) + DocMeta.setdocmeta!(BlockBandedMatrices, :DocTestSetup, :(using BlockBandedMatrices); recursive=true) doctest(BlockBandedMatrices) - end end