From c277943ace48d2f22f7016ba9439ff7cb949a231 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Mon, 1 Dec 2008 09:54:53 +0100 Subject: [PATCH] Fixed a problem in polynomial divide by deactivating a recursion that lead to a significant slowdown in sqrfree() and sometimes to a infinite loop. --- ginac/normal.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ginac/normal.cpp b/ginac/normal.cpp index 09773d37..8f5ba73f 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -672,12 +672,13 @@ bool divide(const ex &a, const ex &b, ex &q, bool check_args) q = rem_i*power(ab, a_exp - 1); return true; } - for (int i=2; i < a_exp; i++) { - if (divide(power(ab, i), b, rem_i, false)) { - q = rem_i*power(ab, a_exp - i); - return true; - } - } // ... so we *really* need to expand expression. +// code below is commented-out because it leads to a significant slowdown +// for (int i=2; i < a_exp; i++) { +// if (divide(power(ab, i), b, rem_i, false)) { +// q = rem_i*power(ab, a_exp - i); +// return true; +// } +// } // ... so we *really* need to expand expression. } // Polynomial long division (recursive) -- 2.49.0