def test_matrix_slice(self): a = numpy.ones((10,10), dtype=float) dbl_0 = te.dbl_numpy_mat(a[3:7]) assert dbl_0.shape == (4,10) assert (dbl_0 == 2).all() try: dbl_0 = te.dbl_numpy_mat(a[:, 3:7]) assert False except TypeError: pass
def test_matrix(self): a = numpy.ones((10,10), dtype=float) dbl_0 = te.dbl_numpy_mat(a) assert dbl_0.shape == (10,10) assert (dbl_0 == 2).all() dbl_1 = te.dbl_ublas_mat(a) assert dbl_1.shape == (10,10) assert (dbl_1 == 2).all()