]> www.ginac.de Git - ginac.git/commitdiff
* color.cpp: remove duplicated default args.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 18 Apr 2001 19:30:21 +0000 (19:30 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Wed, 18 Apr 2001 19:30:21 +0000 (19:30 +0000)
* numeric.cpp: insert some missing cln:: namespace decls.
  Why did this ever work?
* structure.cpp, structure.h: adjust to the new print scheme.

ginac/color.cpp
ginac/numeric.cpp
ginac/structure.cpp
ginac/structure.h

index c31a83c91ae6cce517399b13538869d1496e69b9..4e7d6dd3038bdfb92226352617738f9bc61addc7 100644 (file)
@@ -71,7 +71,7 @@ DEFAULT_CTORS(su3d)
 /** Construct object without any color index. This constructor is for
  *  internal use only. Use the color_ONE() function instead.
  *  @see color_ONE */
-color::color(const ex & b, unsigned rl = 0) : inherited(b), representation_label(rl)
+color::color(const ex & b, unsigned rl) : inherited(b), representation_label(rl)
 {
        debugmsg("color constructor from ex,unsigned", LOGLEVEL_CONSTRUCT);
        tinfo_key = TINFO_color;
@@ -80,7 +80,7 @@ color::color(const ex & b, unsigned rl = 0) : inherited(b), representation_label
 /** Construct object with one color index. This constructor is for internal
  *  use only. Use the color_T() function instead.
  *  @see color_T */
-color::color(const ex & b, const ex & i1, unsigned rl = 0) : inherited(b, i1), representation_label(rl)
+color::color(const ex & b, const ex & i1, unsigned rl) : inherited(b, i1), representation_label(rl)
 {
        debugmsg("color constructor from ex,ex,unsigned", LOGLEVEL_CONSTRUCT);
        tinfo_key = TINFO_color;
index 3af060d0cba27415d1e3beb4623425490f8e2fac..ef4e3e929ce5732f854bfae80d3f72f9f55e2b34 100644 (file)
@@ -938,13 +938,13 @@ bool numeric::is_real(void) const
 
 bool numeric::operator==(const numeric &other) const
 {
-       return equal(cln::the<cln::cl_N>(value), cln::the<cln::cl_N>(other.value));
+       return cln::equal(cln::the<cln::cl_N>(value), cln::the<cln::cl_N>(other.value));
 }
 
 
 bool numeric::operator!=(const numeric &other) const
 {
-       return !equal(cln::the<cln::cl_N>(value), cln::the<cln::cl_N>(other.value));
+       return !cln::equal(cln::the<cln::cl_N>(value), cln::the<cln::cl_N>(other.value));
 }
 
 
@@ -1114,7 +1114,7 @@ const numeric numeric::denom(void) const
        if (this->is_integer())
                return _num1();
        
-       if (instanceof(value, cln::cl_RA_ring))
+       if (cln::instanceof(value, cln::cl_RA_ring))
                return numeric(cln::denominator(cln::the<cln::cl_RA>(value)));
        
        if (!this->is_real()) {  // complex case, handle Q(i):
@@ -1750,8 +1750,8 @@ const numeric irem(const numeric &a, const numeric &b, numeric &q)
 const numeric iquo(const numeric &a, const numeric &b)
 {
        if (a.is_integer() && b.is_integer())
-               return truncate1(cln::the<cln::cl_I>(a.to_cl_N()),
-                            cln::the<cln::cl_I>(b.to_cl_N()));
+               return cln::truncate1(cln::the<cln::cl_I>(a.to_cl_N()),
+                                 cln::the<cln::cl_I>(b.to_cl_N()));
        else
                return _num0();
 }
index c084096c49ff3d8509924d87ef4174e0ff934c89..54dc1dfc62ae7f592eb50d362a6716a441e3ed38 100644 (file)
@@ -26,6 +26,7 @@
 #include "archive.h"
 #include "debugmsg.h"
 #include "utils.h"
+#include "print.h"
 
 namespace GiNaC {
 
@@ -47,33 +48,18 @@ DEFAULT_ARCHIVING(structure)
 // functions overriding virtual functions from bases classes
 //////////
 
-void structure::printraw(std::ostream & os) const
-{
-       debugmsg("structure printraw",LOGLEVEL_PRINT);
-
-       os << class_name() << "(hash=" << hashvalue << ",flags=" << flags << ")";
-}
-
-void structure::print(std::ostream & os, unsigned upper_precedence) const
+void structure::print(const print_context & c, unsigned level) const
 {
        debugmsg("structure print",LOGLEVEL_PRINT);
 
-       os << class_name() << "()";
-}
-
-void structure::printtree(std::ostream & os, unsigned indent) const
-{
-       debugmsg("structure printtree",LOGLEVEL_PRINT);
+       if (is_of_type(c, print_tree)) {
 
-       os << std::string(indent,' ') << class_name() << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
-          << std::endl;
-}
-
-void structure::printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence) const
-{
-       debugmsg("structure print csrc",LOGLEVEL_PRINT);
+               c.s << std::string(level, ' ') << class_name()
+                   << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
+                   << std::endl;
 
-       os << "structure()";
+       } else
+               c.s << class_name() << "()";
 }
 
 // protected
index 9ad049fda6fdc7bbdddcedc19c22eaead38fa1ef..62848b227a86b4f931ec9642ea453c3d1ef14ad4 100644 (file)
@@ -43,10 +43,7 @@ class structure : public basic
        
        // functions overriding virtual functions from bases classes
 public:
-       void printraw(std::ostream & os) const; 
-       void print(std::ostream & os, unsigned upper_precedence=0) const;
-       void printtree(std::ostream & os, unsigned indent) const;
-       void printcsrc(std::ostream & os, unsigned type, unsigned upper_precedence=0) const;
+       void print(const print_context & c, unsigned level=0) const;
 protected:
        bool is_equal_same_type(const basic & other) const;