]> www.ginac.de Git - ginac.git/blobdiff - ginac/symbol.cpp
Possbility for positive symbols/numbers.
[ginac.git] / ginac / symbol.cpp
index 6b37ee123e30d45082eb90b618e2253944141230..7e3b49d8bc7c0e59bcecf4c4034cfaaed1050a47 100644 (file)
@@ -196,7 +196,9 @@ bool symbol::info(unsigned inf) const
            inf == info_flags::rational_function)
                return true;
        if (inf == info_flags::real)
-               return domain == domain::real;
+               return domain==domain::real || domain==domain::positive;
+       if (inf == info_flags::nonnegative)
+               return domain == domain::positive;
        else
                return inherited::info(inf);
 }
@@ -220,12 +222,31 @@ ex symbol::eval(int level) const
 ex symbol::conjugate() const
 {
        if (this->domain == domain::complex) {
-               return GiNaC::conjugate_function(*this).hold();
+               return conjugate_function(*this).hold();
        } else {
                return *this;
        }
 }
 
+ex symbol::real_part() const
+{
+       if (domain==domain::real || domain==domain::positive)
+               return *this;
+       return real_part_function(*this).hold();
+}
+
+ex symbol::imag_part() const
+{
+       if (domain==domain::real || domain==domain::positive)
+               return 0;
+       return imag_part_function(*this).hold();
+}
+
+bool symbol::is_polynomial(const ex & var) const
+{
+       return true;
+}
+
 // protected
 
 /** Implementation of ex::diff() for single differentiation of a symbol.