@@ -273,12 +273,11 @@ function materialize!(M::MatLmulVec{<:QRPackedQLayout{<:AdaptiveLayout{<:Abstrac
273
273
B
274
274
end
275
275
276
- function materialize! (M:: MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout{<:AbstractBlockBandedLayout}},<:PaddedLayout} )
276
+ function materialize! (M:: MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout{<:AbstractBlockBandedLayout}},<:PaddedLayout} ; tolerance = 1E-30 )
277
277
adjA,B_in = M. A,M. B
278
278
A = adjA. parent
279
279
T = eltype (M)
280
280
COLGROWTH = 300 # rate to grow columns
281
- tol = 1E-30
282
281
ax1 = axes (A. factors. data. data,1 )
283
282
B = PseudoBlockVector (B_in, (ax1,))
284
283
@@ -296,7 +295,7 @@ function materialize!(M::MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout{<:Abst
296
295
resizedata! (B, CS_max)
297
296
mx = maximum (abs,view (B,J: last (blockcolsupport (A. factors. data. data. array,J))))
298
297
isnan (mx) && error (" Not-a-number encounted" )
299
- if J > SB && mx ≤ tol
298
+ if J > SB && mx ≤ tolerance
300
299
break
301
300
end
302
301
partialqr! (A. factors. data, CS_max)
@@ -307,19 +306,19 @@ function materialize!(M::MatLmulVec{<:AdjQRPackedQLayout{<:AdaptiveLayout{<:Abst
307
306
JR = last (JR)+ 1 : findblock (ax1,last (jr)+ COLGROWTH)
308
307
end
309
308
end
310
- resizedata_chop! (B, tol )
309
+ resizedata_chop! (B, tolerance )
311
310
end
312
311
313
312
314
- function _lmul_copymutable (A:: AbstractMatrix{T} , x:: AbstractVector{S} ) where {T,S}
313
+ function _lmul_copymutable (A:: AbstractMatrix{T} , x:: AbstractVector{S} ; kwds ... ) where {T,S}
315
314
TS = promote_op (matprod, T, S)
316
- lmul! (A, Base. copymutable (convert (AbstractVector{TS},x)))
315
+ lmul! (A, Base. copymutable (convert (AbstractVector{TS},x)); kwds ... )
317
316
end
318
317
319
- (* )(A:: QRPackedQ{T,<:AdaptiveQRFactors} , x:: AbstractVector ) where {T} = _lmul_copymutable (A, x)
320
- (* )(A:: Adjoint{T,<:QRPackedQ{T,<:AdaptiveQRFactors}} , x:: AbstractVector ) where {T} = _lmul_copymutable (A, x)
321
- (* )(A:: QRPackedQ{T,<:AdaptiveQRFactors} , x:: LayoutVector ) where {T} = _lmul_copymutable (A, x)
322
- (* )(A:: Adjoint{T,<:QRPackedQ{T,<:AdaptiveQRFactors}} , x:: LayoutVector ) where {T} = _lmul_copymutable (A, x)
318
+ (* )(A:: QRPackedQ{T,<:AdaptiveQRFactors} , x:: AbstractVector ; kwds ... ) where {T} = _lmul_copymutable (A, x; kwds ... )
319
+ (* )(A:: Adjoint{T,<:QRPackedQ{T,<:AdaptiveQRFactors}} , x:: AbstractVector ; kwds ... ) where {T} = _lmul_copymutable (A, x; kwds ... )
320
+ (* )(A:: QRPackedQ{T,<:AdaptiveQRFactors} , x:: LayoutVector ; kwds ... ) where {T} = _lmul_copymutable (A, x; kwds ... )
321
+ (* )(A:: Adjoint{T,<:QRPackedQ{T,<:AdaptiveQRFactors}} , x:: LayoutVector ; kwds ... ) where {T} = _lmul_copymutable (A, x; kwds ... )
323
322
324
323
function ldiv! (R:: UpperTriangular{<:Any,<:AdaptiveQRFactors} , B:: CachedVector{<:Any,<:Any,<:Zeros{<:Any,1}} )
325
324
n = B. datasize[1 ]
@@ -343,10 +342,10 @@ end
343
342
344
343
ldiv! (dest:: AbstractVector , F:: QR{<:Any,<:AdaptiveQRFactors} , b:: AbstractVector ) =
345
344
ldiv! (F, copyto! (dest, b))
346
- ldiv! (F:: QR{<:Any,<:AdaptiveQRFactors} , b:: AbstractVector ) = ldiv! (F. R, lmul! (F. Q' ,b))
347
- ldiv! (F:: QR{<:Any,<:AdaptiveQRFactors} , b:: LayoutVector ) = ldiv! (F. R, lmul! (F. Q' ,b))
348
- \ (F:: QR{<:Any,<:AdaptiveQRFactors} , B:: AbstractVector ) = ldiv! (F. R, F. Q' B )
349
- \ (F:: QR{<:Any,<:AdaptiveQRFactors} , B:: LayoutVector ) = ldiv! (F. R, F. Q' B )
345
+ ldiv! (F:: QR{<:Any,<:AdaptiveQRFactors} , b:: AbstractVector ; kwds ... ) = ldiv! (F. R, lmul! (F. Q' ,b; kwds ... ))
346
+ ldiv! (F:: QR{<:Any,<:AdaptiveQRFactors} , b:: LayoutVector ; kwds ... ) = ldiv! (F. R, lmul! (F. Q' ,b; kwds ... ))
347
+ \ (F:: QR{<:Any,<:AdaptiveQRFactors} , B:: AbstractVector ; kwds ... ) = ldiv! (F. R, * ( F. Q' , B; kwds ... ) )
348
+ \ (F:: QR{<:Any,<:AdaptiveQRFactors} , B:: LayoutVector ; kwds ... ) = ldiv! (F. R, * ( F. Q' , B; kwds ... ) )
350
349
351
350
352
351
factorize (A:: BandedMatrix{<:Any,<:Any,<:OneToInf} ) = qr (A)
0 commit comments