gen_fun::Hadamard_product: optimize computation of terms with same denominator
commitb44b026e4579a448f1d57f5d5eab623989150a35
authorSven Verdoolaege <skimo@kotnet.org>
Wed, 26 Jul 2006 12:34:47 +0000 (26 14:34 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Wed, 26 Jul 2006 12:34:47 +0000 (26 14:34 +0200)
treeaf9d6ea65e034d18afa3da0bec4350427ed8f19e
parent564438681017055c0ca76b8dfada24ce2e7259be
gen_fun::Hadamard_product: optimize computation of terms with same denominator

Hadamard products of pairs terms with the same denominators require
the enumeration of polytopes with the same supporting cones, possibly
at different vertex positions.
For sufficiently structured problems, some of the vertices may be the
same.  If the coefficients of the two problems sum to zero, then the
generating function corresponding to these vertex cones will cancel.
Rather than first computing these generating function, we detect
canceling vertex cones in advance.
Not only does this reduce the computation time, it also avoid the potential
problem of the opposite terms resulting in different representations
of the same generating function.  These different representations may
not necessarily cancel without more advanced simplification.

For each distinct cone, we collect the corresponding set of pairs of vertices
and coefficients.  If the coefficient of some vertex ends up zero, we
do not need to compute the corresponding generating function.
In principle, we could also compute Barvinok's decomposition of the
cone only once and reuse it for all vertices with which it occurs.
This hasn't been implemented yet.
genfun.cc