Test raising a matrix to an integer power works as expected.
(self)
| 235 | assert_(np.allclose(mA2.A, 3*A)) |
| 236 | |
| 237 | def test_pow(self): |
| 238 | """Test raising a matrix to an integer power works as expected.""" |
| 239 | m = matrix("1. 2.; 3. 4.") |
| 240 | m2 = m.copy() |
| 241 | m2 **= 2 |
| 242 | mi = m.copy() |
| 243 | mi **= -1 |
| 244 | m4 = m2.copy() |
| 245 | m4 **= 2 |
| 246 | assert_array_almost_equal(m2, m**2) |
| 247 | assert_array_almost_equal(m4, np.dot(m2, m2)) |
| 248 | assert_array_almost_equal(np.dot(mi, m), np.eye(2)) |
| 249 | |
| 250 | def test_scalar_type_pow(self): |
| 251 | m = matrix([[1, 2], [3, 4]]) |
nothing calls this directly
no test coverage detected