Package sage :: Package combinat :: Package crystals :: Module tensor_product :: Class ImmutableListWithParent
[hide private]
[frames] | no frames]

Class ImmutableListWithParent

source code

                      object --+        
                               |        
structure.sage_object.SageObject --+    
                                   |    
        combinat.CombinatorialObject --+
                                       |
                      object --+       |
                               |       |
structure.sage_object.SageObject --+   |
                                   |   |
           structure.element.Element --+
                                       |
                                      ImmutableListWithParent
Known Subclasses:
TensorProductOfCrystalsElement


A class for lists having a parent

Specification: any subclass C should implement __init__ which accepts the following 
form C(parent, list = list)

EXAMPLES:
We create an immutable list whose parent is the class list:    
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: l._list 
    [1, 2, 3]
    sage: l.parent()
    <type 'list'>
    sage: l.sibling([2,1]) == ImmutableListWithParent(list, [2,1])
    True
    sage: l.reversed()
    [3, 2, 1]
    sage: l.set_index(1,4)
    [1, 4, 3]



Instance Methods [hide private]
 
__init__(self, parent, list)
EXAMPLES:...
source code
 
parent(self)
EXAMPLES:...
source code
 
__repr__(self)
EXAMPLES:...
source code
 
__eq__(self, other)
EXAMPLES:...
source code
 
sibling(self, l)
Returns an ImmutableListWithParent object whose list is l and whose parent is the same as self's parent.
source code
 
reversed(self)
Returns the sibling of self which is obtained by reversing the elements of self.
source code
 
set_index(self, k, value)
Returns the sibling of self obtained by setting the $k^{th}$ entry of self to value.
source code

Inherited from combinat.CombinatorialObject: __add__, __contains__, __ge__, __getitem__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __ne__, __str__, index

Inherited from structure.element.Element: __cmp__, __new__, __nonzero__, __reduce__, __rxor__, __xor__, _cmp_, _im_gens_, _repr_, _richcmp_, base_base_extend, base_base_extend_canonical_sym, base_extend, base_extend_canonical, base_extend_canonical_sym, base_extend_recursive, base_ring, category, is_zero, n, subs, substitute

Inherited from structure.sage_object.SageObject: _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_, db, dump, dumps, plot, rename, reset_name, save, version

Inherited from object: __delattr__, __getattribute__, __reduce_ex__, __setattr__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parent, list)
(Constructor)

source code 

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: l == loads(dumps(l))
    True

Overrides: combinat.CombinatorialObject.__init__

parent(self)

source code 

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: l.parent()
    <type 'list'>

Overrides: structure.element.Element.parent

__repr__(self)
(Representation operator)

source code 

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: l.__repr__()
    '[1, 2, 3]'

Overrides: combinat.CombinatorialObject.__repr__

__eq__(self, other)
(Equality operator)

source code 

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: m = ImmutableListWithParent(ZZ, [1,2,3])
    sage: n = ImmutableListWithParent(ZZ, [2,3,4])
    sage: l == l
    True
    sage: l == m
    False
    sage: m == n
    False

Overrides: combinat.CombinatorialObject.__eq__

sibling(self, l)

source code 

Returns an ImmutableListWithParent object whose list is l and
whose parent is the same as self's parent.

Note that the implementation of this function makes an assumption
about the constructor for subclasses.

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: m = l.sibling([2,3,4]); m
    [2, 3, 4]
    sage: m.parent()
    <type 'list'>
   

reversed(self)

source code 

Returns the sibling of self which is obtained by reversing
the elements of self.

EXAMPLES:
   sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
   sage: l = ImmutableListWithParent(list, [1,2,3])
   sage: l.reversed()
   [3, 2, 1]

set_index(self, k, value)

source code 

Returns the sibling of self obtained by setting the $k^{th}$
entry of self to value.

EXAMPLES:
    sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent
    sage: l = ImmutableListWithParent(list, [1,2,3])
    sage: l.set_index(0,2)
    [2, 2, 3]
    sage: l.set_index(1,4)
    [1, 4, 3]
    sage: _.parent()
    <type 'list'>