Error with "solve" (on newer M2 versions)

32 views
Skip to first unread message

Justin Chen

unread,
Apr 2, 2019, 9:41:15 PM4/2/19
to Macaulay2
On M2 v1.13, I encounter the following error with the "solve" command:

i1 : A = matrix{{1_RR,1,1},{3,3,4},{2,2,4}}

o1 = | 1 1 1 |
     | 3 3 4 |
     | 2 2 4 |

                3          3
o1 : Matrix RR    <--- RR
              53         53

i2 : b = matrix{{6_RR},{19},{14}}

o2 = | 6  |
     | 19 |
     | 14 |

                3          1
o2 : Matrix RR    <--- RR
              53         53

i3 : solve(A, b)
stdio:3:1:(3): error: no method found for applying matrix to:
     argument   :  null (of class Nothing)

i4 : b // A
stdio:4:3:(3): error: no method found for applying matrix to:
     argument   :  null (of class Nothing)

The same error occurs on M2 v1.12 (I tried the web interface at habanero). However, trying the same commands on M2 v1.8.2 gives a (correct) answer of {1,4,1}. What is causing this bug? (Presumably the fact that the columns are not linearly dependent is relevant...)

Justin

Justin Chen

unread,
Apr 4, 2019, 11:27:49 AM4/4/19
to Macaulay2
Anton Leykin suggested using the option ClosestFit => true, which seems to do the trick. Perhaps this should be the default behavior when solving linear systems with floating-point arithmetic.

Justin

Daniel R. Grayson

unread,
Apr 16, 2019, 7:46:26 PM4/16/19
to Macaulay2
It would be good if you could report this as an issue on github so it will get fixed.

Justin Chen

unread,
Apr 17, 2019, 8:59:27 AM4/17/19
to Macaulay2
After searching through the issues, I see that a similar error has already been reported in #479, although the issue there is for exact (as opposed to floating-point) arithmetic. In testing the examples in that thread over RR:

- Lars' original example in that thread now works
- Thomas's example from Aug 22, 2018 fails (over RR): solve gives an error. However, using ClosestFit => true, solve returns the ``nonsensical" result (the same as the one over ZZ).

Justin
Reply all
Reply to author
Forward
0 new messages