The crystallographic, magnetic and electronic structures of the ferromagnetic shape memory alloys ( , Fe, and Co), are systematically investigated by means of the first–principles calculations within the framework of density functional theory using the VIENNA AB INITIO SOFTWARE PACKAGE. The lattice parameters of both austenitic and martensitic phases in have been calculated. The formation energies of the cubic phase of are estimated, and show a destabilization tendency if Mn atom is substituted by Fe or Co. From to , the down spin total density of states (DOS) at Fermi level is gradually increasing, whereas that of the up spin part remains almost unchanged. This is the main origin of the difference of the magnetic moment in these alloys. The partial DOS is dominated by the Ni and states in the bonding region below . There are two bond types existing in : one is between neighboring Ni atoms in ; the other is between Ni and X atoms in and alloys.