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

Commit

Permalink
Trac 16753 : solve of equation system misses trivial simplifications
Browse files Browse the repository at this point in the history
The 'solve' function now returns empty set for unsolved equations.
Changed test which used to fail new changes.
  • Loading branch information
ajagekarakshay committed Mar 3, 2016
1 parent 1961f94 commit 88dec5a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/sage/symbolic/relation.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,7 @@ def solve(f, *args, **kwds):
TESTS::
sage: solve([sin(x)==x,y^2==x],x,y)
[sin(x) == x, y^2 == x]
[]
sage: solve(0==1,x)
Traceback (most recent call last):
...
Expand Down Expand Up @@ -860,7 +860,8 @@ def solve(f, *args, **kwds):
s = []

sol_list = string_to_list_of_solutions(repr(s))

if f == sol_list:
sol_list = []
# Relaxed form suggested by Mike Hansen (#8553):
if kwds.get('solution_dict', False):
if len(sol_list)==0: # fixes IndexError on empty solution list (#8553)
Expand Down

0 comments on commit 88dec5a

Please sign in to comment.