From 06e1c4cc6967333ae1597d5e08dd1865ba64c1b2 Mon Sep 17 00:00:00 2001 From: Christian Bauer Date: Tue, 4 Feb 2003 19:12:03 +0000 Subject: [PATCH] dummy index renamer ignores index dimensions --- ginac/ex.h | 4 ++++ ginac/indexed.cpp | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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--; -- 2.47.0