本文整理汇总了Python中graphillion.GraphSet.blocking方法的典型用法代码示例。如果您正苦于以下问题:Python GraphSet.blocking方法的具体用法?Python GraphSet.blocking怎么用?Python GraphSet.blocking使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类graphillion.GraphSet
的用法示例。
在下文中一共展示了GraphSet.blocking方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_unary_operators
# 需要导入模块: from graphillion import GraphSet [as 别名]
# 或者: from graphillion.GraphSet import blocking [as 别名]
def test_unary_operators(self):
gs = GraphSet([g0, g1, g12, g123, g1234, g134, g14, g4])
self.assertTrue(isinstance(~gs, GraphSet))
self.assertEqual(~gs, GraphSet([g124, g13, g2, g23, g234, g24, g3, g34]))
self.assertTrue(isinstance(gs.smaller(3), GraphSet))
self.assertEqual(gs.smaller(3), GraphSet([g0, g1, g12, g14, g4]))
self.assertTrue(isinstance(gs.larger(3), GraphSet))
self.assertEqual(gs.larger(3), GraphSet([g1234]))
self.assertTrue(isinstance(gs.graph_size(3), GraphSet))
self.assertEqual(gs.graph_size(3), GraphSet([g123, g134]))
self.assertTrue(isinstance(gs.len(3), GraphSet))
self.assertEqual(gs.len(3), GraphSet([g123, g134]))
gs = GraphSet([g12, g123, g234])
self.assertTrue(isinstance(gs.minimal(), GraphSet))
self.assertEqual(gs.minimal(), GraphSet([g12, g234]))
self.assertTrue(isinstance(gs.maximal(), GraphSet))
self.assertEqual(gs.maximal(), GraphSet([g123, g234]))
gs = GraphSet([g12, g14, g23, g34])
self.assertTrue(isinstance(gs.blocking(), GraphSet))
self.assertEqual(
gs.blocking(), GraphSet([g123, g1234, g124, g13, g134, g234, g24]))