]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.h
Fixed warning on 64bit machines.
[ginac.git] / ginac / clifford.h
index 18ef03c2209fd073778c90b9e9d1644a392e7820..2d33631d0cad07930152550caf55515c8aae7fc9 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's clifford algebra (Dirac gamma) objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2005 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2006 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
@@ -41,6 +41,8 @@ namespace GiNaC {
 class clifford : public indexed
 {
        GINAC_DECLARE_REGISTERED_CLASS(clifford, indexed)
+public:
+       static const tinfo_static_t return_type_tinfo_static[256];
 
        // other constructors
 public:
@@ -60,7 +62,7 @@ protected:
        ex thiscontainer(const exvector & v) const;
        ex thiscontainer(std::auto_ptr<exvector> vp) const;
        unsigned return_type() const { return return_types::noncommutative; }
-       unsigned return_type_tinfo() const { return TINFO_clifford + representation_label; }
+       tinfo_t return_type_tinfo() const { return clifford::return_type_tinfo_static+representation_label; }
 
        // non-virtual functions in this class
 public:
@@ -74,16 +76,11 @@ public:
        inline size_t nops() const {return inherited::nops() + 1; }
        ex op(size_t i) const;
        ex & let_op(size_t i);
-       ex subs(const exmap & m, unsigned options = 0) const { clifford c = ex_to<clifford>(inherited::subs(m, options)); c.metric_subs(m, options); return c;}
-       ex subs(const lst & ls, const lst & lr, unsigned options = 0) const { clifford c = ex_to<clifford>(ex(*this).subs(ls, lr, options)); c.metric_subs(ls, lr, options); return c;}
-       ex subs(const ex & e, unsigned options = 0) const{ clifford c = ex_to<clifford>(ex(*this).subs(e, options)); c.metric_subs(e, options); return c;};
+       ex subs(const exmap & m, unsigned options = 0) const;
 
 protected:
        void do_print_dflt(const print_dflt & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
-       void metric_subs(const exmap & m, unsigned options = 0) { metric = metric.subs(m, options); }
-       void metric_subs(const lst & ls, const lst & lr, unsigned options = 0) { metric = metric.subs(ls, lr, options); }
-       void metric_subs(const ex & e, unsigned options = 0) { metric = metric.subs(e, options); }
 
        // member variables
 protected:
@@ -112,7 +109,7 @@ class cliffordunit : public tensor
 
        // other constructors
 protected:
-       cliffordunit(unsigned ti) : inherited(ti) {}
+       cliffordunit(tinfo_t ti) : inherited(ti) {}
                                                                                                     
        // functions overriding virtual functions from base classes
 public:
@@ -191,11 +188,11 @@ protected:
 
 // global functions
 
-/** Specialization of is_exactly_a<clifford>(obj) for clifford objects. */
-template<> inline bool is_exactly_a<clifford>(const basic & obj)
-{
-       return obj.tinfo()==TINFO_clifford;
-}
+/** Check whether a given tinfo key (as returned by return_type_tinfo()
+  * is that of a clifford object (with an arbitrary representation label).
+  *
+  * @param ti tinfo key */
+bool is_clifford_tinfo(tinfo_t ti);
 
 /** Create a Clifford unity object.
  *