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

📄 sample4_8.cs

📁 用于矩阵的各种运算
💻 CS
字号:
/*
 * 示例程序Sample4_8: LEquations类的求解对称方程组的分解法
 */

using System;
using CSharpAlgorithm.Algorithm;

namespace CSharpAlgorithm.Sample
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
            // 系数矩阵数据
            double[] mtxDataCoef7 = {
                                        5.0,7.0,6.0,5.0,1.0,
                                        7.0,10.0,8.0,7.0,2.0,
                                        6.0,8.0,10.0,9.0,3.0,
                                        5.0,7.0,9.0,10.0,4.0,
                                        1.0,2.0,3.0,4.0,5.0};
            // 常数矩阵数据
            double[] mtxDataConst7 = {
                                         24.0,96.0,
                                         34.0,136.0,
                                         36.0,144.0,
                                         35.0,140.0,
                                         15.0,60.0};
		
            // 构造系数矩阵
            Matrix mtxCoef7 = new Matrix(5, mtxDataCoef7);
            // 构造常数矩阵
            Matrix mtxConst7 = new Matrix(5, 2, mtxDataConst7);

            // 构造线性方程组
            LEquations leqs7 = new LEquations(mtxCoef7, mtxConst7);
		
            // 求解对称方程组的分解法
            Matrix mtxResult7 = new Matrix();
            if (leqs7.GetRootsetDjn(mtxResult7))
            {
                Console.WriteLine(mtxResult7);
            }
            else
            {
                Console.WriteLine("失败");
            }
        }
	}
}

⌨️ 快捷键说明

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