]> www.ginac.de Git - ginac.git/blobdiff - ginac/basic.cpp
Added .is_polynomial() method.
[ginac.git] / ginac / basic.cpp
index f65e3f0cab5a036a305d97f8e51528eb62ad8630..a3c727bebaaa270404cbfc878bf3533a83706288 100644 (file)
@@ -325,6 +325,12 @@ ex basic::map(map_function & f) const
                return *this;
 }
 
+/** Check whether this is a polynomial in the given variables. */
+bool basic::is_polynomial(const ex & var) const
+{
+       return !has(var) || is_equal(ex_to<basic>(var));
+}
+
 /** Return degree of highest power in object s. */
 int basic::degree(const ex & s) const
 {