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

Method test_trace

numpy/ma/tests/test_old_ma.py:806–812  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

804 self.d = (x, X, XX, m, mx, mX, mXX)
805
806 def test_trace(self):
807 (x, X, XX, m, mx, mX, mXX,) = self.d
808 mXdiag = mX.diagonal()
809 assert_equal(mX.trace(), mX.diagonal().compressed().sum())
810 assert_(eq(mX.trace(),
811 X.trace() - sum(mXdiag.mask * X.diagonal(),
812 axis=0)))
813
814 def test_clip(self):
815 (x, X, XX, m, mx, mX, mXX,) = self.d

Callers

nothing calls this directly

Calls 7

assert_equalFunction · 0.90
assert_Function · 0.90
eqFunction · 0.85
traceMethod · 0.80
sumFunction · 0.50
sumMethod · 0.45
compressedMethod · 0.45

Tested by

no test coverage detected