[Numpy-discussion] linalg.py det of transpose

Warren Weckesser warren.weckesser@enthought....
Wed Dec 30 17:23:20 CST 2009


paul wrote:
> In numpy/linalg/linalg.py, the function det(a) does a fastCopyAndTranspose of a
> before calling lapack. Is that necessary as det(a.T) = det(a)?
>
>
>   

If you look further down in the function (or read the docstring), you'll 
see that det(a) computes the determinant by first performing an LU 
decomposition of the array.  It does this using the Lapack function 
dgetrf or zgetrf.  These functions perform the factorization 'in-place', 
so it is necessary to make a copy first.   I don't know why the 
"CopyAndTranspose" function is used--maybe it is faster--but, as you 
point out, the fact that the copy has been transposed should not affect 
the result.

Warren

> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>   



More information about the NumPy-Discussion mailing list