当前位置: 首页>>代码示例>>Python>>正文


Python DisjointUnionEnumeratedSets.__init__方法代码示例

本文整理汇总了Python中sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python DisjointUnionEnumeratedSets.__init__方法的具体用法?Python DisjointUnionEnumeratedSets.__init__怎么用?Python DisjointUnionEnumeratedSets.__init__使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets的用法示例。


在下文中一共展示了DisjointUnionEnumeratedSets.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self, crystals, facade, keepkey, category, **options):
        """
        TESTS::

            sage: C = crystals.Letters(['A',2])
            sage: B = crystals.DirectSum([C,C], keepkey=True)
            sage: B
            Direct sum of the crystals Family (The crystal of letters for type ['A', 2], The crystal of letters for type ['A', 2])
            sage: B.cartan_type()
            ['A', 2]

            sage: from sage.combinat.crystals.direct_sum import DirectSumOfCrystals
            sage: isinstance(B, DirectSumOfCrystals)
            True
        """
        if facade:
            Parent.__init__(self, facade=tuple(crystals), category=category)
        else:
            Parent.__init__(self, category=category)
        DisjointUnionEnumeratedSets.__init__(self, crystals, keepkey=keepkey, facade=facade)
        self.rename("Direct sum of the crystals {}".format(crystals))
        self._keepkey = keepkey
        self.crystals = crystals
        if len(crystals) == 0:
            raise ValueError("The direct sum is empty")
        else:
            assert(crystal.cartan_type() == crystals[0].cartan_type() for crystal in crystals)
            self._cartan_type = crystals[0].cartan_type()
        if keepkey:
            self.module_generators = [ self(tuple([i,b])) for i in range(len(crystals))
                                       for b in crystals[i].module_generators ]
        else:
            self.module_generators = sum( (list(B.module_generators) for B in crystals), [])
开发者ID:Babyll,项目名称:sage,代码行数:35,代码来源:direct_sum.py

示例2: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self, max_entry=None):
        r"""
        Initialize ``self``.

        TESTS::

            sage: CT = CompositionTableaux()
            sage: TestSuite(CT).run()
        """
        self.max_entry = max_entry
        CT_n = lambda n: CompositionTableaux_size(n, max_entry)
        DisjointUnionEnumeratedSets.__init__(self,
                    Family(NonNegativeIntegers(), CT_n),
                    facade=True, keepkey = False)
开发者ID:mcognetta,项目名称:sage,代码行数:16,代码来源:composition_tableau.py

示例3: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self):
        """
        TESTS::

            sage: sum(x**len(t) for t in
            ....:     set(RootedTree(t) for t in OrderedTrees(6)))
            x^5 + x^4 + 3*x^3 + 6*x^2 + 9*x
            sage: sum(x**len(t) for t in RootedTrees(6))
            x^5 + x^4 + 3*x^3 + 6*x^2 + 9*x

            sage: TestSuite(RootedTrees()).run() # long time
        """
        DisjointUnionEnumeratedSets.__init__(
            self, Family(NonNegativeIntegers(), RootedTrees_size),
            facade=True, keepkey=False)
开发者ID:mcognetta,项目名称:sage,代码行数:17,代码来源:rooted_tree.py

示例4: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self, n=None):
        r"""
        EXAMPLES::

            sage: from sage.combinat.baxter_permutations import BaxterPermutations_all
            sage: BaxterPermutations_all()
            Baxter permutations
        """
        self.element_class = Permutations().element_class
        from sage.categories.examples.infinite_enumerated_sets import NonNegativeIntegers
        from sage.sets.family import Family
        DisjointUnionEnumeratedSets.__init__(self,
                                             Family(NonNegativeIntegers(),
                                                    BaxterPermutations_size),
                                             facade=False, keepkey=False)
开发者ID:Findstat,项目名称:sage,代码行数:17,代码来源:baxter_permutations.py

示例5: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self, weight):
        """
        TESTS::

            sage: C = WeightedIntegerVectors([2,1,3])
            sage: C.category()
            Category of facade infinite enumerated sets with grading
            sage: TestSuite(C).run()
        """
        self._weights = weight
        from sage.sets.all import Family, NonNegativeIntegers
        # Use "partial" to make the basis function (with the weights
        # argument specified) pickleable.  Otherwise, it seems to
        # cause problems...
        from functools import partial
        F = Family(NonNegativeIntegers(), partial(WeightedIntegerVectors, weight=weight))
        cat = (SetsWithGrading(), InfiniteEnumeratedSets())
        DisjointUnionEnumeratedSets.__init__(self, F, facade=True, keepkey=False,
                                             category=cat)
开发者ID:mcognetta,项目名称:sage,代码行数:21,代码来源:integer_vector_weighted.py

示例6: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self, crystals, **options):
        """
        TESTS::
        
            sage: C = CrystalOfLetters(['A',2])
            sage: B = DirectSumOfCrystals([C,C], keepkey=True)
            sage: B
            Direct sum of the crystals Family (The crystal of letters for type ['A', 2], The crystal of letters for type ['A', 2])
            sage: B.cartan_type()
            ['A', 2]

            sage: isinstance(B, DirectSumOfCrystals)
            True
        """
        if options.has_key('keepkey'):
            keepkey = options['keepkey']
        else:
            keepkey = False
#        facade = options['facade']
        if keepkey:
            facade = False
        else:
            facade = True
        category = Category.meet([Category.join(crystal.categories()) for crystal in crystals])
        Parent.__init__(self, category = category)
        DisjointUnionEnumeratedSets.__init__(self, crystals, keepkey = keepkey, facade = facade)
        self.rename("Direct sum of the crystals %s"%(crystals,))
        self._keepkey = keepkey
        self.crystals = crystals
        if len(crystals) == 0:
            raise ValueError, "The direct sum is empty"
        else:
            assert(crystal.cartan_type() == crystals[0].cartan_type() for crystal in crystals)
            self._cartan_type = crystals[0].cartan_type()
        if keepkey:
            self.module_generators = [ self(tuple([i,b])) for i in range(len(crystals))
                                       for b in crystals[i].module_generators ]
        else:
            self.module_generators = sum( (list(B.module_generators) for B in crystals), []) 
开发者ID:pombredanne,项目名称:sage-1,代码行数:41,代码来源:direct_sum.py

示例7: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self):
        """
        TESTS::

            sage: from sage.combinat.ordered_tree import OrderedTrees_all
            sage: B = OrderedTrees_all()
            sage: B.cardinality()
            +Infinity

            sage: it = iter(B)
            sage: (next(it), next(it), next(it), next(it), next(it))
            ([], [[]], [[], []], [[[]]], [[], [], []])
            sage: next(it).parent()
            Ordered trees
            sage: B([])
            []

            sage: B is OrderedTrees_all()
            True
            sage: TestSuite(B).run() # long time
            """
        DisjointUnionEnumeratedSets.__init__(
            self, Family(NonNegativeIntegers(), OrderedTrees_size),
            facade=True, keepkey=False)
开发者ID:Findstat,项目名称:sage,代码行数:26,代码来源:ordered_tree.py

示例8: __init__

# 需要导入模块: from sage.sets.disjoint_union_enumerated_sets import DisjointUnionEnumeratedSets [as 别名]
# 或者: from sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets import __init__ [as 别名]
    def __init__(self):
        """
        TESTS::

            sage: from sage.combinat.binary_tree import BinaryTrees_all
            sage: B = BinaryTrees_all()
            sage: B.cardinality()
            +Infinity

            sage: it = iter(B)
            sage: (it.next(), it.next(), it.next(), it.next(), it.next())
            (., [., .], [., [., .]], [[., .], .], [., [., [., .]]])
            sage: it.next().parent()
            Binary trees
            sage: B([])
            [., .]

            sage: B is BinaryTrees_all()
            True
            sage: TestSuite(B).run()
            """
        DisjointUnionEnumeratedSets.__init__(
            self, Family(NonNegativeIntegers(), BinaryTrees_size),
            facade=True, keepkey = False)
开发者ID:biasse,项目名称:sage,代码行数:26,代码来源:binary_tree.py


注:本文中的sage.sets.disjoint_union_enumerated_sets.DisjointUnionEnumeratedSets.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。