DEFAULT_ARCHIVING(su3d)
//////////
-// functions overriding virtual functions from bases classes
+// functions overriding virtual functions from base classes
//////////
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) {
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)
it++;
}
- if (s.size() == 0)
+ if (s.empty())
return color(su3one(), representation_label);
else
return simplified_ncmul(s);
GINAC_ASSERT(is_ex_of_type(i.op(0), su3d));
// Convolutions are zero
- if (static_cast<const indexed &>(i).get_dummy_indices().size() != 0)
+ if (!(static_cast<const indexed &>(i).get_dummy_indices().empty()))
return _ex0();
// Numeric evaluation
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;