[Numpy-discussion] Possible bug in linalg.matrix_rank

Darlan Cavalcante Moreira darcamo at gmail.com
Thu May 22 13:50:09 EDT 2014


After updating Ubuntu to 14.04 and thus numpy to version 1.8.1 I'm
having problems with the linalg.matrix_rank function that I didn't have
before (as far as I know).

More specifically, I get the error
"TypeError: No loop matching the specified signature was found for ufunc svd_m"
when I try to calculate the rank of a non-square complex matrix, but it does not
happen for any non-square matrix.


Below you can find the cases tyhat work and the case that doesn't work.

--8<---------------cut here---------------start------------->8---
# Real matrices
A = np.random.randn(3,3);
A = np.random.randn(4,3);
A = np.random.randn(3,4);
np.linalg.matrix_rank(A) # Works for any of the previous 'A' matrices

# Complex matrices
A = np.random.randn(3,3) + 1j*np.random.randn(3,3);
A = np.random.randn(4,3) + 1j*np.random.randn(4,3);
np.linalg.matrix_rank(A) # Works for any of the previous 'A' matrices

# For the matrix below I get the error
A = np.random.randn(3,4) + 1j*np.random.randn(3,4);
np.linalg.matrix_rank(A) # Does not work and gives me the TypeError
--8<---------------cut here---------------end--------------->8---


-- 
Darlan Cavalcante Moreira
darcamo at gmail.com



More information about the NumPy-Discussion mailing list