1 | initial version |
I tried to do this a while ago but couldn't do it in one step. I just went through all the columns and got their maximum.
Example for a matrix M with type 'sage.matrix.matrix_real_double_dense.Matrix_real_double_dense'
MAX_val=0
for i in range(len(M.columns())):
if (MAX_val< max(M.column(i))):
MAX_val=max(M.column(i))
MAX_val is then the maximum value in the matrix. I hope it was helpful. I ll follow to see if there is a better way.
2 | No.2 Revision |
I tried to do this a while ago but couldn't do it in one step. I just went through all the columns and got their maximum. I also needed to find the location of the maximum.
Example for a matrix M with type 'sage.matrix.matrix_real_double_dense.Matrix_real_double_dense'
MAX_val=0
for i in range(len(M.columns())):
if (MAX_val< max(M.column(i))):
MAX_val=max(M.column(i))
MAX_val is then the maximum value in the matrix. I hope it was helpful. I ll follow to see if there is a better way.