(self)
| 7268 | assert_almost_equal(res, tgt, decimal=ndec) |
| 7269 | |
| 7270 | def test_var_dimensions(self): |
| 7271 | # _var paths for complex number introduce additions on views that |
| 7272 | # increase dimensions. Ensure this generalizes to higher dims |
| 7273 | _, cmat, _ = self._create_data() |
| 7274 | mat = np.stack([cmat] * 3) |
| 7275 | for axis in [0, 1, 2, -1, None]: |
| 7276 | msqr = _mean(mat * mat.conj(), axis=axis) |
| 7277 | mean = _mean(mat, axis=axis) |
| 7278 | tgt = msqr - mean * mean.conjugate() |
| 7279 | res = _var(mat, axis=axis) |
| 7280 | assert_almost_equal(res, tgt) |
| 7281 | |
| 7282 | def test_var_complex_byteorder(self): |
| 7283 | # Test that var fast-path does not cause failures for complex arrays |
nothing calls this directly
no test coverage detected