@@ -384,6 +384,18 @@ function _cache_self(L::FunctionOperator, u::AbstractArray)
384384 @set! L. cache = (_u, _v)
385385end
386386
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+
387399function Base. show (io:: IO , L:: FunctionOperator )
388400 M, N = size (L)
389401 print (io, " FunctionOperator($M × $N )" )
@@ -542,7 +554,7 @@ function _sizecheck(L::FunctionOperator, u, v)
542554 if ! isnothing (v)
543555 if size (v) != L. traits. sizes[2 ]
544556 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 )) ."""
546558 DimensionMismatch (msg) |> throw
547559 end
548560 end
@@ -558,7 +570,7 @@ function _sizecheck(L::FunctionOperator, u, v)
558570 if ! isnothing (v)
559571 if size (v) != L. traits. sizes[2 ]
560572 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 )) ."""
562574 DimensionMismatch (msg) |> throw
563575 end
564576 end
@@ -618,8 +630,7 @@ function LinearAlgebra.mul!(v::AbstractArray, L::FunctionOperator{true, oop, fal
618630
619631 copy! (co, v)
620632 mul! (v, L, u)
621- lmul! (α, v)
622- axpy! (β, co, v)
633+ axpby! (β, co, α, v)
623634end
624635
625636function LinearAlgebra. mul! (v:: AbstractArray , L:: FunctionOperator{true, oop, true} , u:: AbstractArray , α, β) where {oop}
639650function LinearAlgebra. ldiv! (L:: FunctionOperator{true} , u:: AbstractArray )
640651 ci, _ = L. cache
641652
642- _sizecheck (L, nothing , u)
643-
644653 copy! (ci, u)
645654 ldiv! (u, L, ci)
646655end
0 commit comments