On Mon, Nov 2, 2009 at 2:18 AM, John Cremona <john.crem...@gmail.com> wrote: > > > > On Nov 1, 5:34 pm, Michael Orlitzky <mich...@orlitzky.com> wrote: >> This one had me stumped for a while. I'm using 4.1.1 here, but found the >> same results in a 4.1.2 notebook. The solve_foo() methods are broken, >> too; probably as a consequence. >> >> # Good >> >> sage: m = matrix([ [(-3/10), (1/5), (1/10)], >> [(1/5), (-2/5), (2/5)], >> [(1/10), (1/5), (-1/2)] ]) >> >> sage: m.echelon_form() >> >> [ 1 0 -3/2] >> [ 0 1 -7/4] >> [ 0 0 0] >> >> # Bad >> >> sage: n = matrix([ [-0.3, 0.2, 0.1], >> [0.2, -0.4, 0.4], >> [0.1, 0.2, -0.5] ]) >> >> sage: n.echelon_form() >> >> [ 1.00000000000000 0.000000000000000 0.000000000000000] >> [0.000000000000000 1.00000000000000 0.000000000000000] >> [0.000000000000000 0.000000000000000 1.00000000000000] > > > sage: n.det() > 1.04083408558608e-17 > sage: n.parent() > Full MatrixSpace of 3 by 3 dense matrices over Real Field with 53 bits > of precision > > So to the given precision, n is invertible so its echelon form is the > identity. But if you convert m to a very high precision RealField: > MatrixSpace(RealField(10000),3)(m).echelon_form() > still gives the identity matrix, so this looks bad. (The determinant > is 0 to 10^4 decimals in that example!) > >> >> # Ugly >> >> sage: m == n >> True > > I think this is a coercion issue. I agree taht the result is not > mathematically nice at all: > sage: m==n > True > sage: m.rank(), n.rank() > (2, 3)
This is really no different than: sage: n = 5; m = Mod(5, 19) sage: n == m True sage: n.additive_order() +Infinity sage: m.additive_order() 19 I don't consider this a bug. The original poster's issues might stem from misunderstanding about how floating point numbers are used and abused in Sage (or MATLAB or any other math software, for that matter). William --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---