I'm not sure why they wrote this in the first place. Eigen's MatrixBase already has a squaredNorm function: http://eigen.tuxfamily.org/dox/classEigen_1_1MatrixBase.html...
edit: I see, they address this in the article: In this specific case the Eigen library has the squared L2-norm in its API, but in more complicated examples there might be no such built-in provision