A General Algorithm for Solving Rank-one Matrix Sensing