@@ -148,6 +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)
154+
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
160+
151161promote_rule (:: Type{BandedMatrix{T1, C1}} , :: Type{BandedMatrix{T2, C2}} ) where {T1,C1, T2,C2} =
152162 BandedMatrix{promote_type (T1,T2), promote_type (C1, C2)}
153163
@@ -341,6 +351,9 @@ similar(bm::AbstractBandedMatrix, n::Integer, m::Integer, l::Integer, u::Integer
341351 similar (bm, eltype (bm), m, n, l, u)
342352similar (bm:: AbstractBandedMatrix , nm:: Tuple{<:Integer,<:Integer} ) = similar (bm, nm... )
343353
354+
355+
356+
344357# # Abstract Array Interface
345358
346359axes (A:: BandedMatrix ) = (A. raxis, axes (A. data,2 ))
@@ -806,6 +819,11 @@ function fill!(A::BandedMatrix, x)
806819 A
807820end
808821
822+ function LinearAlgebra. fillband! (A:: BandedMatrix{T} , x, l, u) where T
823+ fill! (view (A. data, max (A. u+ 1 - u,1 ): min (A. u+ 1 - l,size (A. data,1 )), :), x)
824+ A
825+ end
826+
809827diag (A:: BandedMatrix , k:: Integer = 0 ) = A[band (k)]
810828
811829# # BandedSubBandedMatrix routines
0 commit comments