From: Jens Vollinga Date: Fri, 13 Jul 2007 17:55:20 +0000 (+0000) Subject: Clifford units now honor representation labels. X-Git-Tag: release_1-4-0~18 X-Git-Url: https://ginac.de/ginac.git/static/gitweb.css/ginac.git?a=commitdiff_plain;h=18d403808b2c0fd73f43cbf4e346c5902f052a65;p=ginac.git Clifford units now honor representation labels. --- diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index 4e601ab4..a434a882 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -265,8 +265,21 @@ void clifford::do_print_dflt(const print_dflt & c, unsigned level) const if (is_dirac_slash(seq[0])) { seq[0].print(c, precedence()); c.s << "\\"; - } else - this->print_dispatch(c, level); + } else { // We do not print representation label if it is 0 + if (representation_label == 0) { + this->print_dispatch(c, level); + } else { // otherwise we put it before indices in square brackets; the code is borrowed from indexed.cpp + if (precedence() <= level) { + c.s << '('; + } + seq[0].print(c, precedence()); + c.s << '[' << int(representation_label) << ']'; + printindices(c, level); + if (precedence() <= level) { + c.s << ')'; + } + } + } } void clifford::do_print_latex(const print_latex & c, unsigned level) const