コード例 #1
0
 def atest_pow(self):
     Relation.setA(1, 2, 3)
     r1 = Relation((1, 2), (2, 3))
     r3 = r1**-1
     r3.showSet()
     r3.showMatrix()
     r3.showGraph()
コード例 #2
0
 def atest_sub(self):
     Relation.setA(1, 2, 3)
     r1 = Relation((1, 2), (2, 3), (1, 3), (2, 1), (3, 2), (3, 1),
                   name='relation')
     r2 = Relation((1, 2), (2, 3), (1, 3))
     r3 = r1 - r2
     r3.showSet()
     r3.showMatrix()
     r3.showGraph()
コード例 #3
0
 def test_closure(self):
     Relation.setA(1, 2, 3, 4, 5, 6, 7, 8, 9)
     r1 = Relation((1, 2), (2, 3), (4, 5), (5, 6), (6, 7))
     r2 = r1.reflectiveClosure()
     r2.showSet()
     r3 = r2.symmetricClosure()
     r3.showSet()
     r4 = r3.transitiveClosure()
     r4.showSet()
     r4.showGraph()
コード例 #4
0
 def atest_Relation(self):
     Relation.setA(1, 2, 3)
     r1 = Relation((1, 2), (2, 3), (1, 3), (2, 1), (3, 2), (3, 1),
                   name='relation')
     #Relation.setA('a','b','c')
     #r1 = Relation(('a','b'),('a','c'),name ='first')
     #r1 = Relation(name ='first')
     r1.showSet()
     r1.showMatrix()
     r1.showGraph()
コード例 #5
0
 def atest_intersection(self):
     Relation.setA(1, 2, 3)
     r1 = Relation((1, 2), (2, 3))
     r2 = Relation((1, 2))
     r3 = r1.intersect(r2)
     r3.showSet()
     r3.showMatrix()
     r3.showGraph()
コード例 #6
0
 def atest_identity(self):
     Relation.setA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
     r1 = Relation.getIdentity()
     r1.showSet()
     r1.showMatrix()
     r1.showGraph()
コード例 #7
0
 def atest_universal(self):
     Relation.setA(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
     r1 = Relation.getUniversal()
     r1.showSet()
     r1.showMatrix()
     r1.showGraph()