- unsigned hash_this = gethash();
- unsigned hash_other = other.gethash();
-
- if (hash_this<hash_other) return -1;
- if (hash_this>hash_other) return 1;
-
- unsigned typeid_this = tinfo();
- unsigned typeid_other = other.tinfo();
-
- if (typeid_this<typeid_other) {
- /*
- cout << "hash collision, different types: "
- << *this << " and " << other << endl;
- this->printraw(cout);
- cout << " and ";
- other.printraw(cout);
- cout << endl;
- */
- return -1;
- }
- if (typeid_this>typeid_other) {
- /*
- cout << "hash collision, different types: "
- << *this << " and " << other << endl;
- this->printraw(cout);
- cout << " and ";
- other.printraw(cout);
- cout << endl;
- */
- return 1;
- }
-
- GINAC_ASSERT(typeid(*this)==typeid(other));
-
- int cmpval=compare_same_type(other);
- if ((cmpval!=0)&&(hash_this<0x80000000U)) {
- /*
- cout << "hash collision, same type: "
- << *this << " and " << other << endl;
- this->printraw(cout);
- cout << " and ";
- other.printraw(cout);
- cout << endl;
- */
- }
- return cmpval;
-}
-
+ unsigned hash_this = gethash();
+ unsigned hash_other = other.gethash();
+
+ if (hash_this<hash_other) return -1;
+ if (hash_this>hash_other) return 1;
+
+ unsigned typeid_this = tinfo();
+ unsigned typeid_other = other.tinfo();
+
+ if (typeid_this<typeid_other) {
+// std::cout << "hash collision, different types: "
+// << *this << " and " << other << std::endl;
+// this->printraw(std::cout);
+// std::cout << " and ";
+// other.printraw(std::cout);
+// std::cout << std::endl;
+ return -1;
+ }
+ if (typeid_this>typeid_other) {
+// std::cout << "hash collision, different types: "
+// << *this << " and " << other << std::endl;
+// this->printraw(std::cout);
+// std::cout << " and ";
+// other.printraw(std::cout);
+// std::cout << std::endl;
+ return 1;
+ }
+
+ GINAC_ASSERT(typeid(*this)==typeid(other));
+
+// 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 compare_same_type(other);
+}
+
+/** Test for equality.
+ * This is only a quick test, meaning objects should be in the same domain.
+ * You might have to .expand(), .normal() objects first, depending on the
+ * domain of your computation, to get a more reliable answer.
+ *
+ * @see is_equal_same_type */