* 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
class clifford : public indexed
{
GINAC_DECLARE_REGISTERED_CLASS(clifford, indexed)
+public:
+ static const tinfo_static_t return_type_tinfo_static[256];
// other constructors
public:
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:
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:
// other constructors
protected:
- cliffordunit(unsigned ti) : inherited(ti) {}
+ cliffordunit(tinfo_t ti) : inherited(ti) {}
// functions overriding virtual functions from base classes
public:
// 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.
*