4#ifndef TETL_LINALG_BLAS1_MATRIX_FROB_NORM_HPP
5#define TETL_LINALG_BLAS1_MATRIX_FROB_NORM_HPP
7#include <etl/_cmath/sqrt.hpp>
8#include <etl/_linalg/exposition.hpp>
9#include <etl/_type_traits/declval.hpp>
14template <in_matrix InMat,
typename Scalar>
18 for (
typename InMat::index_type row{0}; row < a.extent(0); ++row) {
19 for (
typename InMat::index_type col{0}; col < a.extent(1); ++col) {
20 result += detail::abs_if_needed(a(row, col));
25 return static_cast<Scalar>(sqrt(result));
29template <in_matrix InMat>
32 using abs_type =
decltype(detail::abs_if_needed(declval<
typename InMat::value_type>()));
33 using return_type =
decltype(declval<abs_type>() * declval<abs_type>());
34 return matrix_frob_norm(a, return_type{});
constexpr auto matrix_frob_norm(InMat a, Scalar init) -> Scalar
Definition blas1_matrix_frob_norm.hpp:15
constexpr auto matrix_frob_norm(InMat a)
Definition blas1_matrix_frob_norm.hpp:30
Definition accessor_conjugate.hpp:13
Definition adjacent_find.hpp:9