add eigen matrix computation tamplate