Am I right to assume the copyto! is the problem because it modifies the buffer? Reading the buffers should be fine, right?
What I tried now is to modify the mul! function by introducing an option not to reuse the buffer:
function mul!(
y::StridedVector, A::ToeplitzFactorization, x::StridedVector, α::Number, β::Number; dont_modify_A=false,
)
# ...
if dont_modify_A
tmp = copy(A.tmp)
else
tmp = A.tmp
end
# ...
And then it seems to work correctly. However, I’d rather be sure that it has to work correctly…