add cpp code of MC_SGD.m