@@ -440,6 +440,33 @@ matrix_colors(A::Bidiagonal) = _cycle(1:2, Base.size(A, 2))
440
440
matrix_colors (A:: Union{Tridiagonal, SymTridiagonal} ) = _cycle (1 : 3 , Base. size (A, 2 ))
441
441
_cycle (repetend, len) = repeat (repetend, div (len, length (repetend)) + 1 )[1 : len]
442
442
443
+ """
444
+ cholesky_instance(A, pivot = LinearAlgebra.RowMaximum()) -> cholesky_factorization_instance
445
+
446
+ Returns an instance of the Cholesky factorization object with the correct type
447
+ cheaply.
448
+ """
449
+ function cholesky_instance (A:: Matrix{T} , pivot = LinearAlgebra. RowMaximum ()) where {T}
450
+ return cholesky (similar (A, 0 , 0 ), pivot, check = false )
451
+ end
452
+ function cholesky_instance (A:: SparseMatrixCSC )
453
+ cholesky (sparse (similar (A, 1 , 1 )), check = false )
454
+ end
455
+
456
+ """
457
+ cholesky_instance(a::Number, pivot = LinearAlgebra.RowMaximum()) -> a
458
+
459
+ Returns the number.
460
+ """
461
+ cholesky_instance (a:: Number , pivot = LinearAlgebra. RowMaximum ()) = a
462
+
463
+ """
464
+ cholesky_instance(a::Any, pivot = LinearAlgebra.RowMaximum()) -> cholesky(a, check=false)
465
+
466
+ Returns the number.
467
+ """
468
+ cholesky_instance (a:: Any , pivot = LinearAlgebra. RowMaximum ()) = cholesky (a, pivot, check = false )
469
+
443
470
"""
444
471
lu_instance(A) -> lu_factorization_instance
445
472
0 commit comments