函数 lu
可以计算矩阵的 LU 分解,并返回一个元组 (L, U, P)
。其中,L 为下三角矩阵,U 为上三角矩阵,P 为置换矩阵。
(open3d.core.Tensor).lu(pivoting: bool = True) -> Tuple[open3d.core.Tensor, open3d.core.Tensor, open3d.core.Tensor]
pivoting
(bool, optional) – 是否使用部分主元选取。默认为 True
。(L, U, P)
(tuple of Tensor) – LU 分解结果。import open3d.core as o3c
a = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
A = o3c.Tensor(a)
L, U, P = A.lu()
print("L:", L)
print("U:", U)
print("P:", P)
L: tensor([[ 1.0000, 0.0000, 0.0000],
[ 0.1429, 1.0000, 0.0000],
[ 0.5714, -0.5000, 1.0000]])
U: tensor([[ 7.0000, 8.0000, 9.0000],
[ 0.0000, 0.8571, 1.7143],
[ 0.0000, 0.0000, -0.5000]])
P: tensor([[0., 1., 0.],
[0., 0., 1.],
[1., 0., 0.]])