- 1、本文档共28页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
算法设计(分治法-大整数、矩阵相乘)_48286
2007-2008-01《Design and Analysis of Algorithms》SCUEC Review of last class The difference between quick sort and merge sort Goals of the Lecture At the end of this lecture, you should Understand the algorithm based on DAC for solving large integers’ multiplication and its analysis Master the Strassen’s matrix multiplication algorithm and its analysis Know how to solve the triomino puzzle Multiplication of Large Integers The grade-school algorithm: a1 a2 … an b1 b2 … bn (d10) d11d12 … d1n (d20) d21d22 … d2n … … … … … … … (dn0) dn1dn2 … dnn Standard Algorithm based on DAC Improved Algorithm based on DAC Multiplication of Matrices Time complexity: T(n) = n3 + (n3 – n2) Standard Algorithm Based on Divide and Conquer Technique (I) Suppose we want to multiply matrices A and B, both of size n?n, and n = 2k, we can use divide and conquer technique to solve it. Standard Algorithm Based on Divide and Conquer Technique (II) So the result consists of computing C as defined by the following equation: Analysis of the algorithm Number of multiplications and additions T(n) = 8T(n/2) + 4(n/2)2 if n=2 T(1) = 1 Strassen’s Matrix Mutiplication Uses a set of seven formulas to multiply two 2?2 matrices The formulas do not rely on elements being commutative under multiplication, so the elements can be matrices It can be applied recursively, in other words, two 4 ? 4 matrices can be multiplied by treating each as a 2 ? 2 matrix of 2 ? 2 matrices Strassen’s Formulas (I) First we calculate a set of temporary values: m1 = (A1,1 + A2,2) * (B1,1 + B2,2) m2 = (A2,1 + A2,2) * B1,1 m3 = A1,1 * (B1,2 - B2,2) m4 = A2,2 * (B2,1 - B1,1) m5 = (A1,1 + A1,2) * B2,2 m6 = (A2,1 - A1,1) * (B1,1 + B1,2) m7 = (A1,2 - A2,2) * (B2,1 + B2,2) Strassen’s Formulas (II) Can you write out the strassen’s algorithm? (description) Algorithm analysis These formulas require 7 multiplications and 18 additions to multiply two 2 ? 2 matrices Standard vs DAC vs Strasse
您可能关注的文档
- 科尔伯格道德发展阶段理论对我国德育培养的启示_33438.doc
- 科尔沁达尔汗亲王(世袭表)_33440.doc
- 科尔沁1_33439.doc
- 科室院感制度_33467.doc
- 科学类文章阅读指导2011_33487.ppt
- 科技制作教案_33453.doc
- 科技史 隋唐五代_33451.ppt
- 科技查新咨询工作_33443.ppt
- 科技工作者应该有严谨的治学态度和实事求是的学术作风_33446.doc
- 科技论文写作4(量和单位)_33450.ppt
- 《GB/T 32151.42-2024温室气体排放核算与报告要求 第42部分:铜冶炼企业》.pdf
- GB/T 32151.42-2024温室气体排放核算与报告要求 第42部分:铜冶炼企业.pdf
- GB/T 38048.6-2024表面清洁器具 第6部分:家用和类似用途湿式硬地面清洁器具 性能测试方法.pdf
- 中国国家标准 GB/T 38048.6-2024表面清洁器具 第6部分:家用和类似用途湿式硬地面清洁器具 性能测试方法.pdf
- 《GB/T 38048.6-2024表面清洁器具 第6部分:家用和类似用途湿式硬地面清洁器具 性能测试方法》.pdf
- 《GB/T 18238.2-2024网络安全技术 杂凑函数 第2部分:采用分组密码的杂凑函数》.pdf
- GB/T 18238.2-2024网络安全技术 杂凑函数 第2部分:采用分组密码的杂凑函数.pdf
- 《GB/T 17215.686-2024电测量数据交换 DLMS/COSEM组件 第86部分:社区网络高速PLCISO/IEC 12139-1配置》.pdf
- GB/T 13542.4-2024电气绝缘用薄膜 第4部分:聚酯薄膜.pdf
- 《GB/T 13542.4-2024电气绝缘用薄膜 第4部分:聚酯薄膜》.pdf
文档评论(0)