added a unit test for JADiag and ifdefs for eigen3