MCPcopy
hub / github.com/numpy/numpy / test_comparisons

Method test_comparisons

numpy/matrixlib/tests/test_defmatrix.py:153–175  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

151 assert_almost_equal(x.I, xpinv)
152
153 def test_comparisons(self):
154 A = np.arange(100).reshape(10, 10)
155 mA = matrix(A)
156 mB = matrix(A) + 0.1
157 assert_(np.all(mB == A + 0.1))
158 assert_(np.all(mB == matrix(A + 0.1)))
159 assert_(not np.any(mB == matrix(A - 0.1)))
160 assert_(np.all(mA < mB))
161 assert_(np.all(mA <= mB))
162 assert_(np.all(mA <= mA))
163 assert_(not np.any(mA < mA))
164
165 assert_(not np.any(mB < mA))
166 assert_(np.all(mB >= mA))
167 assert_(np.all(mB >= mB))
168 assert_(not np.any(mB > mB))
169
170 assert_(np.all(mA == mA))
171 assert_(not np.any(mA == mB))
172 assert_(np.all(mB != mA))
173
174 assert_(not np.all(abs(mA) > 0))
175 assert_(np.all(abs(mB > 0)))
176
177 def test_asmatrix(self):
178 A = np.arange(100).reshape(10, 10)

Callers

nothing calls this directly

Calls 5

matrixClass · 0.90
assert_Function · 0.90
reshapeMethod · 0.80
allMethod · 0.45
anyMethod · 0.45

Tested by

no test coverage detected