On Fri, Jul 13, 2012 at 11:55 PM, Eric Niebler <e...@boostpro.com> wrote: > On 7/13/2012 12:51 PM, Bart Janssens wrote: > This is an instance of the larger "common subexpression elimination" > problem. The problem is complicated by the fact that it can't be solved > with type information alone. u_adv*nable(u) might have the same type as > u_adv*nable(v) but different values. A hybrid solution is needed where > you cache a set of results indexed both by type information and the > identities (addresses) of the constituents of the subexpressions. This > is hard, and nobody has attempted it yet. I can give you encouragement, > but not guidance. If you find a general and elegant solution, it would > certainly be worth putting in Proto, since lots of folks would benefit.
OK, in my case things are somewhat simpler after all then, since every multiplication does have a distinct type, the u and u_adv are also proto terminals, distinguished using an mpl integer, so that's why I was hoping that a fusion map combined with some clever expression analysis would suffice. Cheers, -- Bart _______________________________________________ proto mailing list proto@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/proto