X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=blobdiff_plain;f=ginac%2Fcolor.cpp;h=b70298b6214c55b0c94982dc3c76c72721180b4b;hp=ebe66e7e2f8dcadb5338b07b93eb96a39d5682a6;hb=ef06261c6354bea6d35e8bcdb89806056d4cccb9;hpb=3ac17e18ada69428fe170c10abcc5f33a30f0676 diff --git a/ginac/color.cpp b/ginac/color.cpp index ebe66e7e..b70298b6 100644 --- a/ginac/color.cpp +++ b/ginac/color.cpp @@ -3,7 +3,7 @@ * 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 @@ -39,6 +39,8 @@ namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS(color, indexed) +const tinfo_static_t color::return_type_tinfo_static[256] = {{}}; + GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(su3one, tensor, print_func(&su3one::do_print). print_func(&su3one::do_print_latex)) @@ -522,16 +524,17 @@ ex color_h(const ex & a, const ex & b, const ex & c) /** 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(tinfo_t ti) { - return ti->tinfo() == &color::tinfo_static; + p_int start_loc=(p_int)&color::return_type_tinfo_static; + return (p_int)ti>=start_loc && (p_int)tiget_representation_label(); + return (unsigned char)((p_int)ti-(p_int)&color::return_type_tinfo_static); } ex color_trace(const ex & e, const std::set & rls)