coord: use self-dot-product for norm2

This commit is contained in:
Danny Robson 2016-12-21 20:21:40 +11:00
parent c91e1d29c3
commit 3dd80be05a

View File

@ -448,10 +448,7 @@ namespace util {
T
norm2 (const K<S,T> &k)
{
T sum = T{0};
for (auto &t: k)
sum += t * t;
return sum;
return dot (k, k);
}