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

Method test_basic

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

Source from the content-addressed store, hash-verified

191
192class TestCasting:
193 def test_basic(self):
194 A = np.arange(100).reshape(10, 10)
195 mA = matrix(A)
196
197 mB = mA.copy()
198 O = np.ones((10, 10), np.float64) * 0.1
199 mB = mB + O
200 assert_(mB.dtype.type == np.float64)
201 assert_(np.all(mA != mB))
202 assert_(np.all(mB == mA+0.1))
203
204 mC = mA.copy()
205 O = np.ones((10, 10), np.complex128)
206 mC = mC * O
207 assert_(mC.dtype.type == np.complex128)
208 assert_(np.all(mA != mB))
209
210
211class TestAlgebra:

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected