函数 pinv #
计算矩阵的 Moore–Penrose 伪逆。
Syntax #
math.pinv(x)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
number | Complex | Array | Matrix | 要进行求逆的矩阵 |
Returns #
| Type | Description |
|---|---|
| number | Complex | Array | Matrix | x 的逆。 |
Throws #
Type | Description —- | ———–
Examples #
math.pinv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]
math.pinv([[1, 0], [0, 1], [0, 1]]) // returns [[1, 0, 0], [0, 0.5, 0.5]]
math.pinv(4) // returns 0.25