Composition-dependent structural and magnetic properties of Ni–Mn–Ga alloys studied by ab initio calculations