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

📄 sample3_13.java

📁 实现用于工程计算的的数学方法
💻 JAVA
字号:
/*
 * 示例程序Sample3_13: Matrix类的求广义逆的奇异值分解法
 */
package javaalgorithm.sample;

import javaalgorithm.algorithm.Matrix;

public class Sample3_13 
{
	public static void main(String[] args) 
	{
		// 矩阵数据
		double[] mtxData14 = {
				1.0,2.0,3.0,4.0,
				6.0,7.0,8.0,9.0,
				1.0,2.0,13.0,0.0,
				16.0,17.0,8.0,9.0,
				2.0,4.0,3.0,4.0};

		// 构造矩阵
		Matrix mtx14 = new Matrix(5, 4, mtxData14);

		// 求广义逆的奇异值分解法
		Matrix mtxAP = new Matrix();
		Matrix mtxU2 = new Matrix();
		Matrix mtxV2 = new Matrix();
		if (mtx14.invertUV(mtxAP, mtxU2, mtxV2, 0.0001))
		{
			System.out.println("分解后的U矩阵=");
			System.out.println(mtxU2);
			System.out.println("-------------------------------"); 
			System.out.println("分解后的V矩阵=");
			System.out.println(mtxV2);
			System.out.println("-------------------------------"); 
			System.out.println("分解后的广义逆矩阵=");
			System.out.println(mtxAP);
		}
		else
		{
			System.out.println("失败");
		}
	}
}

⌨️ 快捷键说明

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