26 double Nd = (double)N;
27 Eigen::Map<Eigen::ArrayXd> m0(data[0].data(), N);
30 double xsq = m0.abs2().sum();
33 Eigen::Map<Eigen::ArrayXd> m_v(data[v].data(), N);
34 double ym = m_v.sum();
35 double ysq = m_v.abs2().sum();
36 double p = (m_v * m0).sum();
38 double norm = std::sqrt((xsq - Nd * xm * xm) * (ysq - Nd * ym * ym));
39 p = (p - Nd * xm * ym) / norm;