# jama **Repository Path**: yitian0918/jama ## Basic Information - **Project Name**: jama - **Description**: No description available - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 15 - **Created**: 2023-07-12 - **Last Updated**: 2023-07-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jama ## 简介 > 基本线性代数包,用于构造和操作真实密集矩阵的库。 ![preview.gif](preview/preview.gif) ## 下载安装 ```shell ohpm install @ohos/jama ``` ## 使用说明 1. 引入依赖 ``` import { Matrix } from '@ohos/jama' ``` 2. 创建矩阵 ``` let array: number[][] = [[1., 2., 3], [4., 5., 6.], [7., 8., 10.]] let A: Matrix = new Matrix(array); let b: Matrix = Matrix.random(3, 1); let x: Matrix = A.solve(b); let Residual: Matrix = A.times(x).minus(b); let rnorm: number = Residual.normInf(); ``` ## 接口说明 1. 生成具有随机元素的矩阵 `Matrix.random(m : number, n : number)` 2. Solve A*X = B `Matrix.solve(B : Matrix)` 3. 线性代数矩阵乘法,A * B `Matrix.times(B? : any)` 4. 计算矩阵值 `Matrix.normInf()` ## 约束与限制 在下述版本验证通过: DevEco Studio: 4.0 Canary1(4.0.0.112), SDK: API10 (4.0.7.3) ## 目录结构 ```` |---- jama | |---- entry # 示例代码文件夹 | |---- jama # jama库文件夹 | |---- src | |---- main | |---- ets | |---- util # 工具类文件 | |---- Maths.ts # 指数计算类 | |---- CholeskyDecomposition.ts # 乔列斯基分解类 | |---- EigenvalueDecomposition.ts # 矩阵的特征值和特征向量 | |---- LUDecomposition.ts # LU分解 | |---- Matrix.ts # 矩阵类 | |---- QRDecomposition.ts # QR分解 | |---- SingularValueDecomposition.ts # 奇异值分解 | |---- index.ets # 对外接口 | |---- README.md # 安装使用方法 ```` ## 贡献代码 使用过程中发现任何问题都可以提 [Issue](https://gitee.com/openharmony-sig/jama/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://gitee.com/openharmony-sig/jama/pulls) 。 ## 开源协议 本项目基于 [Apache License 2.0](https://gitee.com/openharmony-sig/jama/blob/master/LICENSE) ,请自由地享受和参与开源。