-
Notifications
You must be signed in to change notification settings - Fork 11
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
Avoid \ for non-allocating #20
Comments
for i = 1:2*p
w .+= (A - t[i]*I) \ (a[i] * vec)
end Here Note that |
Well two things here. One Next I think |
I tried this yesterday:
and the number of allocations is basically reduced by a factor 2. I thought |
Then I would just get it to w .+= real( tmp_v ) you'll want that as w .+= real.( tmp_v ) or @. w == real(tmp_v) |
|
When trying to avoid allocations, note that
\
actually allocates. You will instead want to useA_ldiv_B!
for the non-allocating form.The text was updated successfully, but these errors were encountered: