@@ -127,6 +127,9 @@ function bunchkaufman!(A::StridedMatrix{<:BlasFloat}, rook::Bool = false; check:
127
127
end
128
128
end
129
129
130
+ bkcopy_oftype (A, S) = eigencopy_oftype (A, S)
131
+ bkcopy_oftype (A:: Symmetric{<:Complex} , S) = Symmetric (copytrito! (similar (parent (A), S, size (A)), A. data, A. uplo), sym_uplo (A. uplo))
132
+
130
133
"""
131
134
bunchkaufman(A, rook::Bool=false; check = true) -> S::BunchKaufman
132
135
@@ -206,7 +209,7 @@ julia> S.L*S.D*S.L' - A[S.p, S.p]
206
209
```
207
210
"""
208
211
bunchkaufman (A:: AbstractMatrix{T} , rook:: Bool = false ; check:: Bool = true ) where {T} =
209
- bunchkaufman! (eigencopy_oftype (A, typeof (sqrt (oneunit (T)))), rook; check = check)
212
+ bunchkaufman! (bkcopy_oftype (A, typeof (sqrt (oneunit (T)))), rook; check = check)
210
213
211
214
BunchKaufman {T} (B:: BunchKaufman ) where {T} =
212
215
BunchKaufman (convert (Matrix{T}, B. LD), B. ipiv, B. uplo, B. symmetric, B. rook, B. info)
@@ -1529,7 +1532,7 @@ function bunchkaufman(A::AbstractMatrix{TS},
1529
1532
rook:: Bool = false ;
1530
1533
check:: Bool = true
1531
1534
) where TS <: ClosedScalar{TR} where TR <: ClosedReal
1532
- return bunchkaufman! (eigencopy_oftype (A, TS), rook; check)
1535
+ return bunchkaufman! (bkcopy_oftype (A, TS), rook; check)
1533
1536
end
1534
1537
1535
1538
function bunchkaufman (A:: AbstractMatrix{TS} ,
@@ -1551,15 +1554,15 @@ function bunchkaufman(A::AbstractMatrix{TS},
1551
1554
# We promote input to BigInt to avoid overflow problems
1552
1555
if TA == Nothing
1553
1556
if TS <: Integer
1554
- M = Rational {BigInt} .(eigencopy_oftype (A, TS))
1557
+ M = Rational {BigInt} .(bkcopy_oftype (A, TS))
1555
1558
else
1556
- M = Complex {Rational{BigInt}} .(eigencopy_oftype (A, TS))
1559
+ M = Complex {Rational{BigInt}} .(bkcopy_oftype (A, TS))
1557
1560
end
1558
1561
else
1559
1562
if TS <: Integer
1560
- M = TA (Rational {BigInt} .(eigencopy_oftype (A, TS)), Symbol (A. uplo))
1563
+ M = TA (Rational {BigInt} .(bkcopy_oftype (A, TS)), Symbol (A. uplo))
1561
1564
else
1562
- M = TA (Complex {Rational{BigInt}} .(eigencopy_oftype (A, TS)),
1565
+ M = TA (Complex {Rational{BigInt}} .(bkcopy_oftype (A, TS)),
1563
1566
Symbol (A. uplo))
1564
1567
end
1565
1568
end
0 commit comments