[GiNaC-list] ex::is_polynomial function

Richard B. Kreckel kreckel at ginac.de
Thu Jul 24 00:21:37 CEST 2014


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/>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: power-is_polyonmial.patch
Type: text/x-diff
Size: 583 bytes
Desc: not available
URL: <http://www.cebix.net/pipermail/ginac-list/attachments/20140724/b65389b3/attachment.bin>


More information about the GiNaC-list mailing list