1 | initial version |
The scipy csr_format
does not support custom datatypes such as Sage polynomials. You should use Sage matrices alone. If you want your matrix to be sparse, you can use
sage: row = [0,0,1]
sage: col = [0,1,1]
sage: data = [1,-1,1]
sage: data_for_sage = {(i,j):v for i,j,v in zip(row,col,data)}
sage: matrix(3, data_for_sage, sparse=True)
[ 1 -1 0]
[ 0 1 0]
[ 0 0 0]
2 | No.2 Revision |
The scipy csr_format
does not support custom datatypes such as Sage polynomials. You should use Sage matrices alone. If you want your matrix to be sparse, you can use
sage: row = [0,0,1]
sage: col = [0,1,1]
sage: data = [1,-1,1]
sage: data_for_sage = {(i,j):v for i,j,v in zip(row,col,data)}
sage: matrix(3, matrix(4, data_for_sage, sparse=True)
[ 1 -1 0]
[ 0 1 0]
[ 0 0 0]