Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

In a compact form:

signs = ['=','=','>=','>=','>=','<=','<=','<=','<=','<=']
shift = [sum(len(signs[i]) for i in range(j)) for j in range(len(signs))]
Matrix(ZZ, 10, 18, lambda i,j: 0 if j<shift[i] or j>shift[i]+1 else -1 if j==shift[i] and signs[i]=='>=' else 0 if j==shift[i]+1 and signs[i]=='=' else 1)