* Implementation of GiNaC's symbolic objects. */
/*
- * GiNaC Copyright (C) 1999-2006 Johannes Gutenberg University Mainz, Germany
+ * GiNaC Copyright (C) 1999-2007 Johannes Gutenberg University Mainz, Germany
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
domain = domain::real;
}
+// possymbol
+
+possymbol::possymbol()
+{
+ domain = domain::positive;
+}
+
//////////
// other constructors
//////////
realsymbol::realsymbol(const std::string & initname, const std::string & texname, unsigned rt, tinfo_t rtt, unsigned domain)
: symbol(initname, texname, rt, rtt, domain) { }
+// possymbol
+
+possymbol::possymbol(const std::string & initname, unsigned domain)
+ : symbol(initname, domain) { }
+
+possymbol::possymbol(const std::string & initname, const std::string & texname, unsigned domain)
+ : symbol(initname, texname, domain) { }
+
+possymbol::possymbol(const std::string & initname, unsigned rt, tinfo_t rtt, unsigned domain)
+ : symbol(initname, rt, rtt, domain) { }
+
+possymbol::possymbol(const std::string & initname, const std::string & texname, unsigned rt, tinfo_t rtt, unsigned domain)
+ : symbol(initname, texname, rt, rtt, domain) { }
+
//////////
// archiving
//////////
inf == info_flags::cinteger_polynomial ||
inf == info_flags::rational_polynomial ||
inf == info_flags::crational_polynomial ||
- inf == info_flags::rational_function)
+ inf == info_flags::rational_function ||
+ inf == info_flags::expanded)
return true;
if (inf == info_flags::real)
- return domain == domain::real;
+ return domain==domain::real || domain==domain::positive;
+ if (inf == info_flags::positive || inf == info_flags::nonnegative)
+ return domain == domain::positive;
else
return inherited::info(inf);
}
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.