def ex2(): print("~~~~~ test 2 ~~~~~") m1 = [Monomial(5, 'x'), Monomial(6, 'y')] c1 = Constraint('LESS', monomials=m1, scalar=5) # 5x 6y < 5 print(c1) print(c1.complement()) # m2 = [Monomial(4, 'x'), Monomial(5, 'y')] c2 = Constraint('LESS', monomials=m2, scalar=4) # 4x 5y < 4 print(c2) print(c2.complement()) # p = ConstraintProperty([c1, c2]) print(p) print(p.complement())
def ex1(): print("~~~~~ test 1 ~~~~~") m = [Monomial(5, 'x'), Monomial(6, 'y')] c = Constraint('LESS', monomials=m, scalar=5) # 5x 6y < 5 print(c) print(c.complement()) # p = ConstraintProperty([c]) print(p) print(p.complement())
def ex3(): print("~~~~~ test 3 ~~~~~") m = [Monomial(-5, 'x'), Monomial(-6, 'y')] c = Constraint('GREATER', monomials=m, scalar=-5) # -5x -6y < -5 print(c) print(c.complement()) # p = ConstraintProperty([c]) print(p) print(p.complement())