loda-cpp
loda-cpp copied to clipboard
Formula generation: reduce number of initial terms
In getNumInitialTermsNeeded() we use the number of stateful cells to estimate the number of needed initial terms. This is actually an overcount. We could reduce it by computing a dependency graph of the stateful cells and use the length of its longest path instead.
https://github.com/loda-lang/loda-cpp/blob/main/src/form/formula_gen.cpp#L194