Structural transitions, magnetic properties, and electronic structures of Co(Fe)-doped MnNiSi compounds