11 Jul
2003
11 Jul
'03
6:32 a.m.
Hm? This works for me:
symbol t("t"); idx i(symbol("i"), 3); ex e1 = indexed(t, i); ex i_ = wild(); ex e2 = e1.subs(indexed(t, idx(i_, 3)) == i_ * indexed(t, idx(i_, 3))); cout << e1 << " -> " << e2 << endl; // prints "t.i -> i*t.i"
Perhaps you forgot that subs() returns its result as a new expression? Oh, yes. It's really stupid that I forgot this. Thank you much. :-)
Yong