Exemplo n.º 1
0
    def test_complement(self):
        M1 = sparse.csr_matrix(np.zeros((5, 5)))
        M2 = sparse.csr_matrix(np.ones((5, 5)))

        np.testing.assert_array_equal(
            support.complement(M1, 1).toarray(), np.eye(5))
        np.testing.assert_array_equal(
            support.complement(M1, 5).toarray().flatten(), np.ones(5))

        self.assertEqual(support.complement(M2, 1), None)
Exemplo n.º 2
0
 def select(self):
     return sparse.vstack(
         (self.M_hat, support.complement(self.M_hat, self.grid_size)))
Exemplo n.º 3
0
 def select(self):
     mat = sparse.vstack(
         (self.M_hat, support.complement(self.M_hat, self.grid_size)))
     return matrix.EkteloMatrix(mat)