Skip to content

Improve inference in axpy for non-inferred operator #522

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "ApproxFunBase"
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
version = "0.9.1"
version = "0.9.2"

[deps]
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"
Expand Down
6 changes: 5 additions & 1 deletion src/Operators/Operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,11 @@ const WrapperOperator = Union{SpaceOperator,MultiplicationWrapper,DerivativeWrap
## BLAS and matrix routines
# We assume that copy may be overriden

axpy!(a, X::Operator, Y::AbstractMatrix) = (Y .= a .* AbstractMatrix(X) .+ Y)
function axpy!(a, X::Operator, Y::AbstractMatrix)
Y .+= a .* AbstractMatrix(X)
# the explicit return statement improves type inference
return Y
end
copyto!(dest::AbstractMatrix, src::Operator) = copyto!(dest, AbstractMatrix(src))

# this is for operators that implement copy via axpy!
Expand Down