Skip to content

Commit

Permalink
Merge pull request #1 from brettpim/covering_array_two
Browse files Browse the repository at this point in the history
added two doctests:
  • Loading branch information
Aaron-Dwyer committed Mar 1, 2023
2 parents 939da41 + d5940d7 commit 5e23de2
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions src/sage/combinat/designs/covering_array.py
Expand Up @@ -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):
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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,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, 0, 1, 2, 2, 1, 2, 0, 2, 0, 0, 1, 1),\
(2, 2, 0, 1, 2, 2, 1, 2, 0, 2, 0, 0, 1),\
(2, 2, 2, 0, 1, 2, 2, 1, 2, 0, 2, 0, 0),\
(0, 2, 2, 2, 0, 1, 2, 2, 1, 2, 0, 2, 0),\
(0, 0, 2, 2, 2, 0, 1, 2, 2, 1, 2, 0, 2),\
(1, 0, 0, 2, 2, 2, 0, 1, 2, 2, 1, 2, 0),\
(0, 1, 0, 0, 2, 2, 2, 0, 1, 2, 2, 1, 2),\
(1, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2, 2, 1),\
(2, 1, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2, 2),\
(1, 2, 1, 0, 1, 0, 0, 2, 2, 2, 0, 1, 2),\
(1, 1, 2, 1, 0, 1, 0, 0, 2, 2, 2, 0, 1),\
(2, 1, 1, 2, 1, 0, 1, 0, 0, 2, 2, 2, 0),\
(0, 2, 1, 1, 2, 1, 0, 1, 0, 0, 2, 2, 2),\
(1, 0, 2, 1, 1, 2, 1, 0, 1, 0, 0, 2, 2),\
(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0))
sage: CA2 = CoveringArray(C2,GF(3))
sage: CA2.strength()
3
"""
finished=False
strength=1
Expand Down

0 comments on commit 5e23de2

Please sign in to comment.