Excel使用什么算法来重新计算公式? [英] What algorithm does Excel use to recalculate formulas?

查看:151
本文介绍了Excel使用什么算法来重新计算公式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

语法树中表示的公式然后使用访问者等设计模式重新计算模式?你如何去重现代码中的重新计算过程?

Are the formulas represented in a syntax tree then recalculated using a design pattern like the Visitor pattern? How would you go about reproducing the recalculation process in code?

推荐答案

可能,正如你所说,有一个猜测是Excel创建一个一组AST,每个独立的单元格组,其中叶是源,静态数据和节点的公式。

Probably, as you say, one guess is that Excel creates a bunch of ASTs, one for each indipendent group of cells, where the leaves are the originating, static data, and the nodes are formulas.

然后它计算每个节点,具有后订单树遍历算法。

Then it calculates the result for each node, with a post-order tree traversal algorithm.

您必须考虑到叶/节点取消,部分重新计算,ecc。如果我没有错,我会读到Excel可能会受益于多核处理器并行重新计算一张表。

You have to take into account leaf/node cancellation, partial recalculation, ecc. If I'm not wrong, I read somewhere that Excel could benefit of multicore processors to recalculate a sheet in parallel.

这篇关于Excel使用什么算法来重新计算公式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆