freealg.cond#
- freealg.cond(A, N=None)#
Estimate the condition number of a Hermitian positive-definite matrix.
This function estimates the condition number of the matrix \(\mathbf{A}\) or a larger matrix containing \(\mathbf{A}\) using free decompression.
- Parameters:
- Anumpy.ndarray
The symmetric real-valued matrix \(\mathbf{A}\) whose condition number (or that of a matrix containing \(\mathbf{A}\)) are to be computed.
- Nint, default=None
The size of the matrix containing \(\mathbf{A}\) to estimate eigenvalues of. If None, returns estimates of the eigenvalues of \(\mathbf{A}\) itself.
- Returns:
- cfloat
Condition number
Notes
This is a convenience function using
freealg.eigh()
.Examples
>>> from freealg import cond >>> from freealg.distributions import MarchenkoPastur >>> mp = MarchenkoPastur(1/50) >>> A = mp.matrix(3000) >>> cond(A)