scipy.linalg.cho_solve

scipy.linalg.cho_solve(c_and_lower, b, overwrite_b=False, check_finite=True)[源代码]

给定A的Cholesky因式分解,求解线性方程Ax=b。

参数
(C,更低)元组,(数组,布尔值)

由Cho_factor给出的a的Cholesky因子分解

b阵列

右手边

overwrite_b布尔值,可选

是否覆盖b中的数据(可能会提高性能)

check_finite布尔值,可选

是否检查输入矩阵是否仅包含有限个数字。禁用可能会带来性能提升,但如果输入确实包含无穷大或NAN,则可能会导致问题(崩溃、非终止)。

退货
x阵列

系统Ax=b的解

参见

cho_factor

矩阵的Cholesky分解

示例

>>> from scipy.linalg import cho_factor, cho_solve
>>> A = np.array([[9, 3, 1, 5], [3, 7, 5, 1], [1, 5, 9, 2], [5, 1, 2, 6]])
>>> c, low = cho_factor(A)
>>> x = cho_solve((c, low), [1, 1, 1, 1])
>>> np.allclose(A @ x - [1, 1, 1, 1], np.zeros(4))
True