MCPcopy
hub / github.com/numpy/numpy / test_basic

Method test_basic

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

Source from the content-addressed store, hash-verified

196
197class TestCasting:
198 def test_basic(self):
199 A = np.arange(100).reshape(10, 10)
200 mA = matrix(A)
201
202 mB = mA.copy()
203 O = np.ones((10, 10), np.float64) * 0.1
204 mB = mB + O
205 assert_(mB.dtype.type == np.float64)
206 assert_(np.all(mA != mB))
207 assert_(np.all(mB == mA + 0.1))
208
209 mC = mA.copy()
210 O = np.ones((10, 10), np.complex128)
211 mC = mC * O
212 assert_(mC.dtype.type == np.complex128)
213 assert_(np.all(mA != mB))
214
215
216class 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