(self)
| 196 | |
| 197 | class 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 | |
| 216 | class TestAlgebra: |