Low-rank combinatorial optimization and statistical learning by spatial photonic Ising machine