* Interface to 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
GINAC_DECLARE_REGISTERED_CLASS(symbol, basic)
friend class realsymbol;
+ friend class possymbol;
// types
};
+/** Specialization of symbol to real domain */
+class possymbol : public symbol
+{
+ // constructors
+public:
+ possymbol();
+ explicit possymbol(const std::string & initname, unsigned domain = domain::positive);
+ possymbol(const std::string & initname, const std::string & texname, unsigned domain = domain::positive);
+ possymbol(const std::string & initname, unsigned rt, tinfo_t rtt, unsigned domain = domain::positive);
+ possymbol(const std::string & initname, const std::string & texname, unsigned rt, tinfo_t rtt, unsigned domain = domain::positive);
+};
+
+
// utility functions
/** Specialization of is_exactly_a<realsymbol>(obj) for realsymbol objects. */
return domain==domain::real || domain==domain::positive;
}
+/** Specialization of is_exactly_a<possymbol>(obj) for possymbol objects. */
+template<> inline bool is_exactly_a<possymbol>(const basic & obj)
+{
+ if (obj.tinfo() != &symbol::tinfo_static)
+ return false;
+ unsigned domain = static_cast<const symbol &>(obj).get_domain();
+ return domain == domain::positive;
+}
+
// wrapper functions around member functions
inline void unassign(symbol & symarg)
{ symarg.unassign(); }