Hello group, 

I think this is probably an embarrassing bug:

def IncidenceStructureFromMatrix(M, name=None):
    """
    Builds and incidence structure from a matrix.

    INPUT:

    - ``M`` -- a binary matrix. Creates a set of "points" from the rows and a
      set of "blocks" from the columns.

    EXAMPLES::

        sage: from sage.combinat.designs.block_design import BlockDesign
        sage: BD1 = 
BlockDesign(7,[[0,1,2],[0,3,4],[0,5,6],[1,3,5],[1,4,6],[2,3,6],[2,4,5]])
        sage: M = BD1.incidence_matrix()
        sage: BD2 = IncidenceStructureFromMatrix(M)
        sage: BD1 == BD2
        True
    """
    nm = name
    v = len(M.rows())
    b = len(M.columns())
    #points = range(v)
    blocks = []
    for i in range(b):
        B = []
        for j in range(v):
            if M[i, j] != 0:
                B.append(j)
        blocks.append(B)
    return IncidenceStructure(range(v), blocks, name=nm)


The problem is with the indexing "if M[i, j] != 0". Of course, this will not be 
a problem for square 2-designs like the Hadamard design or 
ProjectivePlaneDesign (thanks to Fisher Type counting), but this should cause 
problem for designs that are not square. I was bitten by this bug when I tried 
to implement Hadamard 3-design from a Hadamard matrix. 

I will open a ticket if somebody does a sanity check for me. 

With Sincere Regards, 
Kannappan. 
 

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to