@@ -622,21 +622,25 @@ else
622622end
623623
624624"""
625- qr_instance(A) -> qr_factorization_instance
625+ qr_instance(A, pivot = NoPivot() ) -> qr_factorization_instance
626626
627627Returns an instance of the QR factorization object with the correct type
628628cheaply.
629629"""
630- function qr_instance (A:: Matrix{T} ) where {T}
631- LinearAlgebra. QRCompactWY (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
630+ function qr_instance (A:: Matrix{T} ,pivot = DEFAULT_CHOLESKY_PIVOT) where {T}
631+ if pivot === DEFAULT_CHOLESKY_PIVOT
632+ LinearAlgebra. QRCompactWY (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
633+ else
634+ LinearAlgebra. QRPivoted (zeros (T,0 ,0 ),zeros (T,0 ),zeros (Int,0 ))
635+ end
632636end
633637
634- function qr_instance (A:: Matrix{BigFloat} )
638+ function qr_instance (A:: Matrix{BigFloat} ,pivot = DEFAULT_CHOLESKY_PIVOT )
635639 LinearAlgebra. QR (zeros (BigFloat,0 ,0 ),zeros (BigFloat,0 ))
636640end
637641
638642# Could be optimized but this should work for any real case.
639- function qr_instance (jac_prototype:: SparseMatrixCSC )
643+ function qr_instance (jac_prototype:: SparseMatrixCSC , pivot = DEFAULT_CHOLESKY_PIVOT )
640644 qr (sparse (rand (1 ,1 )))
641645end
642646
@@ -645,15 +649,15 @@ end
645649
646650Returns the number.
647651"""
648- qr_instance (a:: Number ) = a
652+ qr_instance (a:: Number , pivot = DEFAULT_CHOLESKY_PIVOT ) = a
649653
650654"""
651655 qr_instance(a::Any) -> qr(a)
652656
653657Slow fallback which gets the instance via factorization. Should get
654658specialized for new matrix types.
655659"""
656- qr_instance (a:: Any ) = qr (a)# check = false)
660+ qr_instance (a:: Any , pivot = DEFAULT_CHOLESKY_PIVOT ) = qr (a)# check = false)
657661
658662"""
659663 svd_instance(A) -> qr_factorization_instance
0 commit comments