29 #include <tests/norm/common.hh>
31 #include <mln/algebra/vec.hh>
32 #include <mln/norm/l2.hh>
37 template <
typename V,
typename S>
39 check_l2_norm_and_distance(
const V& vec1,
const V& vec2,
const S& ref_val)
42 typedef mln_sum_(
int) (*l2_t)(
const V&);
45 test::check_norm(l2, vec1, vec2);
48 typedef mln_sum_(
int) (*l2_distance_t)(
const V&,
const V&);
51 test::check_distance(l2_distance, vec1, vec2, ref_val);
58 typedef mln::algebra::vec<3, int> vec_t;
61 float d = std::sqrt(
float((4 - 2) * (4 - 2) +
69 test::check_l2_norm_and_distance(t, u, d);
74 test::check_l2_norm_and_distance(v, w, d);