Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #33159: handle subrings of SR as well
Browse files Browse the repository at this point in the history
  • Loading branch information
dkrenn committed Jan 13, 2022
1 parent 4d094d6 commit 585dbcd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/sage/matrix/matrix2.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,16 @@ cdef class Matrix(Matrix1):
sage: m = matrix(SR, [0.0])
sage: m.solve_right(b, check=True)
(0)

::

sage: SC = SR.subring(no_variables=True)
sage: m = matrix(SC, [0])
sage: b = vector(SC, [1])
sage: m.solve_right(b)
Traceback (most recent call last):
...
ValueError: matrix equation has no solutions
"""
try:
L = B.base_ring()
Expand Down Expand Up @@ -848,8 +858,8 @@ cdef class Matrix(Matrix1):

# If our field is inexact, checking the answer is doomed in
# most cases. But here we handle the special ones.
from sage.symbolic.ring import SR
if K is SR:
from sage.symbolic.ring import SymbolicRing
if isinstance(K, SymbolicRing):
# Elements of SR "remember" whether or not they are exact.
# If every element in the system is exact, we can probably
# still check the solution over the inexact ring SR.
Expand Down

0 comments on commit 585dbcd

Please sign in to comment.