Exemplo n.º 1
0
    def test_any(self):

        v = BlockVector(2)
        a = np.zeros(5)
        b = np.ones(3)
        v.set_block(0, a)
        v.set_block(1, b)
        self.assertTrue(v.any())

        v = BlockVector(2)
        a = np.zeros(5)
        b = np.zeros(3)
        v.set_block(0, a)
        v.set_block(1, b)
        self.assertFalse(v.any())
Exemplo n.º 2
0
    def test_any(self):

        v = BlockVector(2)
        a = np.zeros(5)
        b = np.ones(3)
        v[0] = a
        v[1] = b
        self.assertTrue(v.any())

        v = BlockVector(2)
        a = np.zeros(5)
        b = np.zeros(3)
        v[0] = a
        v[1] = b
        self.assertFalse(v.any())