Skip to content
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 that cor(x,x) != 1... #17464

Merged
merged 1 commit into from
Jul 25, 2016
Merged

Avoid that cor(x,x) != 1... #17464

merged 1 commit into from
Jul 25, 2016

Conversation

andreasnoack
Copy link
Member

...by trading a sqrt for two / and use clamp to avoid that cor(x,y) > 1.

Make sure that the loop vectorizes

Convert corzm into corm to avoid allocation of tempraries.

Fixes #17420

avoid that cor(x,y) > 1.

Make sure that the loop vectorizes

Convert corzm into corm to avoid allocation of tempraries.
@@ -368,25 +368,6 @@ function corzm(x::AbstractMatrix, vardim::Int=1)
c = unscaled_covzm(x, vardim)
return cov2cor!(c, sqrt!(diag(c)))
end
function corzm(x::AbstractVector, y::AbstractVector)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are packages calling this method? may be safer to deprecate

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. I checked and I've only seen @simonster using it for WIP. It's not exported so deprecating it also a little bit messy.

@andreasnoack
Copy link
Member Author

@tkelman Can this fix be merged?

@tkelman
Copy link
Contributor

tkelman commented Jul 25, 2016

if it's non-breaking and has been reviewed by someone like @simonbyrne or equivalent, I guess

@StefanKarpinski StefanKarpinski added the bug Indicates an unexpected problem or unintended behavior label Jul 25, 2016
@StefanKarpinski StefanKarpinski added this to the 0.5.x milestone Jul 25, 2016
@StefanKarpinski
Copy link
Member

Yeah, this strikes me as a bug fix, so eligible for 0.5 before or after RC.

@simonbyrne
Copy link
Contributor

LGTM.

@simonbyrne simonbyrne merged commit 35f3a77 into master Jul 25, 2016
@simonbyrne simonbyrne deleted the anj/covzm branch July 25, 2016 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants