]> www.ginac.de Git - ginac.git/blobdiff - ginac/wildcard.cpp
subs() and normal() use maps instead of lists, resulting in a huge performance
[ginac.git] / ginac / wildcard.cpp
index 10aa7e40ac8c9007e0916615e74118720c2650d2..97fab9e919e101895a52d13d7cb9058886236906 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's wildcard objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2001 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2003 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
@@ -32,38 +32,31 @@ namespace GiNaC {
 GINAC_IMPLEMENT_REGISTERED_CLASS(wildcard, basic)
 
 //////////
-// default ctor, dtor, copy ctor, assignment operator and helpers
+// default constructor
 //////////
 
-wildcard::wildcard() : label(0)
+wildcard::wildcard() : inherited(TINFO_wildcard), label(0)
 {
-       tinfo_key = TINFO_wildcard;
+       setflag(status_flags::evaluated | status_flags::expanded);
 }
 
-void wildcard::copy(const wildcard & other)
-{
-       inherited::copy(other);
-       label = other.label;
-}
-
-DEFAULT_DESTROY(wildcard)
-
 //////////
 // other constructors
 //////////
 
-wildcard::wildcard(unsigned l) : label(l)
+wildcard::wildcard(unsigned l) : inherited(TINFO_wildcard), label(l)
 {
-       tinfo_key = TINFO_wildcard;
+       setflag(status_flags::evaluated | status_flags::expanded);
 }
 
 //////////
 // archiving
 //////////
 
-wildcard::wildcard(const archive_node &n, const lst &sym_lst) : inherited(n, sym_lst)
+wildcard::wildcard(const archive_node &n, lst &sym_lst) : inherited(n, sym_lst)
 {
        n.find_unsigned("label", label);
+       setflag(status_flags::evaluated | status_flags::expanded);
 }
 
 void wildcard::archive(archive_node &n) const
@@ -101,7 +94,7 @@ void wildcard::print(const print_context & c, unsigned level) const
                c.s << "$" << label;
 }
 
-unsigned wildcard::calchash(void) const
+unsigned wildcard::calchash() const
 {
        // this is where the schoolbook method
        // (golden_ratio_hash(tinfo()) ^ label)