Skip to content

Fix covariance of zero-observation arrays and corresponding test #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

Merged
merged 2 commits into from
Oct 1, 2018

Conversation

jturner314
Copy link
Member

matrixmultiply (used by ndarray for matrix multiplication) has a bug that results in uninitialized memory being returned if the matrices being multiplied have shapes m × 0 and 0 × n. This PR adds a patch to fix this (bluss/matrixmultiply#21). It also fixes test_covariance_zero_observations to test that all elements are zero.

The dot product should be all zeros, and the `dof` is `0. - (-1.) =
1.`, so all elements in the result should be `0. / 1. = 0.`. This
matches the result from NumPy.
@jturner314 jturner314 mentioned this pull request Sep 30, 2018
@LukeMathWalker LukeMathWalker merged commit 5f12a2e into master Oct 1, 2018
@LukeMathWalker LukeMathWalker deleted the fix-zero-size branch October 1, 2018 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants