From: Vladimir V. Kisil Date: Thu, 31 Dec 2015 15:41:48 +0000 (+0100) Subject: Add specific dbgprinttree() method to clifford. X-Git-Tag: release_1-7-0~7^2~24 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=81a315ac1de10724ad963e2a167b7f618b81ac0f Add specific dbgprinttree() method to clifford. Metric is an important element of a clifford object, thus it is useful to have the metric to be printed in the detailed debug printing. Signed-off-by: Vladimir V. Kisil --- diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index f5006269..79d2bee5 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -44,7 +44,8 @@ namespace GiNaC { GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(clifford, indexed, print_func(&clifford::do_print_dflt). - print_func(&clifford::do_print_latex)) + print_func(&clifford::do_print_latex). + print_func(&clifford::do_print_tree)) GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracone, tensor, print_func(&diracone::do_print). @@ -294,6 +295,17 @@ void clifford::do_print_latex(const print_latex & c, unsigned level) const } } +void clifford::do_print_tree(const print_tree & c, unsigned level) const +{ + c.s << std::string(level, ' ') << class_name() << " @" << this + << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec + << ", " << seq.size()-1 << " indices" + << ", symmetry=" << symtree << std::endl; + metric.print(c, level + c.delta_indent); + seq[0].print(c, level + c.delta_indent); + printindices(c, level + c.delta_indent); +} + DEFAULT_COMPARE(diracone) DEFAULT_COMPARE(cliffordunit) DEFAULT_COMPARE(diracgamma) diff --git a/ginac/clifford.h b/ginac/clifford.h index 0193fdaf..174e6a2b 100644 --- a/ginac/clifford.h +++ b/ginac/clifford.h @@ -77,6 +77,7 @@ public: protected: void do_print_dflt(const print_dflt & c, unsigned level) const; void do_print_latex(const print_latex & c, unsigned level) const; + void do_print_tree(const print_tree & c, unsigned level) const; // member variables protected: