Cython functions for combinatorial designs
This module implements the design methods that need to be somewhat efficient.
Check that the integer matrix is an
.
See orthogonal_array() for a definition.
INPUT:
EXAMPLES:
sage: from sage.combinat.designs.designs_pyx import is_orthogonal_array
sage: OA = designs.orthogonal_array(8,9)
sage: is_orthogonal_array(OA,8,9)
True
sage: is_orthogonal_array(OA,8,10)
False
sage: OA[4][3] = 1
sage: is_orthogonal_array(OA,8,9)
False
sage: is_orthogonal_array(OA,8,9,verbose=True)
Columns 0 and 3 are not orthogonal
False
sage: is_orthogonal_array(OA,8,9,verbose=True,terminology="MOLS")
Squares 0 and 3 are not orthogonal
False
TESTS:
sage: is_orthogonal_array(OA,8,9,t=3)
Traceback (most recent call last):
...
NotImplementedError: only implemented for t=2
sage: is_orthogonal_array([[3]*8],8,9,verbose=True)
The number of rows is 1 instead of 9^2=81
False
sage: is_orthogonal_array([[3]*8],8,9,verbose=True,terminology="MOLS")
All squares do not have dimension n^2=9^2
False
sage: is_orthogonal_array([[3]*7],8,9,verbose=True)
Some row does not have length 8
False
sage: is_orthogonal_array([[3]*7],8,9,verbose=True,terminology="MOLS")
The number of squares is not 6
False
Up to relabelling, there is a unique . So their number is just the
cardinality of the relabeling group which is
and has
cardinality
:
sage: from itertools import product
sage: n = 0
sage: for a in product(product((0,1), repeat=3), repeat=4):
....: if is_orthogonal_array(a,3,2):
....: n += 1
sage: n
48