Hi all, I got a strange problem about collect_common_factors, the problem can be reproduced by the following example: ------ symbol a("a"),b("b"),c("c"); symtab table; table["a"] = a; table["b"] = b; table["c"] = c; parser reader(table); ex res = reader("b*((c+c*(1+4*a+2*b+b^2)-c*(1+2*b+b^2)-(1+4*a)*c))-a*(c+c*(1+4*a+2*b+b^2)-c*(1+2*b+b^2)-(1+4*a)*c)"); cout << res << endl; cout << collect_common_factors(res) << endl; ------ the collect_common_factors will throw an error: division by zero. so is this a bug for collect_common_factors? Best regards! Feng
On Wed, 17 Jun 2020 08:24:21 +0000, Feng Feng <f.feng@outlook.com> said:
FF> Hi all, I got a strange problem about collect_common_factors, FF> the problem can be reproduced by the following example: ------ The trick with your expression is that the common factor (and thus the entire expression) is equal to 0. I have sent a patch to fix this: https://www.ginac.de/pipermail/ginac-devel/2020-June/002473.html Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter: https://github.com/vvkisil/MoebInv-notebooks
Indeed, the common factor in the example is actually 0. And thanks very much for the quick fix. Best regards! Feng ________________________________ 发件人: Vladimir V. Kisil <V.Kisil@leeds.ac.uk> 发送时间: 2020年6月20日 3:12 收件人: GiNaC discussion list <ginac-list@ginac.de>; Feng Feng <f.feng@outlook.com> 抄送: Vladimir V. Kisil <V.Kisil@leeds.ac.uk> 主题: Re: [GiNaC-list] problem about collect_common_factors
On Wed, 17 Jun 2020 08:24:21 +0000, Feng Feng <f.feng@outlook.com> said:
FF> Hi all, I got a strange problem about collect_common_factors, FF> the problem can be reproduced by the following example: ------ The trick with your expression is that the common factor (and thus the entire expression) is equal to 0. I have sent a patch to fix this: https://www.ginac.de/pipermail/ginac-devel/2020-June/002473.html Best wishes, Vladimir -- Vladimir V. Kisil http://www.maths.leeds.ac.uk/~kisilv/ Book: Geometry of Mobius Transformations http://goo.gl/EaG2Vu Software: Geometry of cycles http://moebinv.sourceforge.net/ Jupyter: https://github.com/vvkisil/MoebInv-notebooks
participants (3)
-
Feng Feng
-
Feng Feng
-
Vladimir V. Kisil