Calculation of the optimized Cd-Mg phase diagram with CPH ordering transitions using cluster variation method