@@ -384,6 +384,18 @@ function _cache_self(L::FunctionOperator, u::AbstractArray)
384
384
@set! L. cache = (_u, _v)
385
385
end
386
386
387
+ # fix method amg bw AbstractArray, AbstractVecOrMat
388
+ cache_internals (L:: FunctionOperator , u:: AbstractArray ) = _cache_internals (L, u)
389
+ cache_internals (L:: FunctionOperator , u:: AbstractVecOrMat ) = _cache_internals (L, u)
390
+
391
+ function _cache_internals (L:: FunctionOperator , u:: AbstractArray )
392
+
393
+ @set! L. op = cache_operator (L. op, u)
394
+ @set! L. op_adjoint = cache_operator (L. op_adjoint, u)
395
+ @set! L. op_inverse = cache_operator (L. op_inverse, u)
396
+ @set! L. op_adjoint_inverse = cache_operator (L. op_adjoint_inverse, u)
397
+ end
398
+
387
399
function Base. show (io:: IO , L:: FunctionOperator )
388
400
M, N = size (L)
389
401
print (io, " FunctionOperator($M × $N )" )
@@ -542,7 +554,7 @@ function _sizecheck(L::FunctionOperator, u, v)
542
554
if ! isnothing (v)
543
555
if size (v) != L. traits. sizes[2 ]
544
556
msg = """ $L expects input arrays of size $(L. traits. sizes[1 ]) .
545
- Recievd array of size $(size (u )) ."""
557
+ Recievd array of size $(size (v )) ."""
546
558
DimensionMismatch (msg) |> throw
547
559
end
548
560
end
@@ -558,7 +570,7 @@ function _sizecheck(L::FunctionOperator, u, v)
558
570
if ! isnothing (v)
559
571
if size (v) != L. traits. sizes[2 ]
560
572
msg = """ $L expects input arrays of size $(L. traits. sizes[1 ]) .
561
- Recievd array of size $(size (u )) ."""
573
+ Recievd array of size $(size (v )) ."""
562
574
DimensionMismatch (msg) |> throw
563
575
end
564
576
end
@@ -618,8 +630,7 @@ function LinearAlgebra.mul!(v::AbstractArray, L::FunctionOperator{true, oop, fal
618
630
619
631
copy! (co, v)
620
632
mul! (v, L, u)
621
- lmul! (α, v)
622
- axpy! (β, co, v)
633
+ axpby! (β, co, α, v)
623
634
end
624
635
625
636
function LinearAlgebra. mul! (v:: AbstractArray , L:: FunctionOperator{true, oop, true} , u:: AbstractArray , α, β) where {oop}
639
650
function LinearAlgebra. ldiv! (L:: FunctionOperator{true} , u:: AbstractArray )
640
651
ci, _ = L. cache
641
652
642
- _sizecheck (L, nothing , u)
643
-
644
653
copy! (ci, u)
645
654
ldiv! (u, L, ci)
646
655
end
0 commit comments