Ask Your Question

Revision history [back]

click to hide/show revision 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.

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.