don't using namespace Eigen in header file

also fix an infinite loop