]> www.ginac.de Git - ginac.git/blobdiff - ginac/color.h
fixed a bug where quo() would call vector::reserve() with a negative argument
[ginac.git] / ginac / color.h
index eb273c71b7da3ec710d5423a3bd2e3fb553a8f0f..cc7ac31e54a5963de6a0b72129c82d202e81206b 100644 (file)
@@ -51,6 +51,7 @@ public:
 
        // functions overriding virtual functions from base classes
 protected:
+       bool match_same_type(const basic & other) const;
        ex simplify_ncmul(const exvector & v) const;
        ex thisexprseq(const exvector & v) const;
        ex thisexprseq(exvector * vp) const;
@@ -72,7 +73,7 @@ class su3one : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3one, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
 };
@@ -82,7 +83,7 @@ class su3t : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3t, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        bool contract_with(exvector::iterator self, exvector::iterator other, exvector & v) const;
@@ -94,7 +95,7 @@ class su3f : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3f, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        ex eval_indexed(const basic & i) const;
@@ -106,7 +107,7 @@ class su3d : public tensor
 {
        GINAC_DECLARE_REGISTERED_CLASS(su3d, tensor)
 
-       // functions overriding virtual functions from bases classes
+       // functions overriding virtual functions from base classes
 public:
        void print(const print_context & c, unsigned level = 0) const;
        ex eval_indexed(const basic & i) const;
@@ -115,12 +116,13 @@ public:
 
 
 // global functions
-inline const color &ex_to_color(const ex &e)
+
+/** Specialization of is_exactly_a<color>(obj) for color objects. */
+template<> inline bool is_exactly_a<color>(const basic & obj)
 {
-       return static_cast<const color &>(*e.bp);
+       return obj.tinfo()==TINFO_color;
 }
 
-
 /** Create the su(3) unity element. This is an indexed object, although it
  *  has no indices.
  *