@@ -65,7 +65,8 @@ _copy_diag(M::T, ::T) where {T<:Lmul} = copyto!(_similar(M.B), M)
65
65
_copy_diag (M, _) = copy (M)
66
66
_bidiagonal (A:: Bidiagonal ) = A
67
67
function _bidiagonal (A)
68
- # we assume that the matrix is indeed bidiagonal
68
+ # we assume that the matrix is indeed bidiagonal,
69
+ # so that the conversion is lossless
69
70
if iszero (view (A, diagind (A, - 1 )))
70
71
uplo = :U
71
72
else
@@ -81,6 +82,8 @@ function copy(M::Lmul{<:DiagonalLayout,<:BidiagonalLayout})
81
82
B = _bidiagonal (M. B)
82
83
_copy_diag (Lmul (M. A, B), M)
83
84
end
85
+ # we assume that the matrix is indeed tridiagonal,
86
+ # so that the conversion is lossless
84
87
_tridiagonal (A:: Tridiagonal ) = A
85
88
_tridiagonal (A) = Tridiagonal (A)
86
89
function copy (M:: Rmul{<:TridiagonalLayout,<:DiagonalLayout} )
@@ -91,6 +94,8 @@ function copy(M::Lmul{<:DiagonalLayout,<:TridiagonalLayout})
91
94
B = _tridiagonal (M. B)
92
95
_copy_diag (Lmul (M. A, B), M)
93
96
end
97
+ # we assume that the matrix is indeed symmetric tridiagonal,
98
+ # so that the conversion is lossless
94
99
_symtridiagonal (A:: SymTridiagonal ) = A
95
100
_symtridiagonal (A) = SymTridiagonal (A)
96
101
function copy (M:: Rmul{<:SymTridiagonalLayout,<:DiagonalLayout} )
0 commit comments