From a7ba1a7f55e47f75673008381f814f96dc0ff564 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Tue, 25 Jan 2000 22:35:47 +0000 Subject: [PATCH] - lcm_of_coefficients() works for unexpanded polynomials - frac_cancel() works for unexpanded polynomials - gcd() can handle partially-factored input polynomials without expanding them --- ginac/normal.cpp | 97 +++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 84 insertions(+), 13 deletions(-) diff --git a/ginac/normal.cpp b/ginac/normal.cpp index f0d9c1ab..a7a37015 100644 --- a/ginac/normal.cpp +++ b/ginac/normal.cpp @@ -190,27 +190,56 @@ static numeric lcmcoeff(const ex &e, const numeric &l) { if (e.info(info_flags::rational)) return lcm(ex_to_numeric(e).denom(), l); - else if (is_ex_exactly_of_type(e, add) || is_ex_exactly_of_type(e, mul)) { + else if (is_ex_exactly_of_type(e, add)) { numeric c = _num1(); for (unsigned i=0; i a.nops()) + goto factored_b; +factored_a: + ex g = _ex1(); + ex acc_ca = _ex1(); + ex part_b = b; + for (int i=0; i b.nops()) + goto factored_a; +factored_b: + ex g = _ex1(); + ex acc_cb = _ex1(); + ex part_a = a; + for (int i=0; i