]> www.ginac.de Git - ginac.git/blobdiff - ginac/operators.cpp
Fix the compliation error *for real* ... and restore performance
[ginac.git] / ginac / operators.cpp
index 1a1b6de497232d0b0cb5b8b34bc23318198ccbc4..c5972c6ce9acc946a393a9aa59b75548b4f604b4 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's overloaded operators. */
 
 /*
- *  GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2009 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
@@ -20,9 +20,6 @@
  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
-#include <iostream>
-#include <iomanip>
-
 #include "operators.h"
 #include "numeric.h"
 #include "add.h"
@@ -33,6 +30,9 @@
 #include "print.h"
 #include "utils.h"
 
+#include <iomanip>
+#include <iostream>
+
 namespace GiNaC {
 
 /** Used internally by operator+() to add two ex objects together. */
@@ -377,6 +377,33 @@ std::ostream & operator<<(std::ostream & os, const exvector & e)
        return os;
 }
 
+std::ostream & operator<<(std::ostream & os, const exset & e)
+{
+       print_context *p = get_print_context(os);
+       exset::const_iterator i = e.begin();
+       exset::const_iterator send = e.end();
+
+       if (i==send) {
+               os << "<>";
+               return os;
+       }
+
+       os << "<";
+       while (true) {
+               if (p == 0)
+                       i->print(print_dflt(os));
+               else
+                       i->print(*p);
+               ++i;
+               if (i == send)
+                       break;
+               os << ",";
+       }
+       os << ">";
+
+       return os;
+}
+
 std::ostream & operator<<(std::ostream & os, const exmap & e)
 {
        print_context *p = get_print_context(os);