4#ifndef TETL_LINALG_BLAS1_VECTOR_TWO_NORM_HPP
5#define TETL_LINALG_BLAS1_VECTOR_TWO_NORM_HPP
7#include <etl/_cmath/sqrt.hpp>
8#include <etl/_linalg/concepts.hpp>
9#include <etl/_type_traits/declval.hpp>
10#include <etl/_utility/cmp_less.hpp>
15template <in_vector InVec,
typename Scalar>
19 for (
typename InVec::size_type i{0};
etl::cmp_less(i, v.extent(0)); ++i) {
20 auto const val = detail::abs_if_needed(v(i));
21 auto const square = val * val;
26 return static_cast<Scalar>(sqrt(sum));
30template <in_vector InVec>
33 using abs_type =
decltype(detail::abs_if_needed(declval<
typename InVec::value_type>()));
34 using value_type =
decltype(declval<abs_type>() * declval<abs_type>());
35 return vector_two_norm(v, value_type{});
constexpr auto vector_two_norm(InVec v, Scalar init) noexcept -> Scalar
Definition blas1_vector_two_norm.hpp:16
constexpr auto vector_two_norm(InVec v) noexcept -> typename InVec::value_type
Definition blas1_vector_two_norm.hpp:31
Definition accessor_conjugate.hpp:13
Definition adjacent_find.hpp:9