]> www.ginac.de Git - ginac.git/blobdiff - ginac/add.cpp
Update copyright statements.
[ginac.git] / ginac / add.cpp
index 241516e07283b7e49a3a7fd7bf47490bebb1c9f9..81a4f2fb1579d7147129d9c89f0763aafbd42b10 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's sums of expressions. */
 
 /*
- *  GiNaC Copyright (C) 1999-2010 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2014 Johannes Gutenberg University Mainz, Germany
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -260,6 +260,16 @@ bool add::info(unsigned inf) const
        return inherited::info(inf);
 }
 
+bool add::is_polynomial(const ex & var) const
+{
+       for (epvector::const_iterator i=seq.begin(); i!=seq.end(); ++i) {
+               if (!(i->rest).is_polynomial(var)) {
+                       return false;
+               }
+       }
+       return true;
+}
+
 int add::degree(const ex & s) const
 {
        int deg = std::numeric_limits<int>::min();
@@ -298,7 +308,7 @@ ex add::coeff(const ex & s, int n) const
 {
        std::auto_ptr<epvector> coeffseq(new epvector);
        std::auto_ptr<epvector> coeffseq_cliff(new epvector);
-       char rl = clifford_max_label(s);
+       int rl = clifford_max_label(s);
        bool do_clifford = (rl != -1);
        bool nonscalar = false;
 
@@ -603,7 +613,7 @@ expair add::combine_pair_with_coeff_to_pair(const expair & p,
 
        return expair(p.rest,ex_to<numeric>(p.coeff).mul_dyn(ex_to<numeric>(c)));
 }
-       
+
 ex add::recombine_pair_to_ex(const expair & p) const
 {
        if (ex_to<numeric>(p.coeff).is_equal(*_num1_p))