xorbits.numpy.linalg.det#

xorbits.numpy.linalg.det(a)#

Compute the determinant of an array.

参数

a ((..., M, M) array_like) – Input array to compute determinants for.

返回

det – Determinant of a.

返回类型

(…) array_like

参见

slogdet

Another way to represent the determinant, more suitable for large matrices where underflow/overflow may occur.

scipy.linalg.det

Similar function in SciPy.

提示

1.8.0(numpy.linalg) 新版功能.

Broadcasting rules apply, see the numpy.linalg documentation for details.

The determinant is computed via LU factorization using the LAPACK routine z/dgetrf.

实际案例

The determinant of a 2-D array [[a, b], [c, d]] is ad - bc:

>>> a = np.array([[1, 2], [3, 4]])  
>>> np.linalg.det(a)  
-2.0 # may vary

Computing determinants for a stack of matrices:

>>> a = np.array([ [[1, 2], [3, 4]], [[1, 2], [2, 1]], [[1, 3], [3, 1]] ])  
>>> a.shape  
(3, 2, 2)
>>> np.linalg.det(a)  
array([-2., -3., -8.])

警告

This method has not been implemented yet. Xorbits will try to execute it with numpy.linalg.

This docstring was copied from numpy.linalg.