Add specific dbgprinttree() method to clifford.
authorVladimir V. Kisil <kisilv@maths.leeds.ac.uk>
Thu, 31 Dec 2015 15:41:48 +0000 (16:41 +0100)
committerRichard Kreckel <kreckel@ginac.de>
Thu, 31 Dec 2015 15:41:48 +0000 (16:41 +0100)
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 <kisilv@maths.leeds.ac.uk>
ginac/clifford.cpp
ginac/clifford.h

index f500626..79d2bee 100644 (file)
@@ -44,7 +44,8 @@ namespace GiNaC {
 
 GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(clifford, indexed,
   print_func<print_dflt>(&clifford::do_print_dflt).
-  print_func<print_latex>(&clifford::do_print_latex))
+  print_func<print_latex>(&clifford::do_print_latex).
+  print_func<print_tree>(&clifford::do_print_tree))
 
 GINAC_IMPLEMENT_REGISTERED_CLASS_OPT(diracone, tensor,
   print_func<print_dflt>(&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)
index 0193fda..174e6a2 100644 (file)
@@ -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: