@@ -103,10 +103,16 @@ function init_cacheval(alg::Union{LUFactorization, GenericLUFactorization}, A, b
103103 ArrayInterface. lu_instance (convert (AbstractMatrix, A))
104104end
105105
106+ function init_cacheval (alg:: Union{LUFactorization, GenericLUFactorization} , A:: MatrixOperator , b, u, Pl, Pr,
107+ maxiters:: Int , abstol, reltol, verbose:: Bool ,
108+ assumptions:: OperatorAssumptions )
109+ ArrayInterface. lu_instance (convert (AbstractMatrix, A))
110+ end
111+
106112const PREALLOCATED_LU = ArrayInterface. lu_instance (rand (1 , 1 ))
107113
108114function init_cacheval (alg:: Union{LUFactorization, GenericLUFactorization} ,
109- A:: Matrix{Float64} , b, u, Pl, Pr,
115+ A:: Union{ Matrix{Float64},MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl, Pr,
110116 maxiters:: Int , abstol, reltol, verbose:: Bool ,
111117 assumptions:: OperatorAssumptions )
112118 PREALLOCATED_LU
175181
176182const PREALLOCATED_QR = ArrayInterface. qr_instance (rand (1 , 1 ))
177183
178- function init_cacheval (alg:: QRFactorization , A:: Matrix{Float64} , b, u, Pl, Pr,
184+ function init_cacheval (alg:: QRFactorization , A:: Union{ Matrix{Float64}, MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl, Pr,
179185 maxiters:: Int , abstol, reltol, verbose:: Bool ,
180186 assumptions:: OperatorAssumptions )
181187 PREALLOCATED_QR
254260
255261const PREALLOCATED_CHOLESKY = ArrayInterface. cholesky_instance (rand (1 , 1 ), cholpivot)
256262
257- function init_cacheval (alg:: CholeskyFactorization , A:: Matrix{Float64} , b, u, Pl, Pr,
263+ function init_cacheval (alg:: CholeskyFactorization , A:: Union{ Matrix{Float64}, MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl, Pr,
258264 maxiters:: Int , abstol, reltol, verbose:: Bool ,
259265 assumptions:: OperatorAssumptions )
260266 PREALLOCATED_CHOLESKY
346352
347353const PREALLOCATED_SVD = ArrayInterface. svd_instance (rand (1 , 1 ))
348354
349- function init_cacheval (alg:: SVDFactorization , A:: Matrix{Float64} , b, u, Pl, Pr,
355+ function init_cacheval (alg:: SVDFactorization , A:: Union{ Matrix{Float64}, MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl, Pr,
350356 maxiters:: Int , abstol, reltol, verbose:: Bool ,
351357 assumptions:: OperatorAssumptions )
352358 PREALLOCATED_SVD
@@ -671,7 +677,7 @@ function init_cacheval(alg::UMFPACKFactorization,
671677 nothing
672678end
673679
674- function init_cacheval (alg:: UMFPACKFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u,
680+ function init_cacheval (alg:: UMFPACKFactorization , A:: Union{ SparseMatrixCSC{Float64, Int}, MatrixOperator{Float64, Matrix{Float64}} } , b, u,
675681 Pl, Pr,
676682 maxiters:: Int , abstol, reltol,
677683 verbose:: Bool , assumptions:: OperatorAssumptions )
@@ -768,7 +774,7 @@ function init_cacheval(alg::KLUFactorization,
768774 nothing
769775end
770776
771- function init_cacheval (alg:: KLUFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u, Pl,
777+ function init_cacheval (alg:: KLUFactorization , A:: Union{ SparseMatrixCSC{Float64, Int}, MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl,
772778 Pr,
773779 maxiters:: Int , abstol, reltol,
774780 verbose:: Bool , assumptions:: OperatorAssumptions )
@@ -855,7 +861,7 @@ function init_cacheval(alg::CHOLMODFactorization,
855861 nothing
856862end
857863
858- function init_cacheval (alg:: CHOLMODFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u,
864+ function init_cacheval (alg:: CHOLMODFactorization , A:: Union{ SparseMatrixCSC{Float64, Int}, MatrixOperator{Float64, Matrix{Float64}} } , b, u,
859865 Pl, Pr,
860866 maxiters:: Int , abstol, reltol,
861867 verbose:: Bool , assumptions:: OperatorAssumptions )
@@ -911,7 +917,13 @@ function init_cacheval(alg::RFLUFactorization, A, b, u, Pl, Pr, maxiters::Int,
911917 ArrayInterface. lu_instance (convert (AbstractMatrix, A)), ipiv
912918end
913919
914- function init_cacheval (alg:: RFLUFactorization , A:: Matrix{Float64} , b, u, Pl, Pr,
920+ function init_cacheval (alg:: RFLUFactorization , A:: MatrixOperator , b, u, Pl, Pr, maxiters:: Int ,
921+ abstol, reltol, verbose:: Bool , assumptions:: OperatorAssumptions )
922+ ipiv = Vector {LinearAlgebra.BlasInt} (undef, min (size (A)... ))
923+ ArrayInterface. lu_instance (convert (AbstractMatrix, A)), ipiv
924+ end
925+
926+ function init_cacheval (alg:: RFLUFactorization , A:: Union{Matrix{Float64}, MatrixOperator{Float64, Matrix{Float64}}} , b, u, Pl, Pr,
915927 maxiters:: Int ,
916928 abstol, reltol, verbose:: Bool , assumptions:: OperatorAssumptions )
917929 ipiv = Vector {LinearAlgebra.BlasInt} (undef, 0 )
@@ -1266,7 +1278,7 @@ function init_cacheval(alg::SparspakFactorization,
12661278 nothing
12671279end
12681280
1269- function init_cacheval (:: SparspakFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u, Pl,
1281+ function init_cacheval (:: SparspakFactorization , A:: Union{ SparseMatrixCSC{Float64, Int}, MatrixOperator{Float64, Matrix{Float64}} } , b, u, Pl,
12701282 Pr, maxiters:: Int , abstol,
12711283 reltol,
12721284 verbose:: Bool , assumptions:: OperatorAssumptions )
0 commit comments