sgd compiled, merge ps.cpp to ps.hpp.