From 81a315ac1de10724ad963e2a167b7f618b81ac0f Mon Sep 17 00:00:00 2001 From: "Vladimir V. Kisil" Date: Thu, 31 Dec 2015 16:41:48 +0100 Subject: [PATCH] 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 --- ginac/clifford.cpp | 14 +++++++++++++- ginac/clifford.h | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) 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: -- 2.44.0