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

📄 sample3_11.java

📁 《Java数值计算算法编程》随书代码 已生成DOCS说明文件
💻 JAVA
字号:
/*
 * 示例程序Sample3_11: Matrix类的一般实矩阵的QR分解
 */
package javaalgorithm.sample;

import javaalgorithm.algorithm.Matrix;

public class Sample3_11 
{
	public static void main(String[] args) 
	{
		// 矩阵数据
		double[] mtxData12 = {
				1.0,1.0,-1.0,
				2.0,1.0,0.0,
				1.0,-1.0,0.0,
				-1.0,2.0,1.0};

		// 构造矩阵
		Matrix mtx12 = new Matrix(4, 3, mtxData12);

		// 一般实矩阵的QR分解
		Matrix mtxQ = new Matrix();
		if (mtx12.splitQR(mtxQ))
		{
			System.out.println("分解后的Q矩阵=");
			System.out.println(mtxQ);
			System.out.println("-------------------------------"); 
			System.out.println("分解后的R矩阵=");
			System.out.println(mtx12);
		}
		else
		{
			System.out.println("失败");
		}
	}
}

⌨️ 快捷键说明

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