|
123 | 123 |
|
124 | 124 | sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x)) # needs sage.symbolic |
125 | 125 | hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x) |
126 | | - sage: hypergeometric((5, 4), (4, 4), 3)._sympy_() # needs sympy sage.symbolic |
| 126 | + sage: hypergeometric((5,), (4,), 3)._sympy_() # needs sympy sage.symbolic |
127 | 127 | hyper((5,), (4,), 3) |
128 | 128 | sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_() # needs sage.symbolic |
129 | 129 | 'HypergeometricPFQ[{5,4},{4,4},3]' |
@@ -295,6 +295,11 @@ def __call__(self, a, b, z, **kwargs): |
295 | 295 | The only simplification that is done automatically is returning 1 |
296 | 296 | if ``z`` is 0. For other simplifications use the |
297 | 297 | ``simplify_hypergeometric`` method. |
| 298 | +
|
| 299 | + TESTS:: |
| 300 | +
|
| 301 | + sage: hypergeometric([2, 3, 4], [4, 1], 1) |
| 302 | + hypergeometric((2, 3, 4), (4, 1), 1) |
298 | 303 | """ |
299 | 304 | return BuiltinFunction.__call__(self, |
300 | 305 | SR._force_pyobject(a), |
@@ -458,23 +463,21 @@ def eliminate_parameters(self, a, b, z): |
458 | 463 | """ |
459 | 464 | aa = list(a) # tuples are immutable |
460 | 465 | bb = list(b) |
461 | | - p = pp = len(aa) |
462 | 466 | q = qq = len(bb) |
463 | 467 | i = 0 |
464 | 468 | while i < qq and aa: |
465 | | - bbb = bb[i] |
466 | | - if bbb in aa: |
467 | | - aa.remove(bbb) |
468 | | - bb.remove(bbb) |
469 | | - pp -= 1 |
| 469 | + bbi = bb[i] |
| 470 | + if bbi in aa: |
| 471 | + aa.remove(bbi) |
| 472 | + bb.remove(bbi) |
470 | 473 | qq -= 1 |
471 | 474 | else: |
472 | 475 | i += 1 |
473 | | - if (pp, qq) != (p, q): |
| 476 | + if qq != q: |
474 | 477 | return hypergeometric(aa, bb, z) |
475 | 478 | return self |
476 | 479 |
|
477 | | - def is_termwise_finite(self, a, b, z): |
| 480 | + def is_termwise_finite(self, a, b, z) -> bool: |
478 | 481 | """ |
479 | 482 | Determine whether all terms of ``self`` are finite. |
480 | 483 |
|
@@ -516,8 +519,6 @@ def is_termwise_finite(self, a, b, z): |
516 | 519 | return 0 not in b |
517 | 520 | if abs(z) == Infinity: |
518 | 521 | return False |
519 | | - if abs(z) == Infinity: |
520 | | - return False |
521 | 522 | for bb in b: |
522 | 523 | if bb in ZZ and bb <= 0: |
523 | 524 | if any((aa in ZZ) and (bb < aa <= 0) for aa in a): |
|
0 commit comments