Skip to content

Commit 3debcf1

Browse files
authored
Add complex number support to linalg.matrix_rank (#563)
1 parent a1304fe commit 3debcf1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/API_specification/array_api/linalg.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@ def matrix_rank(x: array, /, *, rtol: Optional[Union[float, array]] = None) -> a
275275
"""
276276
Returns the rank (i.e., number of non-zero singular values) of a matrix (or a stack of matrices).
277277
278+
When ``x`` is a stack of matrices, the function must compute the number of non-zero singular values for each matrix in the stack.
279+
278280
Parameters
279281
----------
280282
x: array
281-
input array having shape ``(..., M, N)`` and whose innermost two dimensions form ``MxN`` matrices. Should have a real-valued floating-point data type.
283+
input array having shape ``(..., M, N)`` and whose innermost two dimensions form ``MxN`` matrices. Should have a floating-point data type.
282284
rtol: Optional[Union[float, array]]
283285
relative tolerance for small singular values. Singular values approximately less than or equal to ``rtol * largest_singular_value`` are set to zero. If a ``float``, the value is equivalent to a zero-dimensional array having a real-valued floating-point data type determined by :ref:`type-promotion` (as applied to ``x``) and must be broadcast against each matrix. If an ``array``, must have a real-valued floating-point data type and must be compatible with ``shape(x)[:-2]`` (see :ref:`broadcasting`). If ``None``, the default value is ``max(M, N) * eps``, where ``eps`` must be the machine epsilon associated with the real-valued floating-point data type determined by :ref:`type-promotion` (as applied to ``x``). Default: ``None``.
284286

0 commit comments

Comments
 (0)