MCPcopy Create free account
hub / github.com/numpy/numpy / test_var_complex_values

Method test_var_complex_values

numpy/core/tests/test_multiarray.py:6293–6301  ·  view source on GitHub ↗
(self, complex_dtype, ndec)

Source from the content-addressed store, hash-verified

6291 ('clongdouble', 7),
6292 ))
6293 def test_var_complex_values(self, complex_dtype, ndec):
6294 # Test fast-paths for every builtin complex type
6295 for axis in [0, 1, None]:
6296 mat = self.cmat.copy().astype(complex_dtype)
6297 msqr = _mean(mat * mat.conj(), axis=axis)
6298 mean = _mean(mat, axis=axis)
6299 tgt = msqr - mean * mean.conjugate()
6300 res = _var(mat, axis=axis)
6301 assert_almost_equal(res, tgt, decimal=ndec)
6302
6303 def test_var_dimensions(self):
6304 # _var paths for complex number introduce additions on views that

Callers

nothing calls this directly

Calls 6

assert_almost_equalFunction · 0.90
astypeMethod · 0.80
conjugateMethod · 0.80
_meanFunction · 0.70
_varFunction · 0.70
copyMethod · 0.45

Tested by

no test coverage detected