]> www.ginac.de Git - ginac.git/blobdiff - ginac/print.cpp
- put everything in "GiNaC" namespace
[ginac.git] / ginac / print.cpp
index 6cfd0a1f8236a4fa5b9ff7e9b885654ce26ed173..899c21b0d02aacb85ce45e83056460a8f9f94606 100644 (file)
@@ -3,9 +3,45 @@
  *  The methods .print() are responsible for the nice default-output of
  *  objects.  All related helper-functions go in here as well. */
 
+/*
+ *  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 <iostream>
 
-#include "ginac.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 "matrix.h"
+#include "mul.h"
+#include "ncmul.h"
+#include "numeric.h"
+#include "power.h"
+#include "relational.h"
+#include "series.h"
+#include "symbol.h"
+#include "debugmsg.h"
+
+namespace GiNaC {
 
 void ex::print(ostream & os, unsigned upper_precedence) const
 {
@@ -173,13 +209,13 @@ void add::print(ostream & os, unsigned upper_precedence) const
             os << "-";
         } else {
             if (cit->coeff != 1) {
-                os << cit->coeff;
+                (cit->coeff).print(os,precedence);
                 os << "*";
             }
         }
         os << cit->rest;
     }
-    if (!overall_coeff.is_equal(exZERO())) {
+    if (!overall_coeff.is_zero()) {
         if (overall_coeff > 0) os << '+';
         os << overall_coeff;
     }
@@ -285,3 +321,5 @@ void matrix::print(ostream & os, unsigned upper_precedence) const
     }
     os << m[row*col-1] << "]] ]]";
 }
+
+} // namespace GiNaC