Skip to content
Snippets Groups Projects
Commit 65032fa8 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Added l2Norm function

parent 6a4223eb
Branches
Tags
No related merge requests found
......@@ -238,4 +238,12 @@ public:
}
};
template <size_t N, typename T>
KOKKOS_INLINE_FUNCTION
T l2Norm(const TinyVector<N,T>& x)
{
static_assert(std::is_arithmetic<T>(),"Cannot compute L2 norm for non-arithmetic types");
return std::sqrt((x,x));
}
#endif // TINYVECTOR_HPP
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment