Skip to content

Commit 82a7adc

Browse files
authored
Overload array constructors for BunchKaufman (#1461)
1 parent 7b21cab commit 82a7adc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/bunchkaufman.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,12 @@ BunchKaufman{T}(B::BunchKaufman) where {T} =
217217
BunchKaufman(convert(Matrix{T}, B.LD), B.ipiv, B.uplo, B.symmetric, B.rook, B.info)
218218
Factorization{T}(B::BunchKaufman) where {T} = BunchKaufman{T}(B)
219219

220+
AbstractMatrix(B::BunchKaufman) = B.uplo == 'U' ? B.P'B.U*B.D*B.U'B.P : B.P'B.L*B.D*B.L'B.P
221+
AbstractArray(B::BunchKaufman) = AbstractMatrix(B)
222+
Matrix(B::BunchKaufman) = Array(AbstractArray(B))
223+
Array(B::BunchKaufman) = Matrix(B)
224+
225+
220226
size(B::BunchKaufman) = size(getfield(B, :LD))
221227
size(B::BunchKaufman, d::Integer) = size(getfield(B, :LD), d)
222228
issymmetric(B::BunchKaufman) = B.symmetric

0 commit comments

Comments
 (0)