예제 #1
0
    def __init__(self, parent, labels, pi, f, gs):
        """
        TESTS::

            sage: E = species.SetSpecies(); C = species.CycleSpecies()
            sage: L = E(C)
            sage: a = L.structures(['a','b','c']).random_element()
            sage: a == loads(dumps(a))
            True
        """
        self._partition = pi
        GenericSpeciesStructure.__init__(self, parent, labels, [f, gs])
예제 #2
0
 def __init__(self, parent, labels, subset, left, right):
     """
     TESTS::
     
         sage: S = species.SetSpecies()
         sage: F = S * S
         sage: a = F.structures(['a','b','c']).random_element()
         sage: a == loads(dumps(a))
         True
     """
     self._subset = subset
     GenericSpeciesStructure.__init__(self, parent, labels, [left, right])
예제 #3
0
    def __init__(self, parent, labels, pi, f, gs):
        """
        TESTS::

            sage: E = species.SetSpecies(); C = species.CycleSpecies()
            sage: L = E(C)
            sage: a = L.structures(['a','b','c']).random_element()
            sage: a == loads(dumps(a))
            True
        """
        self._partition = pi
        GenericSpeciesStructure.__init__(self, parent, labels, [f, gs])
예제 #4
0
 def __init__(self, parent, labels, subset, left, right):
     """
     TESTS::
     
         sage: S = species.SetSpecies()
         sage: F = S * S
         sage: a = F.structures(['a','b','c']).random_element()
         sage: a == loads(dumps(a))
         True
     """
     self._subset = subset
     GenericSpeciesStructure.__init__(self, parent, labels, [left, right])
예제 #5
0
 def __init__(self, parent, labels, list):
     """
     EXAMPLES::
     
         sage: from sage.combinat.species.partition_species import PartitionSpeciesStructure
         sage: P = species.PartitionSpecies()
         sage: s = PartitionSpeciesStructure(P, ['a','b','c'], [[1,2],[3]]); s
         {{'a', 'b'}, {'c'}}
         sage: s == loads(dumps(s))
         True
     """
     list = [SubsetSpeciesStructure(parent, labels, block) if not isinstance(block, SubsetSpeciesStructure) else block for block in list]
     list.sort(key=lambda block:(-len(block), block))
     GenericSpeciesStructure.__init__(self, parent, labels, list)
예제 #6
0
    def __init__(self, parent, labels, list):
        """
        EXAMPLES::

            sage: from sage.combinat.species.partition_species import PartitionSpeciesStructure
            sage: P = species.PartitionSpecies()
            sage: s = PartitionSpeciesStructure(P, ['a','b','c'], [[1,2],[3]]); s
            {{'a', 'b'}, {'c'}}
            sage: s == loads(dumps(s))
            True
        """
        list = [SubsetSpeciesStructure(parent, labels, block) if not isinstance(block, SubsetSpeciesStructure) else block for block in list]
        list.sort(key=lambda block:(-len(block), block))
        GenericSpeciesStructure.__init__(self, parent, labels, list)