diff --git a/src/sage/combinat/designs/covering_array.py b/src/sage/combinat/designs/covering_array.py index 75e5ae9b10e..d59c2655aa0 100644 --- a/src/sage/combinat/designs/covering_array.py +++ b/src/sage/combinat/designs/covering_array.py @@ -177,6 +177,7 @@ def __init__(self, Array, SymbolSet=None): #number of unique entries. if SymbolSet is None: SymbolSet = list({x for l in Array for x in l}) + SymbolSet.sort() self.__sset=SymbolSet def numrows(self): @@ -230,6 +231,9 @@ def symbolset(self): sage: CA = CoveringArray(C,GF(2)) sage: CA.symbolset() Finite Field of size 2 + sage: CA = CoveringArray(C) + sage: CA.symbolset() + [0, 1] """ return self.__sset @@ -337,6 +341,64 @@ def strength(self): sage: CA = CoveringArray(C,GF(2)) sage: CA.strength() 2 + + + sage: C2 = ((1, 0, 0, 2, 0, 2, 1, 2, 2, 1, 0, 2, 2),\ + (1, 1, 0, 0, 2, 0, 2, 1, 2, 2, 1, 0, 2),\ + (1, 1, 1, 0, 0, 2, 0, 2, 1, 2, 2, 1, 0),\ + (0, 1, 1, 1, 0, 0, 2, 0, 2, 1, 2, 2, 1),\ + (2, 0, 1, 1, 1, 0, 0, 2, 0, 2, 1, 2, 2),\ + (1, 2, 0, 1, 1, 1, 0, 0, 2, 0, 2, 1, 2),\ + (1, 1, 2, 0, 1, 1, 1, 0, 0, 2, 0, 2, 1),\ + (2, 1, 1, 2, 0, 1, 1, 1, 0, 0, 2, 0, 2),\ + (1, 2, 1, 1, 2, 0, 1, 1, 1, 0, 0, 2, 0),\ + (0, 1, 2, 1, 1, 2, 0, 1, 1, 1, 0, 0, 2),\ + (1, 0, 1, 2, 1, 1, 2, 0, 1, 1, 1, 0, 0),\ + (0, 1, 0, 1, 2, 1, 1, 2, 0, 1, 1, 1, 0),\ + (0, 0, 1, 0, 1, 2, 1, 1, 2, 0, 1, 1, 1),\ + (2, 0, 0, 1, 0, 1, 2, 1, 1, 2, 0, 1, 1),\ + (2, 2, 0, 0, 1, 0, 1, 2, 1, 1, 2, 0, 1),\ + (2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