@@ -305,20 +305,32 @@ _qr!(layout, axes, A, args...; kwds...) = error("Overload _qr!(::$(typeof(layout
305305_lu (layout, axes, A; kwds... ) = Base. invoke (lu, Tuple{AbstractMatrix{eltype (A)}}, A; kwds... )
306306_lu (layout, axes, A, pivot:: P ; kwds... ) where P = Base. invoke (lu, Tuple{AbstractMatrix{eltype (A)},P}, A, pivot; kwds... )
307307_lu! (layout, axes, A, args... ; kwds... ) = error (" Overload _lu!(::$(typeof (layout)) , axes, A)" )
308- _cholesky (layout, axes, A, :: Val{false} = Val ( false ); check:: Bool = true ) = cholesky! (cholcopy (A); check = check)
309- _cholesky (layout, axes, A, :: Val{true} ; tol = 0.0 , check:: Bool = true ) = cholesky! (cholcopy (A), Val ( true ); tol = tol, check = check)
308+ _cholesky (layout, axes, A, :: CNoPivot = CNoPivot ( ); check:: Bool = true ) = cholesky! (cholcopy (A); check = check)
309+ _cholesky (layout, axes, A, :: CRowMaximum ; tol = 0.0 , check:: Bool = true ) = cholesky! (cholcopy (A), CRowMaximum ( ); tol = tol, check = check)
310310_factorize (layout, axes, A) = qr (A) # Default to QR
311311
312312
313313_factorize (:: AbstractStridedLayout , axes, A) = lu (A)
314- function _lu! (:: AbstractColumnMajor , axes, A:: AbstractMatrix{T} , pivot:: Union{NoPivot, RowMaximum} = RowMaximum ();
315- check:: Bool = true ) where T<: BlasFloat
316- if pivot === NoPivot ()
317- return generic_lufact! (A, pivot; check = check)
314+ if VERSION < v " 1.8-"
315+ function _lu! (:: AbstractColumnMajor , axes, A:: AbstractMatrix{T} , pivot:: Union{NoPivot, RowMaximum} = RowMaximum ();
316+ check:: Bool = true ) where T<: BlasFloat
317+ if pivot === NoPivot ()
318+ return generic_lufact! (A, pivot; check = check)
319+ end
320+ lpt = LAPACK. getrf! (A)
321+ check && checknonsingular (lpt[3 ])
322+ return LU {T,typeof(A)} (lpt[1 ], lpt[2 ], lpt[3 ])
323+ end
324+ else
325+ function _lu! (:: AbstractColumnMajor , axes, A:: AbstractMatrix{T} , pivot:: Union{NoPivot, RowMaximum} = RowMaximum ();
326+ check:: Bool = true ) where T<: BlasFloat
327+ if pivot === NoPivot ()
328+ return generic_lufact! (A, pivot; check = check)
329+ end
330+ lpt = LAPACK. getrf! (A)
331+ check && checknonsingular (lpt[3 ])
332+ return LU {T,typeof(A),typeof(lpt[2])} (lpt[1 ], lpt[2 ], lpt[3 ])
318333 end
319- lpt = LAPACK. getrf! (A)
320- check && checknonsingular (lpt[3 ])
321- return LU {T,typeof(A)} (lpt[1 ], lpt[2 ], lpt[3 ])
322334end
323335
324336# for some reason only defined for StridedMatrix in LinearAlgebra
@@ -355,14 +367,14 @@ end
355367
356368_chol! (_, A, UL) = LinearAlgebra. _chol! (A, UL)
357369
358- function _cholesky! (layout, axes, A:: RealHermSymComplexHerm , :: Val{false} ; check:: Bool = true )
370+ function _cholesky! (layout, axes, A:: RealHermSymComplexHerm , :: CNoPivot ; check:: Bool = true )
359371 C, info = _chol! (layout, A. data, A. uplo == ' U' ? UpperTriangular : LowerTriangular)
360372 check && LinearAlgebra. checkpositivedefinite (info)
361373 return Cholesky (C. data, A. uplo, info)
362374end
363375
364376function _cholesky! (:: SymmetricLayout{<:AbstractColumnMajor} , axes, A:: AbstractMatrix{<:BlasReal} ,
365- :: Val{true} ; tol = 0.0 , check:: Bool = true )
377+ :: CRowMaximum ; tol = 0.0 , check:: Bool = true )
366378 AA, piv, rank, info = LAPACK. pstrf! (A. uplo, A. data, tol)
367379 C = CholeskyPivoted {eltype(AA),typeof(AA)} (AA, A. uplo, piv, rank, tol, info)
368380 check && chkfullrank (C)
390402
391403macro _layoutfactorizations (Typ)
392404 esc (quote
393- LinearAlgebra. cholesky (A:: $Typ , args... ; kwds... ) = ArrayLayouts. _cholesky (ArrayLayouts. MemoryLayout (A), axes (A), A, args... ; kwds... )
394- LinearAlgebra. cholesky! (A:: LinearAlgebra.RealHermSymComplexHerm{<:Real,<:$Typ} , v:: Val{false} = Val (false ); check:: Bool = true ) = ArrayLayouts. _cholesky! (ArrayLayouts. MemoryLayout (A), axes (A), A, v; check= check)
395- LinearAlgebra. cholesky! (A:: LinearAlgebra.RealHermSymComplexHerm{<:Real,<:$Typ} , v:: Val{true} ; check:: Bool = true , tol = 0.0 ) = ArrayLayouts. _cholesky! (ArrayLayouts. MemoryLayout (A), axes (A), A, v; check= check, tol= tol)
405+ LinearAlgebra. cholesky (A:: $Typ , v:: CNoPivot = CNoPivot (); kwds... ) = ArrayLayouts. _cholesky (ArrayLayouts. MemoryLayout (A), axes (A), A, v; kwds... )
406+ LinearAlgebra. cholesky (A:: $Typ , v:: CRowMaximum ; kwds... ) = ArrayLayouts. _cholesky (ArrayLayouts. MemoryLayout (A), axes (A), A, v; kwds... )
407+ LinearAlgebra. cholesky! (A:: LinearAlgebra.RealHermSymComplexHerm{<:Real,<:$Typ} , v:: CNoPivot = CNoPivot (); check:: Bool = true ) = ArrayLayouts. _cholesky! (ArrayLayouts. MemoryLayout (A), axes (A), A, v; check= check)
408+ LinearAlgebra. cholesky! (A:: LinearAlgebra.RealHermSymComplexHerm{<:Real,<:$Typ} , v:: CRowMaximum ; check:: Bool = true , tol = 0.0 ) = ArrayLayouts. _cholesky! (ArrayLayouts. MemoryLayout (A), axes (A), A, v; check= check, tol= tol)
396409 LinearAlgebra. qr (A:: $Typ , args... ; kwds... ) = ArrayLayouts. _qr (ArrayLayouts. MemoryLayout (A), axes (A), A, args... ; kwds... )
397410 LinearAlgebra. qr! (A:: $Typ , args... ; kwds... ) = ArrayLayouts. _qr! (ArrayLayouts. MemoryLayout (A), axes (A), A, args... ; kwds... )
398411 LinearAlgebra. lu (A:: $Typ , pivot:: Union{ArrayLayouts.NoPivot,ArrayLayouts.RowMaximum} ; kwds... ) = ArrayLayouts. _lu (ArrayLayouts. MemoryLayout (A), axes (A), A, pivot; kwds... )
424437
425438LinearAlgebra. ldiv! (L:: LU{<:Any,<:LayoutMatrix} , B:: LayoutVector ) = ArrayLayouts. ldiv! (L, B)
426439
427- if VERSION ≥ v " 1.7-"
428- @deprecate qr (A:: LayoutMatrix , :: Val{true} ) qr (A, ColumnNorm ())
429- end
0 commit comments