當前位置: 首頁>>代碼示例>>Python>>正文


Python species.GenericCombinatorialSpecies類代碼示例

本文整理匯總了Python中species.GenericCombinatorialSpecies的典型用法代碼示例。如果您正苦於以下問題:Python GenericCombinatorialSpecies類的具體用法?Python GenericCombinatorialSpecies怎麽用?Python GenericCombinatorialSpecies使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了GenericCombinatorialSpecies類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

    def __init__(self, F, G, min=None, max=None, weight=None):
        """
        EXAMPLES::

            sage: X = species.SingletonSpecies()
            sage: A = X*X
            sage: A.generating_series().coefficients(4)
            [0, 0, 1, 0]

            sage: P = species.PermutationSpecies()
            sage: F = P * P; F
            Product of (Permutation species) and (Permutation species)
            sage: F == loads(dumps(F))
            True
            sage: F._check()
            True

        TESTS::

            sage: X = species.SingletonSpecies()
            sage: X*X is X*X
            True
        """
        self._F = F
        self._G = G
        self._state_info = [F, G]
        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=weight)
開發者ID:Babyll,項目名稱:sage,代碼行數:27,代碼來源:product_species.py

示例2: __init__

    def __init__(self, min=None, max=None, weight=None):
        """
        Returns the species of cycles.

        EXAMPLES::

            sage: C = species.CycleSpecies(); C
            Cyclic permutation species
            sage: C.structures([1,2,3,4]).list()
            [(1, 2, 3, 4),
             (1, 2, 4, 3),
             (1, 3, 2, 4),
             (1, 3, 4, 2),
             (1, 4, 2, 3),
             (1, 4, 3, 2)]

        TESTS: We check to verify that the caching of species is actually
        working.

        ::

            sage: species.CycleSpecies() is species.CycleSpecies()
            True

            sage: P = species.CycleSpecies()
            sage: c = P.generating_series().coefficients(3)
            sage: P._check()
            True
            sage: P == loads(dumps(P))
            True
        """
        GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=weight)
        self._name = "Cyclic permutation species"
開發者ID:BlairArchibald,項目名稱:sage,代碼行數:33,代碼來源:cycle_species.py

示例3: __init__

    def __init__(self, F, G, min=None, max=None, weight=None):
        """
        Returns the sum of two species.

        EXAMPLES::

            sage: S = species.PermutationSpecies()
            sage: A = S+S
            sage: A.generating_series().coefficients(5)
            [2, 2, 2, 2, 2]

            sage: P = species.PermutationSpecies()
            sage: F = P + P
            sage: F._check()
            True
            sage: F == loads(dumps(F))
            True

        TESTS::

            sage: A = species.SingletonSpecies() + species.SingletonSpecies()
            sage: B = species.SingletonSpecies() + species.SingletonSpecies()
            sage: C = species.SingletonSpecies() + species.SingletonSpecies(min=2)
            sage: A is B
            True
            sage: (A is C) or (A == C)
            False
        """
        self._F = F
        self._G = G

        self._state_info = [F, G]

        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=None)
開發者ID:BlairArchibald,項目名稱:sage,代碼行數:34,代碼來源:sum_species.py

示例4: __init__

    def __init__(self, F, G, min=None, max=None, weight=None):
        """
        Returns the composition of two species.

        EXAMPLES::

            sage: E = species.SetSpecies()
            sage: C = species.CycleSpecies()
            sage: S = E(C)
            sage: S.generating_series().coefficients(5)
            [1, 1, 1, 1, 1]
            sage: E(C) is S
            True

        TESTS::

            sage: E = species.SetSpecies(); C = species.CycleSpecies()
            sage: L = E(C)
            sage: c = L.generating_series().coefficients(3)
            sage: L._check() #False due to isomorphism types not being implemented
            False
            sage: L == loads(dumps(L))
            True
        """
        self._F = F
        self._G = G
        self._name = "Composition of (%s) and (%s)"%(F, G)
        self._state_info = [F, G]
        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=None)
開發者ID:Babyll,項目名稱:sage,代碼行數:29,代碼來源:composition_species.py

示例5: __init__

    def __init__(self, F, G, min=None, max=None, weight=None):
        """
        Returns the functorial composition of two species.

        EXAMPLES::

            sage: E = species.SetSpecies()
            sage: E2 = species.SetSpecies(size=2)
            sage: WP = species.SubsetSpecies()
            sage: P2 = E2*E
            sage: G = WP.functorial_composition(P2)
            sage: G.isotype_generating_series().coefficients(5)
            [1, 1, 2, 4, 11]

            sage: G = species.SimpleGraphSpecies()
            sage: c = G.generating_series().coefficients(2)
            sage: type(G)
            <class 'sage.combinat.species.functorial_composition_species.FunctorialCompositionSpecies'>
            sage: G == loads(dumps(G))
            True
            sage: G._check() #False due to isomorphism types not being implemented
            False
        """
        self._F = F
        self._G = G
        self._state_info = [F, G]
        self._name = "Functorial composition of (%s) and (%s)"%(F, G)
        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=None)
開發者ID:Babyll,項目名稱:sage,代碼行數:28,代碼來源:functorial_composition_species.py

示例6: __init__

 def __init__(self, min=None, max=None, weight=None):
     """
     EXAMPLES::
     
         sage: P = species.PartitionSpecies()
         sage: P._check()
         True
         sage: P == loads(dumps(P))
         True
     """
     GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=weight)
     self._name = "Partition species"
開發者ID:bgxcpku,項目名稱:sagelib,代碼行數:12,代碼來源:partition_species.py

示例7: __init__

 def __init__(self, min=None, max=None, weight=None):
     """
     EXAMPLES::
     
         sage: L = species.LinearOrderSpecies()
         sage: L._check()
         True
         sage: L == loads(dumps(L))
         True
     """
     GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=None)
     self._name = "Linear order species"
開發者ID:pombredanne,項目名稱:sage-1,代碼行數:12,代碼來源:linear_order_species.py

示例8: __init__

    def __init__(self, min=None, max=None, weight=None):
        """
        EXAMPLES::

            sage: P = species.PermutationSpecies()
            sage: c = P.generating_series().coefficients(3)
            sage: P._check()
            True
            sage: P == loads(dumps(P))
            True
        """
        GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=weight)
        self._name = "Permutation species"
開發者ID:sageb0t,項目名稱:testsage,代碼行數:13,代碼來源:permutation_species.py

示例9: __init__

    def __init__(self, min=None, max=None, weight=None):
        """
        EXAMPLES::

            sage: S = species.SubsetSpecies()
            sage: c = S.generating_series().coefficients(3)
            sage: S._check()
            True
            sage: S == loads(dumps(S))
            True
        """
        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=None)
        self._name = "Subset species"
開發者ID:sageb0t,項目名稱:testsage,代碼行數:13,代碼來源:subset_species.py

示例10: __init__

    def __init__(self, n, min=None, max=None, weight=None):
        """
        EXAMPLES::

            sage: F = species.CharacteristicSpecies(3)
            sage: c = F.generating_series().coefficients(4)
            sage: F._check()
            True
            sage: F == loads(dumps(F))
            True
        """
        self._n = n
        self._name = "Characteristic species of order %s"%n
        self._state_info = [n]
        GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=weight)
開發者ID:sageb0t,項目名稱:testsage,代碼行數:15,代碼來源:characteristic_species.py

示例11: __init__

    def __init__(self, min=None, max=None, weight=None):
        """
        Initializer for the empty species.

        EXAMPLES::

            sage: F = species.EmptySpecies()
            sage: F._check()
            True
            sage: F == loads(dumps(F))
            True
        """
        # There is no structure at all, so we set min and max accordingly.
        GenericCombinatorialSpecies.__init__(self, weight=weight)
        self._name = "Empty species"
開發者ID:Babyll,項目名稱:sage,代碼行數:15,代碼來源:empty_species.py

示例12: __init__

 def __init__(self, F, G, min=None, max=None, weight=None):
     """
     EXAMPLES::
     
         sage: P = species.PermutationSpecies()
         sage: F = P * P; F
         Product of (Permutation species) and (Permutation species)
         sage: F == loads(dumps(F))
         True
         sage: F._check()
         True
     """
     self._F = F
     self._G = G
     self._state_info = [F, G]
     GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=weight)
開發者ID:bgxcpku,項目名稱:sagelib,代碼行數:16,代碼來源:product_species.py

示例13: __init__

    def __init__(self, F, G, min=None, max=None, weight=None):
        """
        EXAMPLES::

            sage: G = species.SimpleGraphSpecies()
            sage: c = G.generating_series().coefficients(2)
            sage: type(G)
            <class 'sage.combinat.species.functorial_composition_species.FunctorialCompositionSpecies_class'>
            sage: G == loads(dumps(G))
            True
            sage: G._check() #False due to isomorphism types not being implemented
            False
        """
        self._F = F
        self._G = G
        self._state_info = [F, G]
        self._name = "Functorial composition of (%s) and (%s)"%(F, G)
        GenericCombinatorialSpecies.__init__(self, min=None, max=None, weight=None)
開發者ID:sageb0t,項目名稱:testsage,代碼行數:18,代碼來源:functorial_composition_species.py

示例14: __init__

    def __init__(self, min=None, max=None, weight=None):
        """
        Returns the species of linear orders.

        EXAMPLES::

            sage: L = species.LinearOrderSpecies()
            sage: L.generating_series().coefficients(5)
            [1, 1, 1, 1, 1]

            sage: L = species.LinearOrderSpecies()
            sage: L._check()
            True
            sage: L == loads(dumps(L))
            True
        """
        GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=None)
        self._name = "Linear order species"
開發者ID:Babyll,項目名稱:sage,代碼行數:18,代碼來源:linear_order_species.py

示例15: __init__

    def __init__(self, n, min=None, max=None, weight=None):
        """
        Returns the characteristic species of order `n`.

        This species has exactly one structure on a set of of size `n`
        and no structures of on sets of any other size.

        EXAMPLES::

            sage: X = species.CharacteristicSpecies(1)
            sage: X.structures([1]).list()
            [1]
            sage: X.structures([1,2]).list()
            []
            sage: X.generating_series().coefficients(4)
            [0, 1, 0, 0]
            sage: X.isotype_generating_series().coefficients(4)
            [0, 1, 0, 0]
            sage: X.cycle_index_series().coefficients(4)
            [0, p[1], 0, 0]

            sage: F = species.CharacteristicSpecies(3)
            sage: c = F.generating_series().coefficients(4)
            sage: F._check()
            True
            sage: F == loads(dumps(F))
            True

        TESTS::

            sage: S1 = species.CharacteristicSpecies(1)
            sage: S2 = species.CharacteristicSpecies(1)
            sage: S3 = species.CharacteristicSpecies(2)
            sage: S4 = species.CharacteristicSpecies(2, weight=2)
            sage: S1 is S2
            True
            sage: S1 == S3
            False
        """
        self._n = n
        self._name = "Characteristic species of order %s"%n
        self._state_info = [n]
        GenericCombinatorialSpecies.__init__(self, min=min, max=max, weight=weight)
開發者ID:Babyll,項目名稱:sage,代碼行數:43,代碼來源:characteristic_species.py


注:本文中的species.GenericCombinatorialSpecies類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。