8 #ifndef SIG_UTIL_BINARY_DISTANCE_HPP
9 #define SIG_UTIL_BINARY_DISTANCE_HPP
19 template <
class C1,
class C2,
20 typename =
typename std::enable_if<std::is_integral<typename impl::container_traits<C1>::value_type>::value>::type,
21 typename =
typename std::enable_if<std::is_integral<typename impl::container_traits<C2>::value_type>::value>::type
27 int ether = 0, both = 0;
31 for (; it1 != end1 && it2 != end2; ++it1, ++it2){
32 if (*it1 == 1 && *it2 == 1) ++both;
33 else if (*it1 == 1 || *it2 == 1) ++ether;
35 return static_cast<double>(ether) / (ether + both);
auto end(C &&c) -> std::move_iterator< typename RC::iterator >
bool is_comparable(C1 const &v1, C2 const &v2, impl::NumericVectorTag)
2つのベクトルが比較可能か確認
double operator()(C1 const &vec1, C2 const &vec2) const
const BinaryDistance binary_distance
バイナリ距離を求める関数(関数オブジェクト)
auto begin(C &&c) -> std::move_iterator< typename RC::iterator >