@@ -468,45 +468,53 @@ Returns the number.
468
468
"""
469
469
bunchkaufman_instance (a:: Any ) = bunchkaufman (a, check = false )
470
470
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
+
471
477
"""
472
478
cholesky_instance(A, pivot = LinearAlgebra.RowMaximum()) -> cholesky_factorization_instance
473
479
474
480
Returns an instance of the Cholesky factorization object with the correct type
475
481
cheaply.
476
482
"""
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}
478
484
return cholesky (similar (A, 0 , 0 ), pivot, check = false )
479
485
end
480
- function cholesky_instance (A:: SparseMatrixCSC , pivot = LinearAlgebra. RowMaximum ())
486
+
487
+ function cholesky_instance (A:: Union{SparseMatrixCSC,Symmetric{<:Number,<:SparseMatrixCSC}} , pivot = DEFAULT_CHOLESKY_PIVOT)
481
488
cholesky (sparse (similar (A, 1 , 1 )), check = false )
482
489
end
490
+
483
491
484
492
"""
485
493
cholesky_instance(a::Number, pivot = LinearAlgebra.RowMaximum()) -> a
486
494
487
495
Returns the number.
488
496
"""
489
- cholesky_instance (a:: Number , pivot = LinearAlgebra . RowMaximum () ) = a
497
+ cholesky_instance (a:: Number , pivot = DEFAULT_CHOLESKY_PIVOT ) = a
490
498
491
499
"""
492
500
cholesky_instance(a::Any, pivot = LinearAlgebra.RowMaximum()) -> cholesky(a, check=false)
493
501
494
502
Slow fallback which gets the instance via factorization. Should get
495
503
specialized for new matrix types.
496
504
"""
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 )
498
506
499
507
"""
500
508
ldlt_instance(A) -> ldlt_factorization_instance
501
509
502
510
Returns an instance of the LDLT factorization object with the correct type
503
511
cheaply.
504
512
"""
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 )))
507
515
end
508
516
function ldlt_instance (A:: SparseMatrixCSC )
509
- ldlt (sparse (similar (A, 1 , 1 )), check = false )
517
+ ldlt (sparse (similar (A, 1 , 1 )), check= false )
510
518
end
511
519
512
520
"""
@@ -574,7 +582,7 @@ Returns an instance of the QR factorization object with the correct type
574
582
cheaply.
575
583
"""
576
584
function 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 ))
578
586
end
579
587
580
588
function qr_instance (A:: Matrix{BigFloat} )
0 commit comments