bernoulli.c: perform nested sums approximation depth first
commit9f138f5acb33310c4e270dc438497b8359249533
authorSven Verdoolaege <skimo@kotnet.org>
Mon, 14 May 2007 10:50:48 +0000 (14 12:50 +0200)
committerSven Verdoolaege <skimo@kotnet.org>
Mon, 14 May 2007 10:52:58 +0000 (14 12:52 +0200)
tree97fd541d0f15ff0a8a0afa9a0437b574dcb2f626
parentf5d0ec99bdd0bc808c9f7950fa97be81e5dc2251
bernoulli.c: perform nested sums approximation depth first

For a piecewise polynomial, the original implementation would
first compute the common refinement of the chamber decompositions
in the sum computation of each of the pieces of the original polynomial
and then proceed to the next variable in each of the cells of this
common refinement.  This has the advantage that in each of those
cell a sum is only computed once.
However, the (current implementation of the) common refinement
computes differences of polytopes, which is rather costly.

Now, the sums are computed for each piece individually until
the deepest level and only at the very end is the common refinement
computed, in a lower-dimensional space.
This common refinement computation is therefore cheaper.
The disavantage is that a sum will be computed over the same
parameter values in different branches of the recursion tree.
However, these parameter values may be split over fewer pieces.
bernoulli.c