26 #ifndef MLN_FUN_MATH_NORM_HH
27 # define MLN_FUN_MATH_NORM_HH
29 # include <mln/fun/unary.hh>
30 # include <mln/norm/all.hh>
40 struct l1 : unary<l1> {};
42 struct l2 : unary<l2> {};
44 struct linfty : unary<linfty> {};
54 template <
unsigned n,
typename T>
55 struct set_precise_unary_<mln::fun::norm::l1, mln::algebra::vec<n, T> >
57 typedef set_precise_unary_ ret;
58 typedef mln::algebra::vec<n, T> argument;
59 typedef argument& lvalue;
60 typedef mln_sum_product(argument,argument) result;
62 static result read(const argument& x)
67 static void write(lvalue l,
const result& x)
73 template <
unsigned n,
typename T>
74 struct set_precise_unary_<mln::fun::norm::l2, mln::algebra::vec<n, T> >
76 typedef set_precise_unary_ ret;
77 typedef mln::algebra::vec<n, T> argument;
78 typedef argument& lvalue;
79 typedef mln_sum_product(argument,argument) result;
81 static result read(const argument& x)
86 static void write(lvalue l,
const result& x)
92 template <
unsigned n,
typename T>
93 struct set_precise_unary_<mln::fun::norm::linfty, mln::algebra::vec<n, T> >
95 typedef set_precise_unary_ ret;
96 typedef mln::algebra::vec<n, T> argument;
97 typedef argument& lvalue;
98 typedef mln_sum_product(argument,argument) result;
100 static result read(const argument& x)
105 static void write(lvalue l,
const result& x)