Skip to content

Commit

Permalink
Merge pull request #12 from Aaron-Dwyer/coveringarray
Browse files Browse the repository at this point in the history
Made the new relabelling functions in OA more efficient, removed an import of the CA class which no longer exists
  • Loading branch information
aadwyer committed Jul 1, 2023
2 parents 0a1a2f3 + c05d483 commit 941b45d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
3 changes: 0 additions & 3 deletions src/sage/combinat/designs/covering_array.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
Implement various construction methods for CAs
Functions
---------
"""

# **********************************************************************
Expand Down
4 changes: 1 addition & 3 deletions src/sage/combinat/designs/design_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,4 @@
'OAMainFunctions', as_='orthogonal_arrays')

lazy_import('sage.combinat.designs.gen_quadrangles_with_spread',
('generalised_quadrangle_with_spread', 'generalised_quadrangle_hermitian_with_ovoid'))

lazy_import('sage.combinat.designs.covering_array', 'CoveringArray')
('generalised_quadrangle_with_spread', 'generalised_quadrangle_hermitian_with_ovoid'))
14 changes: 4 additions & 10 deletions src/sage/combinat/designs/orthogonal_arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -1554,11 +1554,8 @@ def OA_relabel(OA, k, n, blocks=tuple(), matrix=None, symbol_list=None):
OA = [[matrix[i][j] if j is not None else None for i,j in enumerate(R)] for R in OA]

if symbol_list:
result=[]
the_map = lambda x: symbol_list[x]
for row in OA:
result.append(list(map(the_map,row)))
OA = result
mapping = {index : symbol for index, symbol in enumerate(symbol_list)}
OA = [[mapping.get(element) for element in row] for row in OA]
return OA

def OA_standard_label(OA):
Expand All @@ -1583,11 +1580,8 @@ def OA_standard_label(OA):
"""
symbol_list = sorted({x for l in OA for x in l})
result = []
the_map = lambda x: symbol_list.index(x)
for row in OA:
result.append(list(map(the_map,row)))
return result
mapping = {symbol : index for index, symbol in enumerate(symbol_list)}
return [[mapping.get(element) for element in row] for row in OA]

def OA_n_times_2_pow_c_from_matrix(k,c,G,A,Y,check=True):
r"""
Expand Down

0 comments on commit 941b45d

Please sign in to comment.