]> www.ginac.de Git - ginac.git/blobdiff - ginac/normal.cpp
- put everything in "GiNaC" namespace
[ginac.git] / ginac / normal.cpp
index 614b1db1bfc4a00d5630ecfeeadcbee69fdc5956..82fcaf848dd250ea14106dab40a9b0d87b40edf2 100644 (file)
@@ -6,9 +6,47 @@
  *  computation, square-free factorization and rational function normalization.
  */
 
+/*
+ *  GiNaC Copyright (C) 1999 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
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, write to the Free Software
+ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 #include <stdexcept>
+#include <algorithm>
+#include <map>
 
-#include "ginac.h"
+#include "normal.h"
+#include "basic.h"
+#include "ex.h"
+#include "add.h"
+#include "constant.h"
+#include "expairseq.h"
+#include "fail.h"
+#include "indexed.h"
+#include "inifcns.h"
+#include "lst.h"
+#include "mul.h"
+#include "ncmul.h"
+#include "numeric.h"
+#include "power.h"
+#include "relational.h"
+#include "series.h"
+#include "symbol.h"
+
+namespace GiNaC {
 
 // If comparing expressions (ex::compare()) is fast, you can set this to 1.
 // Some routines like quo(), rem() and gcd() will then return a quick answer
@@ -48,8 +86,6 @@ static bool get_first_symbol(const ex &e, const symbol *&x)
  *  Statistical information about symbols in polynomials
  */
 
-#include <algorithm>
-
 /** This structure holds information about the highest and lowest degrees
  *  in which a symbol appears in two multivariate polynomials "a" and "b".
  *  A vector of these structures with information about all symbols in
@@ -455,8 +491,6 @@ bool divide(const ex &a, const ex &b, ex &q, bool check_args)
  *  Remembering
  */
 
-#include <map>
-
 typedef pair<ex, ex> ex2;
 typedef pair<ex, bool> exbool;
 
@@ -874,7 +908,7 @@ ex basic::smod(const numeric &xi) const
 
 ex numeric::smod(const numeric &xi) const
 {
-    return ::smod(*this, xi);
+    return GiNaC::smod(*this, xi);
 }
 
 ex add::smod(const numeric &xi) const
@@ -885,13 +919,13 @@ ex add::smod(const numeric &xi) const
     epvector::const_iterator itend = seq.end();
     while (it != itend) {
         ASSERT(!is_ex_exactly_of_type(it->rest,numeric));
-        numeric coeff = ::smod(ex_to_numeric(it->coeff), xi);
+        numeric coeff = GiNaC::smod(ex_to_numeric(it->coeff), xi);
         if (!coeff.is_zero())
             newseq.push_back(expair(it->rest, coeff));
         it++;
     }
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    numeric coeff = ::smod(ex_to_numeric(overall_coeff), xi);
+    numeric coeff = GiNaC::smod(ex_to_numeric(overall_coeff), xi);
     return (new add(newseq,coeff))->setflag(status_flags::dynallocated);
 }
 
@@ -907,7 +941,7 @@ ex mul::smod(const numeric &xi) const
 #endif // def DOASSERT
     mul * mulcopyp=new mul(*this);
     ASSERT(is_ex_exactly_of_type(overall_coeff,numeric));
-    mulcopyp->overall_coeff=::smod(ex_to_numeric(overall_coeff),xi);
+    mulcopyp->overall_coeff = GiNaC::smod(ex_to_numeric(overall_coeff),xi);
     mulcopyp->clearflag(status_flags::evaluated);
     mulcopyp->clearflag(status_flags::hash_calculated);
     return mulcopyp->setflag(status_flags::dynallocated);
@@ -1450,3 +1484,5 @@ ex ex::normal(int level) const
     else
         return e;
 }
+
+} // namespace GiNaC