]> www.ginac.de Git - ginac.git/blobdiff - ginac/color.cpp
fixed some -Wall stuff
[ginac.git] / ginac / color.cpp
index 195b93e71ab9c651f196ec58f81c0312b4c4b6f6..3b544171ac24b5e0030eb134bc0794c832d96526 100644 (file)
@@ -129,7 +129,7 @@ DEFAULT_ARCHIVING(su3d)
 
 int color::compare_same_type(const basic & other) const
 {
-       GINAC_ASSERT(other.tinfo() == TINFO_color);
+       GINAC_ASSERT(is_of_type(other, color));
        const color &o = static_cast<const color &>(other);
 
        if (representation_label != o.representation_label) {
@@ -140,6 +140,14 @@ int color::compare_same_type(const basic & other) const
        return inherited::compare_same_type(other);
 }
 
+bool color::match_same_type(const basic & other) const
+{
+       GINAC_ASSERT(is_of_type(other, color));
+       const color &o = static_cast<const color &>(other);
+
+       return representation_label == o.representation_label;
+}
+
 DEFAULT_COMPARE(su3one)
 DEFAULT_COMPARE(su3t)
 DEFAULT_COMPARE(su3f)
@@ -565,7 +573,7 @@ ex color_trace(const ex & e, unsigned char rl)
 
                        exvector v1;
                        v1.reserve(num - 2);
-                       for (int i=0; i<num-2; i++)
+                       for (unsigned i=0; i<num-2; i++)
                                v1.push_back(e.op(i));
 
                        exvector v2 = v1;