@@ -148,15 +148,16 @@ convert(::Type{DefaultBandedMatrix}, M::AbstractMatrix{T}) where T = convert(Def
148148
149149copy (B:: BandedMatrix ) = _BandedMatrix (copy (B. data), B. raxis, B. l, B. u)
150150
151- if isdefined (LinearAlgebra, :copymutable_oftype )
152- LinearAlgebra. copymutable_oftype (B:: BandedMatrix , :: Type{S} ) where S =
153- _BandedMatrix (LinearAlgebra. copymutable_oftype (B. data, S), B. raxis, B. l, B. u)
154151
155- LinearAlgebra. copymutable_oftype (B:: Adjoint{<:Any,<:BandedMatrix} , :: Type{S} ) where S =
156- LinearAlgebra. copymutable_oftype (parent (B), S)'
157- LinearAlgebra. copymutable_oftype (B:: Transpose{<:Any,<:BandedMatrix} , :: Type{S} ) where S =
158- transpose (LinearAlgebra. copymutable_oftype (parent (B), S))
159- end
152+ copymutable_oftype_layout (:: BandedColumns , B, :: Type{S} ) where S =
153+ _BandedMatrix (LinearAlgebra. copymutable_oftype (bandeddata (B), S), axes (B,1 ), bandwidths (B)... )
154+
155+ copymutable_oftype_layout (:: BandedRows , B, :: Type{S} ) where S =
156+ dualadjoint (B)(LinearAlgebra. copymutable_oftype (parent (B), S))
157+
158+ copymutable_oftype_layout (:: AbstractBandedLayout , B, :: Type{S} ) where S =
159+ copyto! (BandedMatrix {S} (undef, axes (B), bandwidths (B)), B)
160+
160161
161162promote_rule (:: Type{BandedMatrix{T1, C1}} , :: Type{BandedMatrix{T2, C2}} ) where {T1,C1, T2,C2} =
162163 BandedMatrix{promote_type (T1,T2), promote_type (C1, C2)}
0 commit comments