@@ -468,45 +468,53 @@ Returns the number.
468468"""
469469bunchkaufman_instance (a:: Any ) = bunchkaufman (a, check = false )
470470
471+ @static if VERSION < v " 1.7beta"
472+ const DEFAULT_CHOLESKY_PIVOT = Val (false )
473+ else
474+ const DEFAULT_CHOLESKY_PIVOT = LinearAlgebra. NoPivot ()
475+ end
476+
471477"""
472478cholesky_instance(A, pivot = LinearAlgebra.RowMaximum()) -> cholesky_factorization_instance
473479
474480Returns an instance of the Cholesky factorization object with the correct type
475481cheaply.
476482"""
477- function cholesky_instance (A:: Matrix{T} , pivot = LinearAlgebra . RowMaximum ()) where {T}
483+ function cholesky_instance (A:: Matrix{T} , pivot = DEFAULT_CHOLESKY_PIVOT) where {T}
478484 return cholesky (similar (A, 0 , 0 ), pivot, check = false )
479485end
480- function cholesky_instance (A:: SparseMatrixCSC , pivot = LinearAlgebra. RowMaximum ())
486+
487+ function cholesky_instance (A:: Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}} , pivot = DEFAULT_CHOLESKY_PIVOT)
481488 cholesky (sparse (similar (A, 1 , 1 )), check = false )
482489end
490+
483491
484492"""
485493cholesky_instance(a::Number, pivot = LinearAlgebra.RowMaximum()) -> a
486494
487495Returns the number.
488496"""
489- cholesky_instance (a:: Number , pivot = LinearAlgebra . RowMaximum () ) = a
497+ cholesky_instance (a:: Number , pivot = DEFAULT_CHOLESKY_PIVOT ) = a
490498
491499"""
492500cholesky_instance(a::Any, pivot = LinearAlgebra.RowMaximum()) -> cholesky(a, check=false)
493501
494502Slow fallback which gets the instance via factorization. Should get
495503specialized for new matrix types.
496504"""
497- cholesky_instance (a:: Any , pivot = LinearAlgebra . RowMaximum () ) = cholesky (a, pivot, check = false )
505+ cholesky_instance (a:: Any , pivot = DEFAULT_CHOLESKY_PIVOT ) = cholesky (a, pivot, check = false )
498506
499507"""
500508ldlt_instance(A) -> ldlt_factorization_instance
501509
502510Returns an instance of the LDLT factorization object with the correct type
503511cheaply.
504512"""
505- function ldlt_instance (A:: Matrix{T} ) where {T}
506- return ldlt (SymTridiagonal (similar (A, 0 , 0 )), check = false )
513+ function ldlt_instance (A:: Matrix{T} ) where {T}
514+ return ldlt (SymTridiagonal (similar (A, 0 , 0 )))
507515end
508516function ldlt_instance (A:: SparseMatrixCSC )
509- ldlt (sparse (similar (A, 1 , 1 )), check = false )
517+ ldlt (sparse (similar (A, 1 , 1 )), check= false )
510518end
511519
512520"""
@@ -574,7 +582,7 @@ Returns an instance of the QR factorization object with the correct type
574582cheaply.
575583"""
576584function qr_instance (A:: Matrix{T} ) where {T}
577- LinearAlgebra. QRCompactWYQ (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
585+ LinearAlgebra. QRCompactWY (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
578586end
579587
580588function qr_instance (A:: Matrix{BigFloat} )
0 commit comments