Linear and partial-linear realization of automata