8 #ifndef SIG_UTIL_NORM_HPP
9 #define SIG_UTIL_NORM_HPP
12 #include "../calculation/binary_operation.hpp"
33 std::accumulate(
std::begin(vec),
std::end(vec), static_cast<T>(0), [&](T
sum, T val){
return sum + std::pow(std::abs(val), P); }),
38 template <
class C1,
class C2>
95 if(std::abs(e) > max) max = std::abs(e);
100 template <
class C1,
class C2>
const Norm< 2 > norm_L2
L2ノルムを求める関数(関数オブジェクト)
auto end(C &&c) -> std::move_iterator< typename RC::iterator >
bool is_comparable(C1 const &v1, C2 const &v2, impl::NumericVectorTag)
2つのベクトルが比較可能か確認
const Norm< 1 > norm_L1
L1ノルムを求める関数(関数オブジェクト)
double operator()(C const &vec) const
double operator()(C1 const &vec1, C2 const &vec2) const
auto minus(T1 &&v1, T2 &&v2) -> decltype(binary_operation(minus_t(), std::forward< T1 >(v1), std::forward< T2 >(v2)))
double operator()(C1 const &vec1, C2 const &vec2) const
const MaxNorm norm_max
最大ノルムを求める関数(関数オブジェクト)
double operator()(C const &vec) const
auto sum(C const &data) -> typename impl::SameIf< R, void, typename impl::container_traits< C >::value_type, R >::type
総和
auto begin(C &&c) -> std::move_iterator< typename RC::iterator >