Skip to content

Commit 542c72f

Browse files
committed
reverted changes of sympy#17723 for 1.5
1 parent d69ee2a commit 542c72f

File tree

2 files changed

+0
-35
lines changed

2 files changed

+0
-35
lines changed

sympy/solvers/solvers.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -985,30 +985,6 @@ def _sympified_list(w):
985985
f[i] = fi
986986

987987
if fi.is_Relational:
988-
if flags.get('dict', False):
989-
solution = reduce_inequalities(f, symbols=symbols)
990-
if isinstance(solution, Equality):
991-
return [{solution.lhs: solution.rhs}]
992-
solution = list(solution.args)
993-
for sol in solution:
994-
# Behavior for types like StrictLessThan is not defined
995-
if not isinstance(sol, (Or, Equality)):
996-
warnings.warn(filldedent('''
997-
Warning: Ignoring dict=True due to
998-
incompatible type of %s.''' % sol))
999-
return reduce_inequalities(f, symbols=symbols)
1000-
intermediate = [sol for sol in solution
1001-
if isinstance(sol, Equality)]
1002-
solution[:] = [sol.args for sol in solution
1003-
if sol not in intermediate]
1004-
solutions = [intermediate + list(sol)
1005-
for sol in itertools.product(*solution)]
1006-
for i in range(len(solutions)):
1007-
ele = {}
1008-
for sol in solutions[i]:
1009-
ele[sol.lhs] = sol.rhs
1010-
solutions[i] = ele
1011-
return [] if solutions == [{}] else solutions
1012988
return reduce_inequalities(f, symbols=symbols)
1013989

1014990
if isinstance(fi, Poly):

sympy/solvers/tests/test_solvers.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,6 @@ def test_solve_args():
174174
assert solve(True, x) == []
175175
assert solve([x-1, False], [x], set=True) == ([], set())
176176

177-
178-
def test_solve_dict():
179-
assert solve(Eq(2*x,1), dict=True) == [{x: S(1)/2}]
180-
assert solve([Eq(x**2-1, 0), Gt(x, 0)], (x,), dict=True) == [{x: 1}]
181-
assert solve([Eq(x**3-6*x**2+11*x-6, 0), Eq(y**2, 1), Eq(z, 1)],
182-
(x, y, z,), dict=True) == [{x: 1, y: -1, z: 1}, {x: 1, y: 1, z: 1},
183-
{x: 2, y: -1, z: 1}, {x: 2, y: 1, z: 1},
184-
{x: 3, y: -1, z: 1}, {x: 3, y: 1, z: 1}]
185-
assert solve(Gt(x, 0), (x,), dict=True) == And(Lt(0, x), Lt(x, oo))
186-
187-
188177
def test_solve_polynomial1():
189178
assert solve(3*x - 2, x) == [Rational(2, 3)]
190179
assert solve(Eq(3*x, 2), x) == [Rational(2, 3)]

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy