[GiNaC-list] bug with is_polynomial?

Jonathan Cross jacross at u.washington.edu
Sat Aug 9 05:42:51 CEST 2008


Alexi,

Thanks for the patch!  It does sound like the correct fix requires two  
types
of "is_polynomial".   Since any such fix breaks binary compatibility,  
I'm
happy if you have to delay the fix until the next major version.   
(Especially
if you are working on more important things like polynomial  
factorization and
Groebner bases!)

> I haven't noticed any polynomial with non-rational coefficients in  
> that
> section. Could you please be more specific? (Maybe you've found some  
> bug
> in the tutorial itself?)


The documentation has the following text, found on section 5.7.1 of  
the pdf
and online at
http://www.ginac.de/tutorial/Polynomial-arithmetic.html#Polynomial%20arithmetic

      Testing whether an expression is a polynomial in one or more
      variables can be done with the method

      bool ex::is_polynomial(const ex & vars) const;
      In the case of more than one variable, the variables are given  
as a list.

===> (x*y*sin(y)).is_polynomial(x)        // Returns true.
      (x*y*sin(y)).is_polynomial(lst(x,y)) // Returns false.

The first example is a polynomial in x where the coefficient of x is a
function of y, not just a rational number.

-Jonathan



More information about the GiNaC-list mailing list