dummy index renamer ignores index dimensions
authorChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 4 Feb 2003 19:12:03 +0000 (19:12 +0000)
committerChristian Bauer <Christian.Bauer@uni-mainz.de>
Tue, 4 Feb 2003 19:12:03 +0000 (19:12 +0000)
ginac/ex.h
ginac/indexed.cpp

index 208151d..14cfd5b 100644 (file)
@@ -484,6 +484,10 @@ struct ex_is_equal : public std::binary_function<ex, ex, bool> {
        bool operator() (const ex &lh, const ex &rh) const { return lh.is_equal(rh); }
 };
 
+struct op0_is_equal : public std::binary_function<ex, ex, bool> {
+       bool operator() (const ex &lh, const ex &rh) const { return lh.op(0).is_equal(rh.op(0)); }
+};
+
 struct ex_swap : public std::binary_function<ex, ex, void> {
        void operator() (ex &lh, ex &rh) const { lh.swap(rh); }
 };
index 18f4457..5efd308 100644 (file)
@@ -531,7 +531,7 @@ static ex rename_dummy_indices(const ex & e, exvector & global_dummy_indices, ex
                int remaining = local_size - global_size;
                exvector::const_iterator it = local_dummy_indices.begin(), itend = local_dummy_indices.end();
                while (it != itend && remaining > 0) {
-                       if (find_if(global_dummy_indices.begin(), global_dummy_indices.end(), bind2nd(ex_is_equal(), *it)) == global_dummy_indices.end()) {
+                       if (find_if(global_dummy_indices.begin(), global_dummy_indices.end(), bind2nd(op0_is_equal(), *it)) == global_dummy_indices.end()) {
                                global_dummy_indices.push_back(*it);
                                global_size++;
                                remaining--;