Solving Systems of Random Quadratic Equations via Truncated Amplitude Flow