Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

This should do the job:

def riAj(A,i,j):
    return A.row(i-1)[:j]

def pAi(A,i):
    for j in (1..A.ncols()):
        if riAj(A,i,j) not in span(A.base_ring(),(riAj(A,k,j) for k in (1..i-1))):
            return j
    raise ValueError

This should do the job:

def riAj(A,i,j):
    return A.row(i-1)[:j]

def pAi(A,i):
    for j in (1..A.ncols()):
        if A[0,j-1]!=0 and riAj(A,i,j) not in span(A.base_ring(),(riAj(A,k,j) for k in (1..i-1))):
            return j
    raise ValueError