对于大小为 kxk 的矩阵,Strassen 算法需要进行多少次浮点运算?

发布于 2024-08-07 14:00:45 字数 173 浏览 2 评论 0原文

我试图理解 对乘 kxk 矩阵的 Strassen 算法的分析。但我仍然不太清楚涉及多少操作。有人可以帮忙澄清一下吗?

I am trying to understand this analysis of Strassen's algorithm for multiply k x k matrices. But I am still not too sure how many operations are invovled. Can someone help clarify this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

陪你到最终 2024-08-14 14:00:45

执行的操作的数量确定如下。首先,我们将矩阵分成四个大小为 k/2 的子矩阵,然后对这些矩阵执行七次递归乘法。然后,我们不断添加这些产品以获得我们想要的结果。这给我们一个定义如下的递推关系:

T(1) = 1

T(k) = 7T(k/2) + ck2

注意 lg 7 > 2,因为lg 7 > lg 4 = 2。(这里,lg 是二进制对数)。因此,根据主定理之一,算法的渐近复杂度为 O(klg 7) ≈ O(k2.807)。

希望这有帮助!

The number of operations performed is determined as follows. First, we split the matrix up into four sub strives of size at k/2, and then perform seven recursive multiplications of those matrices. We then do a constant number of additions of those products to get our desired result. This gives us a recurrence relation defined as follows:

T(1) = 1

T(k) = 7T(k/2) + ck2

Note that lg 7 > 2, since lg 7 > lg 4 = 2. (Here, lg is the binary logarithm). Thus by case one of the Master theorem, the asymptotic complexity of the algorithm is O(klg 7) ≈ O(k2.807).

Hope this helps!

生活了然无味 2024-08-14 14:00:45

鉴于页面上说它大约是 O(N^2.807...) 我猜这将是浮点运算数量的一个很好的近似值。所有循环/迭代都将使用整数运算。

Given the page says it is approximately O(N^2.807...) I would guess that would be a good approximation of the number of floating-point operations. All the looping/iterating will be with integer operations.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文