26 #ifndef MLN_METAL_ARRAY_HH
27 # define MLN_METAL_ARRAY_HH
29 # include <mln/metal/array1d.hh>
30 # include <mln/metal/array2d.hh>
31 # include <mln/metal/array3d.hh>
41 template<
unsigned i,
class T,
unsigned n>
inline
44 return arr.template get_at_<i>();
47 template<
unsigned i,
class T,
unsigned n>
inline
48 T get(
const array1d<T, n>& arr)
50 return arr.template get_<i>();
55 template<
unsigned row,
unsigned col,
class T,
56 unsigned r,
unsigned c>
inline
59 return arr.template get_at_<row, col>();
62 template<
unsigned row,
unsigned col,
class T,
63 unsigned r,
unsigned c>
inline
64 T get(
const array2d<T, r, c>& arr)
66 return arr.template get_<row, col>();
71 template<
unsigned sli,
unsigned row,
unsigned col,
72 class T,
unsigned s,
unsigned r,
unsigned c>
inline
75 return arr.template get_at_<sli, row, col>();
78 template<
unsigned sli,
unsigned row,
unsigned col,
79 class T,
unsigned s,
unsigned r,
unsigned c>
inline
80 T get_(
const array3d<T, s, r, c>& arr)
82 return arr.template get_<sli, row, col>();
87 template<
typename T,
unsigned n>
88 std::ostream& operator<<(std::ostream& ostr, const array1d<T, n>&
rhs)
90 for (
unsigned i = 0; i < n; ++i)
91 ostr <<
rhs[i] <<
" ";
97 template<
typename T,
unsigned r,
unsigned c>
98 std::ostream& operator<<(std::ostream& ostr, const array2d<T, r, c>&
rhs)
100 for (
unsigned i = 0; i < r; ++i)
102 for (
unsigned j = 0; j < c; ++j)
103 ostr <<
rhs(i,j) <<
'\t';
115 #endif // ! MLN_METAL_ARRAY_HH