added support for eigen map in least squares