Skip to content

Commit abdb8b9

Browse files
committed
Add comments
1 parent 17c7dc8 commit abdb8b9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/diagonal.jl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ _copy_diag(M::T, ::T) where {T<:Lmul} = copyto!(_similar(M.B), M)
6565
_copy_diag(M, _) = copy(M)
6666
_bidiagonal(A::Bidiagonal) = A
6767
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
6970
if iszero(view(A, diagind(A, -1)))
7071
uplo = :U
7172
else
@@ -81,6 +82,8 @@ function copy(M::Lmul{<:DiagonalLayout,<:BidiagonalLayout})
8182
B = _bidiagonal(M.B)
8283
_copy_diag(Lmul(M.A, B), M)
8384
end
85+
# we assume that the matrix is indeed tridiagonal,
86+
# so that the conversion is lossless
8487
_tridiagonal(A::Tridiagonal) = A
8588
_tridiagonal(A) = Tridiagonal(A)
8689
function copy(M::Rmul{<:TridiagonalLayout,<:DiagonalLayout})
@@ -91,6 +94,8 @@ function copy(M::Lmul{<:DiagonalLayout,<:TridiagonalLayout})
9194
B = _tridiagonal(M.B)
9295
_copy_diag(Lmul(M.A, B), M)
9396
end
97+
# we assume that the matrix is indeed symmetric tridiagonal,
98+
# so that the conversion is lossless
9499
_symtridiagonal(A::SymTridiagonal) = A
95100
_symtridiagonal(A) = SymTridiagonal(A)
96101
function copy(M::Rmul{<:SymTridiagonalLayout,<:DiagonalLayout})

0 commit comments

Comments
 (0)