📄 sample3_10.cs
字号:
/*
* 示例程序Sample3_10: Matrix类的矩阵的三角分解
*/
using System;
using CSharpAlgorithm.Algorithm;
namespace CSharpAlgorithm.Sample
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
// 矩阵数据
double[] mtxData11 = {
2.0,4.0,4.0,2.0,
3.0,3.0,12.0,6.0,
2.0,4.0,-1.0,2.0,
4.0,2.0,1.0,1.0};
// 构造矩阵
Matrix mtx11 = new Matrix(4, mtxData11);
// 矩阵的三角分解
Matrix mtxL = new Matrix();
Matrix mtxU = new Matrix();
if (mtx11.SplitLU(mtxL, mtxU))
{
Console.WriteLine("分解后的L矩阵=");
Console.WriteLine(mtxL);
Console.WriteLine("-------------------------------");
Console.WriteLine("分解后的U矩阵=");
Console.WriteLine(mtxU);
}
else
{
Console.WriteLine("失败");
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -