MCPcopy Index your code
hub / github.com/numpy/numpy / test_dot

Method test_dot

numpy/ma/tests/test_core.py:4244–4266  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4242 assert_equal(arr.trace(axis1=1, axis2=2), m_arr.trace(axis1=1, axis2=2))
4243
4244 def test_dot(self):
4245 # Tests dot on MaskedArrays.
4246 _, _, _, _, mx, mX, mXX, _, _, _ = self._create_data()
4247 fx = mx.filled(0)
4248 r = mx.dot(mx)
4249 assert_almost_equal(r.filled(0), fx.dot(fx))
4250 assert_(r.mask is nomask)
4251
4252 fX = mX.filled(0)
4253 r = mX.dot(mX)
4254 assert_almost_equal(r.filled(0), fX.dot(fX))
4255 assert_(r.mask[1, 3])
4256 r1 = empty_like(r)
4257 mX.dot(mX, out=r1)
4258 assert_almost_equal(r, r1)
4259
4260 mYY = mXX.swapaxes(-1, -2)
4261 fXX, fYY = mXX.filled(0), mYY.filled(0)
4262 r = mXX.dot(mYY)
4263 assert_almost_equal(r.filled(0), fXX.dot(fYY))
4264 r1 = empty_like(r)
4265 mXX.dot(mYY, out=r1)
4266 assert_almost_equal(r, r1)
4267
4268 def test_dot_shape_mismatch(self):
4269 # regression test

Callers

nothing calls this directly

Calls 6

_create_dataMethod · 0.95
assert_almost_equalFunction · 0.90
empty_likeFunction · 0.90
assert_Function · 0.85
dotMethod · 0.80
filledMethod · 0.45

Tested by

no test coverage detected