not use Eigen for matrix calculation