Package sage :: Package combinat :: Module combinat :: Class CombinatorialObject
[hide private]
[frames] | no frames]

Class CombinatorialObject

source code

                      object --+    
                               |    
structure.sage_object.SageObject --+
                                   |
                                  CombinatorialObject
Known Subclasses:
ribbon_tableau.MultiSkewTableau_class, skew_tableau.SkewTableau_class, parking_non_decreasing_function.ParkingNonDecreasingFunction, ribbon.Ribbon_class, permutation.Permutation_class, tableau.Tableau_class, partition.Partition_class, composition.Composition_class, dyck_word.DyckWord_class, skew_partition.SkewPartition_class, sf.ns_macdonald.AugmentedLatticeDiagramFilling, sf.ns_macdonald.LatticeDiagram, species.species.GenericSpeciesStructure, crystals.tensor_product.ImmutableListWithParent

Instance Methods [hide private]
 
__init__(self, l)
CombinatorialObject provides a thin wrapper around a list.
source code
 
__str__(self)
EXAMPLES:...
source code
 
__repr__(self)
EXAMPLES:...
source code
 
__eq__(self, other)
EXAMPLES:...
source code
 
__lt__(self, other)
EXAMPLES:...
source code
 
__le__(self, other)
EXAMPLES:...
source code
 
__gt__(self, other)
EXAMPLES:...
source code
 
__ge__(self, other)
EXAMPLES:...
source code
 
__ne__(self, other)
EXAMPLES:...
source code
 
__add__(self, other)
EXAMPLES:...
source code
 
__hash__(self)
Computes the hash of self by computing the hash of the string representation of self._list.
source code
 
__len__(self)
EXAMPLES:...
source code
 
__getitem__(self, key)
EXAMPLES:...
source code
 
__iter__(self)
EXAMPLES:...
source code
 
__contains__(self, item)
EXAMPLES:...
source code
 
index(self, key)
EXAMPLES:...
source code

Inherited from structure.sage_object.SageObject: __new__, _axiom_, _axiom_init_, _gap_, _gap_init_, _gp_, _gp_init_, _interface_, _interface_init_, _interface_is_cached_, _kash_, _kash_init_, _macaulay2_, _macaulay2_init_, _magma_, _magma_init_, _maple_, _maple_init_, _mathematica_, _mathematica_init_, _maxima_, _maxima_init_, _octave_, _octave_init_, _pari_, _pari_init_, _r_init_, _sage_, _singular_, _singular_init_, category, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, l)
(Constructor)

source code 

CombinatorialObject provides a thin wrapper around a list.
The main differences are that __setitem__ is disabled so that
CombinatorialObjects are shallowly immutable, and the intention
is that they are semantically immutable.

Because of this, CombinatorialObjects provide a __hash__
function which computes the hash of the string representation
of a list and the hash of its parent's class.  Thus, each
CombinatorialObject should have a unique string representation.

INPUT:
    l -- a list

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c == loads(dumps(c))
    True
    sage: c._list
    [1, 2, 3]
    sage: c._hash is None
    True

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: str(c)
    '[1, 2, 3]'

Overrides: object.__str__

__repr__(self)
(Representation operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c.__repr__()
    '[1, 2, 3]'

Overrides: structure.sage_object.SageObject.__repr__

__eq__(self, other)
(Equality operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c == [1,2,3]
    True
    sage: c == [2,3,4]
    False
    sage: c == d
    False

__lt__(self, other)
(Less-than operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c < d
    True
    sage: c < [2,3,4]
    True

__le__(self, other)
(Less-than-or-equals operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c <= c
    True
    sage: c <= d
    True
    sage: c <= [1,2,3]
    True

__gt__(self, other)
(Greater-than operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c > c
    False
    sage: c > d
    False
    sage: c > [1,2,3]
    False

__ge__(self, other)
(Greater-than-or-equals operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c >= c
    True
    sage: c >= d
    False
    sage: c >= [1,2,3]
    True

__ne__(self, other)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: d = CombinatorialObject([2,3,4])
    sage: c != c
    False
    sage: c != d
    True
    sage: c != [1,2,3]
    False

__add__(self, other)
(Addition operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c + [4]
    [1, 2, 3, 4]
    sage: type(_)
    <type 'list'>

__hash__(self)
(Hashing function)

source code 

Computes the hash of self by computing the hash of the
string representation of self._list.  The hash is cached
and stored in self._hash.

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c._hash is None
    True
    sage: hash(c) #random
    1335416675971793195
    sage: c._hash #random
    1335416675971793195

Overrides: structure.sage_object.SageObject.__hash__

__len__(self)
(Length operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: len(c)
    3
    sage: c.__len__()
    3

__getitem__(self, key)
(Indexing operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c[0]
    1
    sage: c[1:]
    [2, 3]
    sage: type(_)
    <type 'list'>

__iter__(self)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: list(iter(c))
    [1, 2, 3]

__contains__(self, item)
(In operator)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: 1 in c
    True
    sage: 5 in c
    False

index(self, key)

source code 

EXAMPLES:
    sage: c = CombinatorialObject([1,2,3])
    sage: c.index(1)
    0
    sage: c.index(3)
    2