/** Returns order relation between two objects of same type. This needs to be
* implemented by each class. It may never return anything else than 0,
* signalling equality, or +1 and -1 signalling inequality and determining
- * the canonical ordering. */
+ * the canonical ordering. (Perl hackers will wonder why C++ doesn't feature
+ * the spaceship operator <=> for denoting just this.) */
int basic::compare_same_type(const basic & other) const
{
return compare_pointers(this, &other);
GINAC_ASSERT(typeid(*this)==typeid(other));
- int cmpval = compare_same_type(other);
- if ((cmpval!=0) && (hash_this<0x80000000U)) {
+// int cmpval = compare_same_type(other);
+// if ((cmpval!=0) && (hash_this<0x80000000U)) {
// std::cout << "hash collision, same type: "
// << *this << " and " << other << std::endl;
// this->printraw(std::cout);
// std::cout << " and ";
// other.printraw(std::cout);
// std::cout << std::endl;
- }
- return cmpval;
+// }
+// return cmpval;
+
+ return compare_same_type(other);
}
/** Test for equality.
/** Lightweight wrapper for GiNaC's symbolic objects. Basically all it does is
* to hold a pointer to the other objects, manage the reference counting and
- * provide methods for manipulation of these objects. */
+ * provide methods for manipulation of these objects. (Some people call such
+ * a thing a proxy class.) */
class ex
{
friend class basic;
* polynomial in x.
* @param x variable to factor in
* @return vector of factors sorted in ascending degree */
-exvector sqrfree_yun(const ex &a, const symbol &x)
+static exvector sqrfree_yun(const ex &a, const symbol &x)
{
int i = 0;
exvector res;