]> www.ginac.de Git - ginac.git/blobdiff - ginac/clifford.cpp
[C++17] Remove inheritance from std::binary_function, std::unary_function.
[ginac.git] / ginac / clifford.cpp
index f50062695232401a51205eb128c44223956eebae..7ab99281e7db0909fb5cd178c01cf8f3bb06ea03 100644 (file)
@@ -3,7 +3,7 @@
  *  Implementation of GiNaC's clifford algebra (Dirac gamma) objects. */
 
 /*
- *  GiNaC Copyright (C) 1999-2015 Johannes Gutenberg University Mainz, Germany
+ *  GiNaC Copyright (C) 1999-2016 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
@@ -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)
@@ -328,7 +340,7 @@ static void base_and_index(const ex & c, ex & b, ex & i)
 }
 
 /** Predicate for finding non-clifford objects. */
-struct is_not_a_clifford : public std::unary_function<ex, bool> {
+struct is_not_a_clifford {
        bool operator()(const ex & e)
        {
                return !is_a<clifford>(e);