]> www.ginac.de Git - ginac.git/blobdiff - ginac/wildcard.cpp
Added integral class.
[ginac.git] / ginac / wildcard.cpp
index a538838b18beb30704660aaf3eaec87ab2ac08da..1bcf2ac2fd4268e9e5cf96137be5d4cdeeb871eb 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's wildcard objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2003 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2004 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
@@ -91,7 +91,7 @@ void wildcard::do_print(const print_context & c, unsigned level) const
 
 void wildcard::do_print_tree(const print_tree & c, unsigned level) const
 {
-       c.s << std::string(level, ' ') << class_name() << " (" << label << ")"
+       c.s << std::string(level, ' ') << class_name() << "(" << label << ")" << " @" << this
            << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
            << std::endl;
 }
@@ -119,4 +119,14 @@ bool wildcard::match(const ex & pattern, lst & repl_lst) const
        return is_equal(ex_to<basic>(pattern));
 }
 
+bool haswild(const ex & x)
+{
+       if (is_a<wildcard>(x))
+               return true;
+       for (int i=0; i<x.nops(); ++i)
+               if (haswild(x.op(i)))
+                       return true;
+       return false;
+}
+
 } // namespace GiNaC