]> www.ginac.de Git - ginac.git/blobdiff - ginac/constant.cpp
- removed this file. it has become obsolete as of libtool-1.4. removing
[ginac.git] / ginac / constant.cpp
index e86a2964164256382b9380754669124f65315b1c..60c3be247dea1e47c2123d37921026e5fca523de 100644 (file)
@@ -83,7 +83,7 @@ constant::constant(const std::string & initname, evalffunctype efun, const std::
                TeX_name = "\\mbox{" + name + "}";
        else
                TeX_name = texname;
-       setflag(status_flags::evaluated);
+       setflag(status_flags::evaluated | status_flags::expanded);
 }
 
 constant::constant(const std::string & initname, const numeric & initnumber, const std::string & texname)
@@ -94,7 +94,7 @@ constant::constant(const std::string & initname, const numeric & initnumber, con
                TeX_name = "\\mbox{" + name + "}";
        else
                TeX_name = texname;
-       setflag(status_flags::evaluated);
+       setflag(status_flags::evaluated | status_flags::expanded);
 }
 
 //////////
@@ -131,7 +131,7 @@ void constant::archive(archive_node &n) const
 }
 
 //////////
-// functions overriding virtual functions from bases classes
+// functions overriding virtual functions from base classes
 //////////
 
 // public
@@ -140,11 +140,11 @@ void constant::print(const print_context & c, unsigned level) const
 {
        debugmsg("constant print", LOGLEVEL_PRINT);
 
-       if (is_of_type(c, print_tree)) {
+       if (is_a<print_tree>(c)) {
                c.s << std::string(level, ' ') << name << " (" << class_name() << ")"
                    << std::hex << ", hash=0x" << hashvalue << ", flags=0x" << flags << std::dec
                    << std::endl;
-       } else if (is_of_type(c, print_latex))
+       } else if (is_a<print_latex>(c))
                c.s << TeX_name;
        else
                c.s << name;
@@ -180,7 +180,7 @@ ex constant::evalf(int level) const
 
 // protected
 
-/** Implementation of ex::diff() for a constant. It always returns 0.
+/** Implementation of ex::diff() for a constant always returns 0.
  *
  *  @see ex::diff */
 ex constant::derivative(const symbol & s) const
@@ -191,18 +191,20 @@ ex constant::derivative(const symbol & s) const
 int constant::compare_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_exactly_of_type(other, constant));
-       // const constant & o=static_cast<constant &>(const_cast<basic &>(other));
-       // return name.compare(o.name);
-       const constant *o = static_cast<const constant *>(&other);
-       if (serial==o->serial) return 0;
-       return serial < o->serial ? -1 : 1;
+       const constant &o = static_cast<const constant &>(other);
+
+       if (serial == o.serial)
+               return 0;
+       else
+               return serial < o.serial ? -1 : 1;
 }
 
 bool constant::is_equal_same_type(const basic & other) const
 {
        GINAC_ASSERT(is_exactly_of_type(other, constant));
-       const constant *o = static_cast<const constant *>(&other);
-       return serial==o->serial;
+       const constant &o = static_cast<const constant &>(other);
+
+       return serial == o.serial;
 }
 
 unsigned constant::calchash(void) const