Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
fixed old doctests and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivo-Maffei committed Jun 16, 2020
1 parent b0b020a commit 0547de1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/sage/combinat/designs/designs_pyx.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ def is_orthogonal_array(OA, int k, int n, int t=2, int lmbda=1, verbose=False, t
sage: is_orthogonal_array(OA,8,9)
False
sage: is_orthogonal_array(OA,8,9,verbose=True)
Columns 0 and 3 are not orthogonal
In columns 0 and 3 the pair (0,1) appears more than 1 times
False
sage: is_orthogonal_array(OA,8,9,verbose=True,terminology="MOLS")
Squares 0 and 3 are not orthogonal
In columns 0 and 3 the pair (0,1) appears more than once
False
TESTS::
Expand Down Expand Up @@ -144,14 +144,14 @@ def is_orthogonal_array(OA, int k, int n, int t=2, int lmbda=1, verbose=False, t
for l in range(nRows):
#count how many times (C1[l],C2[l]) was seen
l2 = 0
while bitset_in(seen, lmbda*(n*C1[l]+C2[l])+l2):
while l2 < lmbda and bitset_in(seen, lmbda*(n*C1[l]+C2[l])+l2):
l2 +=1
if l2 > lmbda+1: #the pair (C1[l],C2[l]) has already appeared lmbda times
sig_free(OAc)
bitset_free(seen)
if l2 == lmbda: #the pair (C1[l],C2[l]) has already appeared lmbda times
if verbose:
print({"OA" : "In columns {} and {} the pair ({},{}) appears more than {} times".format(i,j,C1[l],C2[l],lmbda),
"MOLS": "In columns {} and {} the pair ({},{}) appears more than once".format(i,j,C1[l],C2[l])}[terminology])
sig_free(OAc)
bitset_free(seen)
return False
#otherwise:
bitset_add(seen,lmbda*(n*C1[l]+C2[l])+l2)
Expand Down
2 changes: 1 addition & 1 deletion src/sage/combinat/designs/latin_squares.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def are_mutually_orthogonal_latin_squares(l, verbose=False):
sage: are_mutually_orthogonal_latin_squares([m2,m3])
True
sage: are_mutually_orthogonal_latin_squares([m1,m2,m3], verbose=True)
Squares 0 and 2 are not orthogonal
In columns 0 and 2 the pair (2,2) appears more than once
False
sage: m = designs.mutually_orthogonal_latin_squares(7,8)
Expand Down

0 comments on commit 0547de1

Please sign in to comment.