The following code is not working as I would expect. The expression ‘m + sqrt(d)’ is surely a polynomial in m. However GiNaC thinks it is not. { symbol m("m"), d("d"); ex e = m + sqrt(d); cout << e << " is polynomial in m " << e.is_polynomial(m) << endl; } Regards, Ruben
On 07/20/2014 11:07 PM, Ruben Zilibowitz wrote:
The following code is not working as I would expect. The expression ‘m + sqrt(d)’ is surely a polynomial in m. However GiNaC thinks it is not.
{ symbol m("m"), d("d"); ex e = m + sqrt(d); cout << e << " is polynomial in m " << e.is_polynomial(m) << endl; }
The logic in power::is_polynomial(ex) is a little bit screwed. If I don't miss anything, the attached patch should fix it. Could you, please, test it not just with the example you posted but also with other code you might have? Thanks -richy. -- Richard B. Kreckel <http://in.terlu.de/~kreckel/>
participants (2)
-
Richard B. Kreckel
-
Ruben Zilibowitz