-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use inplace conversion #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi! Its not clear what the pos!
function does since it is both in place and returns an array.
I add some docs |
Woudn't be better if the function was either pure or in-place with no return. Looking at the use I would say expression = pos_inplace(a / sum(a))
# transfor to
expression .= a / sum(a) # in - place
pos_inplace!(expression) |
added some docs and put it next to the not-in-place version |
We need the return, otherwise we couldn't use it inside other computations |
it's also conventional in Julia (I think for this reason) |
This has some good impact on performance (something like 20% less time)