⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sample4_16.cs

📁 用于矩阵的各种运算
💻 CS
字号:
/*
 * 示例程序Sample4_16: LEquations类的病态方程组的求解
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            // 系数矩阵数据
            double[] mtxDataCoef15 = {
                                         3.4336,-0.5238,0.67105,-0.15272,
                                         -0.5238,3.28326,-0.73051,-0.2689,
                                         0.67105,-0.73051,4.02612,0.01835,
                                         -0.15272,-0.2689,0.01835,2.75702};
            // 常数矩阵数据
            double[] mtxDataConst15 = {
                                          -1.0,
                                          1.5,
                                          2.5,
                                          -2.0};
		
            // 构造系数矩阵
            Matrix mtxCoef15 = new Matrix(4, mtxDataCoef15);
            // 构造常数矩阵
            Matrix mtxConst15 = new Matrix(4, 1, mtxDataConst15);

            // 构造线性方程组
            LEquations leqs15 = new LEquations(mtxCoef15, mtxConst15);
		
            // 病态方程组的求解
            Matrix mtxResult15 = new Matrix();
            if (leqs15.GetRootsetMorbid(mtxResult15, 60, 0.0001))
            {
                Console.WriteLine(mtxResult15);
            }
            else
            {
                Console.WriteLine("失败");
            }
        }
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -