Esempio n. 1
0
 def test_infeasible_sig_domain(self):
     x = cl.Variable()
     cons = [x <= -1, x >= 1]
     try:
         dom = SigDomain(1, coniclifts_cons=cons)
         assert False
     except RuntimeError as err:
         err_str = str(err)
         assert 'seem to be infeasible' in err_str
     A = np.ones(shape=(2, 2))
     b = np.array([0, 1])
     K = [cl.Cone('0', 2)]
     try:
         dom = SigDomain(2, AbK=(A, b, K))
         assert False
     except RuntimeError as err:
         err_str = str(err)
         assert 'seem to be infeasible' in err_str
     pass
Esempio n. 2
0
    def test_infeasible_poly_domain(self):
        x = cl.Variable()
        cons = [x <= -1, x >= 1]
        try:
            dom = PolyDomain(1, logspace_cons=cons)
            assert False
        except RuntimeError as err:
            err_str = str(err)
            assert 'seem to be infeasible' in err_str

        A = np.ones(shape=(2, 2))
        b = np.array([0, 1])
        K = [cl.Cone('0', 2)]
        try:
            dom = PolyDomain(2, log_AbK=(A, b, K))
            assert False
        except RuntimeError as err:
            err_str = str(err)
            assert 'seem to be infeasible' in err_str
        self.assertRaises(RuntimeError, PolyDomain, 1, logspace_cons=cons, log_AbK=(A, b, K))