- 1
- 0
- 约2.32千字
- 约 12页
- 2019-04-28 发布于福建
- 举报
计算方式方程组a
第二章 解线性方程组的直接法 /* Direct Method for Solving Linear Systems */ 求解 克莱姆法则 /* Cramer’s Rule */ 2.1 高斯消元法 /* Gaussian Elimination */ 2.1 Gaussian Elimination 例 求解以下方程组: 解:采用增广矩阵/* augmented matrix */描述求解过程: 思路 首先将A化为上三角阵 /* upper-triangular matrix */,再回代求解 /* backward substitution */。 = 消元 记 其中 Step 1:设 ,计算因子 将增广矩阵第 i 行 ? mi1 ? 第1行,得到 2.1 Gaussian Elimination 第k步消元: 2.1 Gaussian Elimination 共进行 ? 步 n ? 1 回代 2.1 Gaussian Elimination 2.1.2程序设计 /* Progran Design */ 使用一维和二维数组。 What if ? No unique solution exists. What if ? 2.1 Gaussian Elimination 小主元 /* Small pivot element */ 可能导致计算失败。 2.1.3 选主元消去法 /* Pivoting Strategies */ 例:单精度解方程组 /* 精确解为 和 */ 8个 8个 用Gaussian Elimination计算: 8个 2.1 Gaussian Elimination ? 对策 ? 列主元消去法 /* Partial Pivoting, or maximal column pivoting */ 在每一步消元之前,针对所有的 ,选其中绝对值最大者作为主元素,即除数,把它所在的方程换到第k行,再按高斯法消元。 2.1 Gaussian Elimination ?程序设计 如何与高斯消去法衔接? 2.1 Gaussian Elimination ? 全主元消去法 /* Complete Pivoting */ 在第k步消元前,对 的全体进行选主元,选绝对值最大者为主元,再经过换行与换列,把它换到第k行、第k列作除数。 ? 程序设计由同学们自己完成 2.1 Gaussian Elimination 2.1 Gaussian Elimination – Amount of Computation Lab 05. Matrix Inversion Use Gauss-Jordan Method with Partial Pivoting to find the inverse of a given matrix. Input There are several sets of inputs. For each set: The 1st line contains an integer 100 ? n ? 0 which is the size of a matrix. n = ?1 signals the end of file. The 2nd line contains n?n real numbers which are the entries of the matrix. The numbers are separated by spaces or new lines. Output Each entry of the inverse matrix is to be printed as in the C fprintf: fprintf(outfile, %16.8e?, a ); /* here ? represents a space*/ 2.1 Gaussian Elimination – Amount of Computation The entries of an n?n matrix are to be printed in the following format: If the matrix is not invertable, print the message “The?matrix?is? singular.\n”. The outputs of two test
您可能关注的文档
最近下载
- 云南省2024年中考地理试卷附解析答案.pdf VIP
- 青年拔尖人才支持计划自然科学类申报书-广东石油化工学院.pdf VIP
- 医学影像学第一节食管与胃肠道影像学.pptx VIP
- 电力安全操作规程培训课件.pptx VIP
- 一锅法铜催化合成苯并硒唑类衍生.doc VIP
- 病人突发心脏骤停的应急预案演练脚本(2篇).docx
- OECD -二十国集团 经合组织公司治理原则2023.docx
- 2026年树立和践行正确政绩观专题研讨个人发言材料+“一把手”在树立和践行正确政绩观学习教育读书班开班式上的讲话.docx VIP
- 2023年江西新余中考历史真题及答案.doc VIP
- 2025年江西新能源科技职业学院单招职业技能测试题库及完整答案1套.docx VIP
原创力文档

文档评论(0)