예제 #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))
예제 #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))
예제 #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)
예제 #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)
예제 #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)
예제 #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)