-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #31479: Do not use pynac's poly_mul_expand function until it has…
… been debugged Pynac's `poly_mul_expand` function silently produces wrong results when expanding certain sums. This ticket eliminates its use by pynac's `ex::expand` method, and therefore provides a (temporary) fix for the problems reported in #31077 and #31411. This is part of metaticket #31478. Use of the `poly_mul_expand` function can be re-enabled after the bugs have been fixed. URL: https://trac.sagemath.org/31479 Reported by: gh-DaveWitteMorris Ticket author(s): Dave Morris Reviewer(s): Volker Braun, Matthias Koeppe
- Loading branch information
Showing
5 changed files
with
56 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
tarball=configure-VERSION.tar.gz | ||
sha1=8809623aaeee9f8b0c9de1de8309e873d4f6d9cc | ||
md5=11323b5d74baef36ddb0012a83c2e867 | ||
cksum=1815530444 | ||
sha1=947060891418045c7a06d165b29fbf8486f99fe2 | ||
md5=bc468c0b6934cd87f5a9ec3560adff24 | ||
cksum=124663050 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
034759c8ef41f10a5f4d0925c1fe2cee1ae69ea1 | ||
df398dd79db1994aa00b43108b6f7261ecba055b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
0.7.27.p3 | ||
0.7.27.p4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
diff --git a/ginac/expairseq.cpp b/ginac/expairseq.cpp | ||
index dd87d18..556b713 100644 | ||
--- a/ginac/expairseq.cpp | ||
+++ b/ginac/expairseq.cpp | ||
@@ -1032,7 +1032,12 @@ void expairseq::make_flat(const epvector &v, bool do_index_renaming) | ||
|
||
if (ex_to<basic>(elem.rest).tinfo()==this->tinfo() && | ||
this->can_make_flat(elem)) { | ||
- ex newrest = mf.handle_factor(elem.rest, elem.coeff); | ||
+ ex newrest; | ||
+ if (is_exactly_a<numeric>(elem.coeff) and elem.coeff.is_zero()) { | ||
+ newrest = default_overall_coeff(); | ||
+ } else { | ||
+ newrest = elem.rest; | ||
+ } | ||
const expairseq &subseqref = ex_to<expairseq>(newrest); | ||
combine_overall_coeff(subseqref.overall_coeff, | ||
ex_to<numeric>(elem.coeff)); | ||
@@ -1043,15 +1048,15 @@ void expairseq::make_flat(const epvector &v, bool do_index_renaming) | ||
if (elem.is_canonical_numeric()) | ||
combine_overall_coeff(ex_to<numeric>(mf.handle_factor(elem.rest, _ex1))); | ||
else { | ||
- const ex& rest = elem.rest; | ||
- const ex& newrest = mf.handle_factor(rest, elem.coeff); | ||
- if (newrest.is_zero()) | ||
- combine_overall_coeff(*_num0_p); | ||
- else if (are_ex_trivially_equal(newrest, rest)) | ||
- seq.push_back(elem); | ||
- else | ||
- seq.emplace_back(newrest, elem.coeff); | ||
- } | ||
+ if ((is_exactly_a<numeric>(elem.coeff) and elem.coeff.is_zero()) | ||
+ or (is_exactly_a<numeric>(elem.rest) | ||
+ and (ex_to<numeric>(elem.rest).is_equal(default_overall_coeff())))) { | ||
+ combine_overall_coeff(default_overall_coeff()); | ||
+ } | ||
+ else { | ||
+ seq.push_back(elem); | ||
+ } | ||
+ } | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters