Data Inference in Cloud Computing and Smart Grids: A Grassmann Manifold Approach