]> www.ginac.de Git - ginac.git/blobdiff - ginac/structure.h
Synced to HEAD
[ginac.git] / ginac / structure.h
index 41b243ac343ecd005db8b0d143c07dfd8d93944a..7d303fa8bb91465dcab179ad997d21c09739f2d8 100644 (file)
@@ -3,7 +3,7 @@
  *  Wrapper template for making GiNaC classes out of C++ structures. */
 
 /*
- *  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
@@ -26,6 +26,8 @@
 #include <functional>
 
 #include "ex.h"
+#include "ncmul.h"
+#include "operators.h"
 #include "print.h"
 
 namespace GiNaC {
@@ -116,7 +118,7 @@ class structure : public basic, public ComparisonPolicy<T> {
        GINAC_DECLARE_REGISTERED_CLASS(structure, basic)
 
        // helpers
-       static unsigned get_tinfo() { return reg_info.tinfo_key; }
+       static unsigned get_tinfo() { return reg_info.options.get_id(); }
        static const char *get_class_name() { return "structure"; }
 
        // constructors
@@ -181,9 +183,9 @@ public:
        ex series(const relational & r, int order, unsigned options = 0) const { return inherited::series(r, order, options); }
 
        // rational functions
-       ex normal(exmap & repl, int level = 0) const { return inherited::normal(repl, level); }
-       ex to_rational(lst & repl_lst) const { return inherited::to_rational(repl_lst); }
-       ex to_polynomial(lst & repl_lst) const { return inherited::to_polynomial(repl_lst); }
+       ex normal(exmap & repl, exmap & rev_lookup, int level = 0) const { return inherited::normal(repl, rev_lookup, level); }
+       ex to_rational(exmap & repl) const { return inherited::to_rational(repl); }
+       ex to_polynomial(exmap & repl) const { return inherited::to_polynomial(repl); }
 
        // polynomial algorithms
        numeric integer_content() const { return 1; }
@@ -193,7 +195,7 @@ public:
        // indexed objects
        exvector get_free_indices() const { return exvector(); }
        ex add_indexed(const ex & self, const ex & other) const { return self + other; }
-       ex scalar_mul_indexed(const ex & self, const numeric & other) const { return self * other; }
+       ex scalar_mul_indexed(const ex & self, const numeric & other) const { return self * ex(other); }
        bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const { return false; }
 
        // noncommutativity
@@ -256,10 +258,7 @@ int structure<T, CP>::compare_same_type(const basic & other) const
 }
 
 template <class T, template <class> class CP>
-registered_class_info structure<T, CP>::reg_info(structure::get_class_name(), "basic", next_structure_tinfo_key++, &structure::unarchive);
-
-template <class T, template <class> class CP>
-const char *structure<T, CP>::class_name() const { return reg_info.name; }
+registered_class_info structure<T, CP>::reg_info = registered_class_info(registered_class_options(structure::get_class_name(), "basic", next_structure_tinfo_key++, &structure::unarchive));
 
 
 } // namespace GiNaC