use Eigen for the decomposition of P

+ minor formatting