]> www.ginac.de Git - ginac.git/blobdiff - ginac/utils.h
- dummy index renamer didn't account for internal dummy indices of objects
[ginac.git] / ginac / utils.h
index 6edea866c16f22c2e0d533f0a42f2513b88d31df..512c97c34d93457435e7975fd876ee285d8d8c35 100644 (file)
@@ -28,6 +28,7 @@
 
 #include <string>
 #include <stdexcept>
+#include <functional>
 #if defined(HAVE_SSTREAM)
 #include <sstream>
 #elif defined(HAVE_STRSTREAM)
@@ -146,7 +147,14 @@ int permutation_sign(std::vector<T> s)
        return sigma;
 }
 
-void append_exvector_to_exvector(exvector & dest, const exvector & source);
+/* Function objects for STL sort() etc. */
+struct ex_is_less : public binary_function<ex, ex, bool> {
+       bool operator() (const ex &lh, const ex &rh) const { return lh.compare(rh) < 0; }
+};
+
+struct ex_is_equal : public binary_function<ex, ex, bool> {
+       bool operator() (const ex &lh, const ex &rh) const { return lh.is_equal(rh); }
+};
 
 // Collection of `construct on first use' wrappers for safely avoiding
 // internal object replication without running into the `static