@@ -467,16 +467,23 @@ Returns the number.
467
467
"""
468
468
bunchkaufman_instance (a:: Any ) = bunchkaufman (a, check = false )
469
469
470
+ @static if VERSION < v " 1.7beta"
471
+ const DEFAULT_CHOLESKY_PIVOT = Val (false )
472
+ else
473
+ const DEFAULT_CHOLESKY_PIVOT = LinearAlgebra. NoPivot ()
474
+ end
475
+
470
476
"""
471
477
cholesky_instance(A, pivot = LinearAlgebra.RowMaximum()) -> cholesky_factorization_instance
472
478
473
479
Returns an instance of the Cholesky factorization object with the correct type
474
480
cheaply.
475
481
"""
476
- function cholesky_instance (A:: Matrix{T} , pivot = LinearAlgebra . RowMaximum () ) where {T}
482
+ function cholesky_instance (A:: Matrix{T} , pivot = DEFAULT_CHOLESKY_PIVOT ) where {T}
477
483
return cholesky (similar (A, 0 , 0 ), pivot, check = false )
478
484
end
479
- function cholesky_instance (A:: SparseMatrixCSC , pivot = LinearAlgebra. RowMaximum ())
485
+
486
+ function cholesky_instance (A:: Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}} , pivot = DEFAULT_CHOLESKY_PIVOT)
480
487
cholesky (sparse (similar (A, 1 , 1 )), check = false )
481
488
end
482
489
@@ -485,15 +492,15 @@ cholesky_instance(a::Number, pivot = LinearAlgebra.RowMaximum()) -> a
485
492
486
493
Returns the number.
487
494
"""
488
- cholesky_instance (a:: Number , pivot = LinearAlgebra . RowMaximum () ) = a
495
+ cholesky_instance (a:: Number , pivot = DEFAULT_CHOLESKY_PIVOT ) = a
489
496
490
497
"""
491
498
cholesky_instance(a::Any, pivot = LinearAlgebra.RowMaximum()) -> cholesky(a, check=false)
492
499
493
500
Slow fallback which gets the instance via factorization. Should get
494
501
specialized for new matrix types.
495
502
"""
496
- cholesky_instance (a:: Any , pivot = LinearAlgebra . RowMaximum () ) = cholesky (a, pivot, check = false )
503
+ cholesky_instance (a:: Any , pivot = DEFAULT_CHOLESKY_PIVOT ) = cholesky (a, pivot, check = false )
497
504
498
505
"""
499
506
ldlt_instance(A) -> ldlt_factorization_instance
@@ -502,10 +509,10 @@ Returns an instance of the LDLT factorization object with the correct type
502
509
cheaply.
503
510
"""
504
511
function ldlt_instance (A:: Matrix{T} ) where {T}
505
- return ldlt (SymTridiagonal (similar (A, 0 , 0 )), check = false )
512
+ return ldlt (SymTridiagonal (similar (A, 0 , 0 )))
506
513
end
507
514
function ldlt_instance (A:: SparseMatrixCSC )
508
- ldlt (sparse (similar (A, 1 , 1 )), check = false )
515
+ ldlt (sparse (similar (A, 1 , 1 )), check= false )
509
516
end
510
517
511
518
"""
@@ -573,7 +580,7 @@ Returns an instance of the QR factorization object with the correct type
573
580
cheaply.
574
581
"""
575
582
function qr_instance (A:: Matrix{T} ) where {T}
576
- LinearAlgebra. QRCompactWYQ (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
583
+ LinearAlgebra. QRCompactWY (zeros (T,0 ,0 ),zeros (T,0 ,0 ))
577
584
end
578
585
579
586
function qr_instance (A:: Matrix{BigFloat} )
0 commit comments