Hello!
This simple program
#include <iostream>
#include <stdexcept>
#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;
int main(int argc, char** argv)
{
varidx mu1(symbol("mu1"), 4);
varidx mu2(symbol("mu2"), 4);
varidx mu3(symbol("mu3"), 4);
varidx mu4(symbol("mu4"), 4);
varidx mu5(symbol("mu5"), 4);
varidx mu6(symbol("mu6"), 4);
exvector ev2;
ev2.push_back(mu3.toggle_variance());
ev2.push_back(mu6);
ev2.push_back(mu5.toggle_variance());
ev2.push_back(mu6.toggle_variance());
ev2.push_back(mu5);
ev2.push_back(mu3);
ex test_cycl = indexed(symbol("A"), sy_cycl(), ev2);
test_cycl = test_cycl.simplify_indexed();
if (test_cycl.get_free_indices().size() != 0)
{
std::cerr << e << std::endl;
throw std::logic_error("Inconsistent indices in expression");
}
return 0;
}
fails (both with GiNaC 1.4 CVS and 1.3.x). I believe that the reason
is bug in indexed.cpp:reposition_dummy_indices() and propose attached
patch to fix it. Note that patch *seems* to be correct, but IMHO it
is somewhat ugly and probably inefficient. Could anyone suggest a better
solution?
Best regards,
Alexei.
--
All science is either physics or stamp collecting.