]> www.ginac.de Git - ginac.git/commitdiff
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 208151df99fbc97616bbc1d74b3b89f5b1de187f..14cfd5b54eb1f1ae8b6c3561bdd81a6520954ff2 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 18f44571fad8b7ae9c74cc879440ef561feac273..5efd3083adc7d020162b265c2dad8130713d49b2 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--;