]> www.ginac.de Git - ginac.git/blobdiff - ginac/wildcard.cpp
Added callback mechanism to watch changes to 'Digits' (to be used for look-up tables)
[ginac.git] / ginac / wildcard.cpp
index fa4153f1b5bff0b5fc5009ad1afa5f48c74f597a..8bf8c6a739c1b7e5c6307f21805c5f33cd879159 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-2005 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
@@ -17,7 +17,7 @@
  *
  *  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
+ *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
 #include <iostream>
@@ -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 (size_t i=0; i<x.nops(); ++i)
+               if (haswild(x.op(i)))
+                       return true;
+       return false;
+}
+
 } // namespace GiNaC