def iddr_asvd(A, k):
 A = np.asfortranarray(A)
 (m, n) = A.shape
 w = np.empty(((((((2 * k) + 28) * m) + (((6 * k) + 21) * n)) + (25 * (k ** 2))) + 100), order='F')
 w_ = iddr_aidi(m, n, k)
 w[:w_.size] = w_
 (U, V, S, ier) = _id.iddr_asvd(A, k, w)
 if (ier != 0):
  raise _RETCODE_ERROR
 return (U, V, S)

def iddr_asvd ( A , k ) : A = np . asfortranarray ( A ) ( m , n ) = A . shape w = np . empty ( ( ( ( ( ( ( 2 * k ) + 28 ) * m ) + ( ( ( 6 * k ) + 21 ) * n ) ) + ( 25 * ( k ** 2 ) ) ) + 100 ) , order = 'F' ) w_ = iddr_aidi ( m , n , k ) w [ : w_ . size ] = w_ ( U , V , S , ier ) = _id . iddr_asvd ( A , k , w ) if ( ier != 0 ) : raise _RETCODE_ERROR return ( U , V , S )
compute svd of a real matrix to a specified rank using random sampling .