Check for error flag in rank_k_approximation().