* Implementation of GiNaC's color (SU(3) Lie algebra) objects. */
/*
- * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2008 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
tinfo_key = &color::tinfo_static;
}
+return_type_t color::return_type_tinfo() const
+{
+ return make_return_type_t<color>(representation_label);
+}
+
//////////
// archiving
//////////
/** Check whether a given tinfo key (as returned by return_type_tinfo()
* is that of a color object (with an arbitrary representation label). */
-static bool is_color_tinfo(const basic* ti)
+static bool is_color_tinfo(const return_type_t& ti)
{
- return ti->tinfo() == &color::tinfo_static;
+ return *(ti.tinfo) == typeid(color);
}
/** Extract representation label from tinfo key (as returned by
* return_type_tinfo()). */
-static unsigned char get_representation_label(const basic* ti)
+static unsigned char get_representation_label(const return_type_t& ti)
{
- return ((color*)ti)->get_representation_label();
+ return (unsigned char)ti.rl;
}
ex color_trace(const ex & e, const std::set<unsigned char> & rls)