title: Squared Euclidean distance with Row Major Matrix Eigen C++
body: <p>Due to the fact that i plan to pass numpy arrays into my C++ code with pybind11, naturally i would like to compute with Row Major matrices. I found a (one liner) implementation of the squared euclidean distance on stack</p>
  <pre><code>typedef Eigen::MatrixXd Matrix;
  void squared_dist(const Matrix&amp; X1, const Matrix&amp; X2, Matrix&amp; D) {
      D = ((-2 * X1.transpose() * X2).colwise() + X1.colwise().squaredNorm().transpose()).rowwise() + X2.colwise().squaredNorm();
  }
  </code></pre>
  <p>But this requires X1, X2, and D to be the default Column Major Matrix. How would i implement a similar one-liner for Row Major Matrices?</p>