Function lup #
计算带部分主元的矩阵 LU 分解。矩阵 A 分解为两个矩阵(L, U)和一个行置换向量 p,其中 A[p,:] = L * U
Syntax #
math.lup(A)
Parameters #
| Parameter | Type | Description |
|---|---|---|
A |
矩阵 | 数组 | 用于获取 LUP 分解的二维矩阵或数组。 |
Returns #
| Type | Description |
|---|---|
| {L: Array | Matrix, U: Array | Matrix, P: Array.<number>} | 下三角矩阵、上三角矩阵和置换矩阵。 |
Throws #
Type | Description —- | ———–
Examples #
const m = [[2, 1], [1, 4]]
const r = math.lup(m)
// r = {
// L: [[1, 0], [0.5, 1]],
// U: [[2, 1], [0, 3.5]],
// P: [0, 1]
// }