From: Christian Bauer Date: Tue, 4 Feb 2003 19:12:03 +0000 (+0000) Subject: dummy index renamer ignores index dimensions X-Git-Tag: release_1-0-14~15 X-Git-Url: https://www.ginac.de/ginac.git//ginac.git?p=ginac.git;a=commitdiff_plain;h=06e1c4cc6967333ae1597d5e08dd1865ba64c1b2;hp=b4587b7587c5660705e755a853253b4159acfda1 dummy index renamer ignores index dimensions --- diff --git a/ginac/ex.h b/ginac/ex.h index 208151df..14cfd5b5 100644 --- a/ginac/ex.h +++ b/ginac/ex.h @@ -484,6 +484,10 @@ struct ex_is_equal : public std::binary_function { bool operator() (const ex &lh, const ex &rh) const { return lh.is_equal(rh); } }; +struct op0_is_equal : public std::binary_function { + 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 { void operator() (ex &lh, ex &rh) const { lh.swap(rh); } }; diff --git a/ginac/indexed.cpp b/ginac/indexed.cpp index 18f44571..5efd3083 100644 --- a/ginac/indexed.cpp +++ b/ginac/indexed.cpp @@ -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--;