2014-12-04 7:37 UTC+01:00, Jernej <azi.std...@gmail.com>:
> val*bm.transpose() is actually a number but the way Sage handles it is
> awkward:
>
> sage: M = Matrix(RR,[[1],[1]])
> sage: Matrix(RR,[[-1,0]])*M
> [-1.00000000000000]
> sage: abs(Matrix(RR,[[-1,0]])*M)
> -1.00000000000000 # some norm of the matrix??

For this very particular problem, you can reproduce it without any
multiplication

sage: M = matrix(RR, [[-1]])
sage: abs(M)
-1.00000000000000

So the problem is with abs(M). The reason is that abs(M) is calling
the method M.__abs__(). The latter one is just a shortcut for the
determinant. I really do not understand why and it looks like a bug to
me.

For comparison, in scipy the same function just return the matrix
where each entry is replace with its absolute value. Which is much
more natural.

I opened a ticket for that:
http://trac.sagemath.org/ticket/17443
It should be corrected in the next stable release.

Thanks for the report
Vincent

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to