Better output for slashed expressions (C.Dams' patch).
authorJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 20 Apr 2005 17:41:38 +0000 (17:41 +0000)
committerJens Vollinga <vollinga@thep.physik.uni-mainz.de>
Wed, 20 Apr 2005 17:41:38 +0000 (17:41 +0000)
ginac/clifford.cpp
ginac/clifford.h

index b337cd70c6c848490cba467236eac6c8bc86f487..0f88e556d025b015fbb1f4c350cbc7cefc7a5bb4 100644 (file)
@@ -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<inherited>(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) << "]";
index 921f50171d3117192d9ead5a812108db7604f3ca..5380b6d8c36b47a9dfe6a12d525ed6624264155a 100644 (file)
@@ -52,6 +52,8 @@ public:
        clifford(unsigned char rl, const ex & metr, std::auto_ptr<exvector> 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;