]> www.ginac.de Git - ginac.git/blobdiff - ginac/color.h
- Partially solves performance regression in expand(), gcd(), etc [Sheplyakov].
[ginac.git] / ginac / color.h
index 826b4c7ffe68ae7489febb13aa82db7e705ab0f2..f2ef0fa85629a270ea29b6b90ee5dcd8a3762f00 100644 (file)
@@ -3,7 +3,7 @@
  *  Interface to GiNaC's color (SU(3) Lie algebra) objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2004 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2007 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
  */
 
 #ifndef __GINAC_COLOR_H__
@@ -41,6 +41,8 @@ namespace GiNaC {
 class color : public indexed
 {
        GINAC_DECLARE_REGISTERED_CLASS(color, indexed)
+public:
+       static const tinfo_static_t return_type_tinfo_static[256];
 
        // other constructors
 public:
@@ -58,7 +60,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_color + representation_label; }
+       tinfo_t return_type_tinfo() const { return color::return_type_tinfo_static+representation_label; }
 
        // non-virtual functions in this class
 public:
@@ -109,6 +111,7 @@ public:
 
        // non-virtual functions in this class
 protected:
+       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 };
@@ -125,6 +128,7 @@ public:
 
        // non-virtual functions in this class
 protected:
+       unsigned return_type() const { return return_types::commutative; }
        void do_print(const print_context & c, unsigned level) const;
        void do_print_latex(const print_latex & c, unsigned level) const;
 };
@@ -132,12 +136,6 @@ protected:
 
 // global functions
 
-/** Specialization of is_exactly_a<color>(obj) for color objects. */
-template<> inline bool is_exactly_a<color>(const basic & obj)
-{
-       return obj.tinfo()==TINFO_color;
-}
-
 /** Create the su(3) unity element. This is an indexed object, although it
  *  has no indices.
  *