Commit 984cd2d1 authored by bianucci's avatar bianucci

Add the squared 2-norm of a Point, with the norm2() method.

parent 0c3cdf5a
......@@ -232,6 +232,21 @@ template<unsigned int dim ,typename T> class Point
return sqrt(n);
}
/*! \brief Compute the squared 2-norm of the vector
*
* \return the squared 2-norm of the vector
*
*/
__device__ __host__ T norm2()
{
T n = 0.0;
for (size_t i = 0 ; i < dim ; i++)
n+=get(i) * get(i);
return n;
}
/*! \brief It calculate the distance between 2 points
*
* The distance between itself (p) and the other point (q)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment