summaryrefslogtreecommitdiff
path: root/numpy/random/_generator.pyx
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-04-04 19:57:55 -0600
committerGitHub <noreply@github.com>2020-04-04 19:57:55 -0600
commit569dfcd79aeb2a584e008861e5e29b7b5115d94e (patch)
tree931c0e7de585caecf890a48c3c11809642ed7e93 /numpy/random/_generator.pyx
parent063b3140ec3792f0420da9f386d8240693213ec9 (diff)
parent72457f01832d10c72a1839aafc178cf4f53449cb (diff)
downloadnumpy-569dfcd79aeb2a584e008861e5e29b7b5115d94e.tar.gz
Merge pull request #15872 from Balandat/fix_eigh_mvn_sampling
BUG: Fix eigh and cholesky methods of numpy.random.multivariate_normal
Diffstat (limited to 'numpy/random/_generator.pyx')
-rw-r--r--numpy/random/_generator.pyx5
1 files changed, 2 insertions, 3 deletions
diff --git a/numpy/random/_generator.pyx b/numpy/random/_generator.pyx
index 7766f8b8c..6b8a2f70b 100644
--- a/numpy/random/_generator.pyx
+++ b/numpy/random/_generator.pyx
@@ -3537,10 +3537,9 @@ cdef class Generator:
# approximately zero or when the covariance is not positive-semidefinite
_factor = u * np.sqrt(abs(s))
else:
- _factor = np.sqrt(s)[:, None] * vh
+ _factor = u * np.sqrt(s)
- x = np.dot(x, _factor)
- x += mean
+ x = mean + x @ _factor.T
x.shape = tuple(final_shape)
return x