1#ifndef STAN_MATH_PRIM_FUN_NORM2_HPP
2#define STAN_MATH_PRIM_FUN_NORM2_HPP
19template <
typename T, require_eigen_vt<std::is_arithmetic, T>* =
nullptr>
20inline double norm2(
const T& v) {
22 return v_ref.template lpNorm<2>();
33template <
typename Container, require_std_vector_t<Container>* =
nullptr>
34inline auto norm2(
const Container& x) {
35 return apply_vector_unary<Container>::reduce(
36 x, [](
const auto& v) {
return norm2(v); });
auto norm2(const Container &x)
Compute the L2 norm of the specified vector of values.
typename ref_type_if< true, T >::type ref_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...