Strassen's Subcubic Matrix Multiplication Algorithm
来源:互联网 发布:websock java 编辑:程序博客网 时间:2024/05/17 20:28
Consider multiplying two 2x2 matrices, as follows:
A B * E F = AE+BG AF+BHC D G H CE+DG CF+DH
The obvious way to compute the right side is just to do the 8 multiplies and 4 additions. But imagine multiplies are a lot more expensive than additions, so we want to reduce the number of multiplications if at all possible. Strassen uses a trick to compute the right hand side with one less multiply and a lot more additions (and some subtractions).
Here are the 7 multiplies:
M1 = (A + D) * (E + H) = AE + AH + DE + DHM2 = (A + B) * H = AH + BHM3 = (C + D) * E = CE + DEM4 = A * (F - H) = AF - AHM5 = D * (G - E) = DG - DEM6 = (C - A) * (E + F) = CE + CF - AE - AFM7 = (B - D) * (G + H) = BG + BH - DG - DH
So to compute AE+BG, start with M1+M7 (which gets us the AE and BG terms), then add/subtract some of the other Ms until AE+BG is all we are left with. Miraculously, the M's are chosen so that M1+M7-M2+M5 works. Same with the other 3 results required.
Now just realize this works not just for 2x2 matrices, but for any (even) sized matrices where the A..H are submatrices.
- Strassen's Subcubic Matrix Multiplication Algorithm
- Strassen’s algorithm for matrix multiplication
- Strassen's algorithm to compute matrix multiplication
- Implementation of Strassen’s Algorithm for Matrix Multiplication
- Strassen algorithm
- Strassen Algorithm
- Strassen Algorithm解析
- Matrix Multiplication
- Matrix Multiplication
- Matrix Multiplication
- Matrix Multiplication
- Matrix multiplication
- Matrix multiplication
- Strassen‘s 矩阵乘法
- Matrix Chain Multiplication
- zoj1094 Matrix Chain Multiplication
- Matrix chain multiplication problem
- POJ 3318 Matrix Multiplication
- Goldbach (2013长沙网赛G)
- Intrinsity Acquisition: Winners and Losers
- 如何获得第三方应用Widget的包名和类名,并将其放置到桌面
- VS2008 32位,win764位系统编译程序没问题,运行时出现“未找到msvcp100d.dll文件”
- 从零开始学win32编程
- Strassen's Subcubic Matrix Multiplication Algorithm
- Eclipse reports rendering library more recent than ADT plug-in.Please update ADT plug-in
- [开源工具]Visual Leak Detector 2.2.3 Visual C++内存检测工具
- 从零开始,重新学习windows编程(2)--环境准备,不用IDE编写程序
- 读曾仕强的《易经的奥秘》简摘
- eclipse编辑相关快捷键
- perl中数组的使用
- 关于制定计划
- 第三章 目标文件里有什么