By that I simply mean a function that on input a real matrix M returns
the matrix N such that n[i][j] = abs(m[i][j]).

This can be achieve by something like:

n = len(M.rows()); m =len(M.columns()); N = matrix(n,m,lambda i,j:
abs(M[i][j]));

However, for a square matrix M, M.abs() returns something which wasn't
what one expected:

B = matrix(2,2,lambda i,j: i-j); B; B.abs()

returns

[ 0 -1]
[ 1  0]

and 1

Is it a bug? Or something that I missed?

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to