Elements, Array and Lists With Clone Protocol, demonstration classes¶
This module demonstrate the usage of the various classes defined in
list_clone
-
class
sage.structure.list_clone_demo.
IncreasingArray
¶ Bases:
sage.structure.list_clone.ClonableArray
A small extension class for testing
ClonableArray
.-
check
()¶ Check that
self
is increasing.EXAMPLES:
sage: from sage.structure.list_clone_demo import IncreasingArrays sage: IncreasingArrays()([1,2,3]) # indirect doctest [1, 2, 3] sage: IncreasingArrays()([3,2,1]) # indirect doctest Traceback (most recent call last): ... ValueError: array is not increasing
-
-
class
sage.structure.list_clone_demo.
IncreasingArrays
¶ Bases:
sage.structure.unique_representation.UniqueRepresentation
,sage.structure.parent.Parent
A small (incomplete) parent for testing
ClonableArray
-
Element
¶ alias of
IncreasingArray
-
-
class
sage.structure.list_clone_demo.
IncreasingIntArray
¶ Bases:
sage.structure.list_clone.ClonableIntArray
A small extension class for testing
ClonableIntArray
.-
check
()¶ Check that
self
is increasing.EXAMPLES:
sage: from sage.structure.list_clone_demo import IncreasingIntArrays sage: IncreasingIntArrays()([1,2,3]) # indirect doctest [1, 2, 3] sage: IncreasingIntArrays()([3,2,1]) # indirect doctest Traceback (most recent call last): ... ValueError: array is not increasing
-
-
class
sage.structure.list_clone_demo.
IncreasingIntArrays
¶ Bases:
sage.structure.list_clone_demo.IncreasingArrays
A small (incomplete) parent for testing
ClonableIntArray
-
Element
¶ alias of
IncreasingIntArray
-
-
class
sage.structure.list_clone_demo.
IncreasingList
¶ Bases:
sage.structure.list_clone.ClonableList
A small extension class for testing
ClonableList
-
check
()¶ Check that
self
is increasingEXAMPLES:
sage: from sage.structure.list_clone_demo import IncreasingLists sage: IncreasingLists()([1,2,3]) # indirect doctest [1, 2, 3] sage: IncreasingLists()([3,2,1]) # indirect doctest Traceback (most recent call last): ... ValueError: array is not increasing
-
-
class
sage.structure.list_clone_demo.
IncreasingLists
¶ Bases:
sage.structure.list_clone_demo.IncreasingArrays
A small (incomplete) parent for testing
ClonableList
-
Element
¶ alias of
IncreasingList
-
-
class
sage.structure.list_clone_demo.
SortedList
¶ Bases:
sage.structure.list_clone.NormalizedClonableList
A small extension class for testing
NormalizedClonableList
.-
check
()¶ Check that
self
is strictly increasingEXAMPLES:
sage: from sage.structure.list_clone_demo import SortedList, SortedLists sage: SortedLists()([1,2,3]) # indirect doctest [1, 2, 3] sage: SortedLists()([3,2,2]) # indirect doctest Traceback (most recent call last): ... ValueError: list is not strictly increasing
-
normalize
()¶ Normalize
self
Sort the list stored in
self
.EXAMPLES:
sage: from sage.structure.list_clone_demo import SortedList, SortedLists sage: l = SortedList(SortedLists(), [3,1,2], False, False) sage: l # indirect doctest [1, 2, 3] sage: l[1] = 5; l [1, 5, 3] sage: l.normalize(); l [1, 3, 5]
-
-
class
sage.structure.list_clone_demo.
SortedLists
¶ Bases:
sage.structure.list_clone_demo.IncreasingLists
A small (incomplete) parent for testing
NormalizedClonableList
-
Element
¶ alias of
SortedList
-