# jama-ets **Repository Path**: myqin20/jama-ets ## Basic Information - **Project Name**: jama-ets - **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**: 2022-08-31 - **Last Updated**: 2022-09-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # jama ## 简介 > 基本线性代数包,用于构造和操作真实密集矩阵的库。 ![preview.gif](preview/preview.gif) ## 下载安装 ```shell npm install @ohos/jama --save ``` OpenHarmony npm环境配置等更多内容,请参考 [如何安装OpenHarmony npm包](https://gitee.com/openharmony-tpc/docs/blob/master/OpenHarmony_npm_usage.md) 。 ## 使用说明 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()` ## 兼容性 支持 OpenHarmony API version 9 及以上版本。 ## 目录结构 ```` |---- jama-ets | |---- 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-ets/issues) 给我们,当然,我们也非常欢迎你给我们发 [PR](https://gitee.com/openharmony-sig/jama-ets/pulls) 。 ## 开源协议 本项目基于 [Apache License 2.0](https://gitee.com/openharmony-sig/jama-ets/blob/master/LICENSE) ,请自由地享受和参与开源。