def iddr_aid(A, k):
A = np.asfortranarray(A)<EOL>m, n = A.shape<EOL>w = iddr_aidi(m, n, k)<EOL>idx, proj = _id.iddr_aid(A, k, w)<EOL>if k == n:<EOL><INDENT>proj = np.array([], dtype='<STR_LIT>', order='<STR_LIT:F>')<EOL><DEDENT>else:<EOL><INDENT>proj = proj.reshape((k, n-k), order='<STR_LIT:F>')<EOL><DEDENT>return idx, proj<EOL>
Compute ID of a real matrix to a specified rank using random sampling.

:param A:
    Matrix.
:type A: :class:`numpy.ndarray`
:param k:
    Rank of ID.
:type k: int

:return:
    Column index array.
:rtype: :class:`numpy.ndarray`
:return:
    Interpolation coefficients.
:rtype: :class:`numpy.ndarray`