Skip to content
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
4 changes: 4 additions & 0 deletions src/banded/BandedMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1032,3 +1032,7 @@ function one(A::BandedMatrix)
m==n || throw(DimensionMismatch("multiplicative identity defined only for square matrices"))
typeof(A)(I, (m,n))
end

function Base.unaliascopy(B::BandedMatrix)
_BandedMatrix(Base.unaliascopy(B.data), Base.unaliascopy(B.raxis), B.l, B.u)
end
7 changes: 7 additions & 0 deletions test/test_banded.jl
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,13 @@ include("mymatrix.jl")
@test Q == I(5)
@test eltype(Q) == Float64
end

@testset "unaliascopy" begin
B = BandedMatrices._BandedMatrix(view(randn(1, 5),:,:), 5, 0, 0)
B2 = Base.unaliascopy(B)
@test B2 == B
@test typeof(B2) == typeof(B)
end
end

end # module
Loading