@@ -395,33 +395,51 @@ function FastQRFactorization()
395
395
# but QRFactorization uses 16.
396
396
end
397
397
398
- function init_cacheval (alg:: FastQRFactorization{NoPivot} , A, b, u, Pl, Pr,
399
- maxiters, abstol, reltol, verbose)
400
- ws = QRWYWs (A; blocksize = alg. blocksize)
401
- return WorkspaceAndFactors (ws, LinearAlgebra. QRCompactWY (LAPACK. geqrt! (ws, A)... ))
402
- end
398
+ @static if VERSION < v " 1.7beta"
399
+ function init_cacheval (alg:: FastQRFactorization{Val{false}} , A, b, u, Pl, Pr,
400
+ maxiters, abstol, reltol, verbose)
401
+ ws = QRWYWs (A; blocksize = alg. blocksize)
402
+ return WorkspaceAndFactors (ws, LinearAlgebra. QRCompactWY (LAPACK. geqrt! (ws, A)... ))
403
+ end
403
404
404
- function init_cacheval (:: FastQRFactorization{LinearAlgebra.ColumnNorm} , A, b, u, Pl, Pr,
405
- maxiters, abstol, reltol, verbose)
406
- ws = QRpWs (A)
407
- return WorkspaceAndFactors (ws, LinearAlgebra. QRPivoted (LAPACK. geqp3! (ws, A)... ))
405
+ function init_cacheval (:: FastQRFactorization{Val{true}} , A, b, u, Pl, Pr,
406
+ maxiters, abstol, reltol, verbose)
407
+ ws = QRpWs (A)
408
+ return WorkspaceAndFactors (ws, LinearAlgebra. QRPivoted (LAPACK. geqp3! (ws, A)... ))
409
+ end
410
+ else
411
+ function init_cacheval (alg:: FastQRFactorization{NoPivot} , A, b, u, Pl, Pr,
412
+ maxiters, abstol, reltol, verbose)
413
+ ws = QRWYWs (A; blocksize = alg. blocksize)
414
+ return WorkspaceAndFactors (ws, LinearAlgebra. QRCompactWY (LAPACK. geqrt! (ws, A)... ))
415
+ end
416
+ function init_cacheval (:: FastQRFactorization{ColumnNorm} , A, b, u, Pl, Pr,
417
+ maxiters, abstol, reltol, verbose)
418
+ ws = QRpWs (A)
419
+ return WorkspaceAndFactors (ws, LinearAlgebra. QRPivoted (LAPACK. geqp3! (ws, A)... ))
420
+ end
408
421
end
409
422
423
+
424
+
410
425
function SciMLBase. solve (cache:: LinearCache , alg:: FastQRFactorization{P} ) where {P}
411
426
A = cache. A
412
427
A = convert (AbstractMatrix, A)
413
428
ws_and_fact = cache. cacheval
414
429
if cache. isfresh
415
430
# we will fail here if A is a different *size* than in a previous version of the same cache.
416
431
# it may instead be desirable to resize the workspace.
417
- if P === NoPivot
432
+ nopivot = @static if VERSION < v " 1.7beta"
433
+ Val{false }
434
+ else
435
+ NoPivot
436
+ end
437
+ if P === nopivot
418
438
@set! ws_and_fact. factors = LinearAlgebra. QRCompactWY (LAPACK. geqrt! (ws_and_fact. workspace,
419
439
A)... )
420
- elseif P === LinearAlgebra . ColumnNorm
440
+ else
421
441
@set! ws_and_fact. factors = LinearAlgebra. QRPivoted (LAPACK. geqp3! (ws_and_fact. workspace,
422
442
A)... )
423
- else
424
- error (" No FastLAPACK Factorization defined for $P " )
425
443
end
426
444
cache = set_cacheval (cache, ws_and_fact)
427
445
end
0 commit comments