Skip to content

Commit dad12ba

Browse files
committed
Merge pull request #2437 from asmeurer/solve_minimal
Change the solve flag "minimal" to "particular"
2 parents 0da5c7f + f71b818 commit dad12ba

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

sympy/simplify/simplify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ def _ratsimpmodprime(a, b, allsol, N=0, D=0):
884884
order=opt.order, polys=True)[1]
885885

886886
S = Poly(r, gens=opt.gens).coeffs()
887-
sol = solve(S, Cs + Ds, minimal=True, quick=True)
887+
sol = solve(S, Cs + Ds, particular=True, quick=True)
888888

889889
if sol and not all([s == 0 for s in sol.values()]):
890890
c = c_hat.subs(sol)
@@ -931,7 +931,7 @@ def _ratsimpmodprime(a, b, allsol, N=0, D=0):
931931
debug('Looking for best minimal solution. Got: %s' % len(allsol))
932932
newsol = []
933933
for c_hat, d_hat, S, ng in allsol:
934-
sol = solve(S, ng, minimal=True, quick=False)
934+
sol = solve(S, ng, particular=True, quick=False)
935935
newsol.append((c_hat.subs(sol), d_hat.subs(sol)))
936936
c, d = min(newsol, key=lambda x: len(x[0].terms()) + len(x[1].terms()))
937937

sympy/solvers/solvers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,11 +406,11 @@ def solve(f, *symbols, **flags):
406406
other functions that contain that pattern; this is only
407407
needed if the pattern is inside of some invertible function
408408
like cos, exp, ....
409-
'minimal=True (default is False)'
409+
'particular=True (default is False)'
410410
instructs solve to try to find a particular solution to a linear
411411
system with as many zeros as possible; this is very expensive
412412
'quick=True (default is False)'
413-
when using minimal=True, use a fast heuristic instead to find a
413+
when using particular=True, use a fast heuristic instead to find a
414414
solution with many zeros (instead of using the very slow method
415415
guaranteed to find the largest number of zeros possible)
416416
@@ -1461,7 +1461,7 @@ def _solve_system(exprs, symbols, **flags):
14611461
matrix[i, m] = -coeff
14621462

14631463
# returns a dictionary ({symbols: values}) or None
1464-
if flags.pop('minimal', False):
1464+
if flags.pop('particular', False):
14651465
result = minsolve_linear_system(matrix, *symbols, **flags)
14661466
else:
14671467
result = solve_linear_system(matrix, *symbols, **flags)

sympy/solvers/tests/test_solvers.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,12 +1183,12 @@ def test_high_order_roots():
11831183
def test_minsolve_linear_system():
11841184
def count(dic):
11851185
return len([x for x in dic.values() if x == 0])
1186-
assert count(solve([x + y + z, y + z + a + t], minimal=True, quick=True)) \
1186+
assert count(solve([x + y + z, y + z + a + t], particular=True, quick=True)) \
11871187
== 3
1188-
assert count(solve([x + y + z, y + z + a + t], minimal=True, quick=False)) \
1188+
assert count(solve([x + y + z, y + z + a + t], particular=True, quick=False)) \
11891189
== 3
1190-
assert count(solve([x + y + z, y + z + a], minimal=True, quick=True)) == 1
1191-
assert count(solve([x + y + z, y + z + a], minimal=True, quick=False)) == 2
1190+
assert count(solve([x + y + z, y + z + a], particular=True, quick=True)) == 1
1191+
assert count(solve([x + y + z, y + z + a], particular=True, quick=False)) == 2
11921192

11931193

11941194
def test_real_roots():

0 commit comments

Comments
 (0)