Esempio n. 1
0
    def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
Esempio n. 2
0
    def test_reshape(self):
        d = crh.copy(self.c)
        crh.reshape(d, (4, 5))
        assert_array_equal(crh.todense(d), self.dense[:4, :])

        crh.reshape(d, (5, 5))
        crh.reshape(d)
        assert_array_equal(crh.get_shape(d), (4, 5))
Esempio n. 3
0
    def test_copy(self):
        x = [0, 1]
        c = ConnectedRegion(shape=(1,1), value=1, rowptr=[0, 2], colptr=x)
        d = crh.copy(c)

        assert crh.todense(d) == crh.todense(c)
Esempio n. 4
0
 def test_basic(self):
     assert_array_equal(crh.todense(self.c), self.dense)
     assert_array_equal(crh.todense(crh.copy(self.c)), self.dense)
Esempio n. 5
0
    def test_copy(self):
        x = [0, 1]
        c = ConnectedRegion(shape=(1, 1), value=1, rowptr=[0, 2], colptr=x)
        d = crh.copy(c)

        assert crh.todense(d) == crh.todense(c)
Esempio n. 6
0
 def test_basic(self):
     assert_array_equal(crh.todense(self.c), self.dense)
     assert_array_equal(crh.todense(crh.copy(self.c)), self.dense)