From 30d2ba04e8723db883d0fd5f31cf343babaf3c89 Mon Sep 17 00:00:00 2001 From: Jens Vollinga Date: Wed, 20 Apr 2005 17:41:38 +0000 Subject: [PATCH] Better output for slashed expressions (C.Dams' patch). --- ginac/clifford.cpp | 4 ++-- ginac/clifford.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ginac/clifford.cpp b/ginac/clifford.cpp index b337cd70..0f88e556 100644 --- a/ginac/clifford.cpp +++ b/ginac/clifford.cpp @@ -200,7 +200,7 @@ void clifford::do_print_dflt(const print_dflt & c, unsigned level) const { // dirac_slash() object is printed differently if (is_dirac_slash(seq[0])) { - seq[0].print(c, level); + seq[0].print(c, precedence()); c.s << "\\"; } else this->print_dispatch(c, level); @@ -211,7 +211,7 @@ void clifford::do_print_latex(const print_latex & c, unsigned level) const // dirac_slash() object is printed differently if (is_dirac_slash(seq[0])) { c.s << "{"; - seq[0].print(c, level); + seq[0].print(c, precedence()); c.s << "\\hspace{-1.0ex}/}"; } else { c.s << "\\clifford[" << int(representation_label) << "]"; diff --git a/ginac/clifford.h b/ginac/clifford.h index 921f5017..5380b6d8 100644 --- a/ginac/clifford.h +++ b/ginac/clifford.h @@ -52,6 +52,8 @@ public: clifford(unsigned char rl, const ex & metr, std::auto_ptr vp); // functions overriding virtual functions from base classes +public: + unsigned precedence() const { return 65; } protected: ex eval_ncmul(const exvector & v) const; bool match_same_type(const basic & other) const; -- 2.44.0