26 #ifndef MLN_CORE_INTERNAL_COORD_IMPL_HH
27 # define MLN_CORE_INTERNAL_COORD_IMPL_HH
34 # include <mln/core/internal/force_exact.hh>
51 template <
unsigned n,
typename C,
typename E>
54 template <
typename C,
typename E>
55 struct coord_impl_<1, C, E>
59 typedef coord_impl_<1, C, E> self_;
63 template <
typename C,
typename E>
64 struct coord_impl_<2, C, E>
70 template <
typename C,
typename E>
71 struct coord_impl_<3, C, E>
81 template <
unsigned n,
typename C,
typename E>
82 struct mutable_coord_impl_;
84 template <
typename C,
typename E>
85 struct mutable_coord_impl_<1, C, E>
91 template <
typename C,
typename E>
92 struct mutable_coord_impl_<2, C, E>
100 template <
typename C,
typename E>
101 struct mutable_coord_impl_<3, C, E>
103 const C& sli()
const;
105 const C& row()
const;
107 const C& col()
const;
112 # ifndef MLN_INCLUDE_ONLY
118 template <
typename C,
typename E>
120 const C& coord_impl_<1, C, E>::ind()
const
122 return internal::force_exact<E>(*this)[0];
127 template <
typename C,
typename E>
129 const C& coord_impl_<2, C, E>::row()
const
131 return internal::force_exact<E>(*this)[0];
134 template <
typename C,
typename E>
136 const C& coord_impl_<2, C, E>::col()
const
138 return internal::force_exact<E>(*this)[1];
143 template <
typename C,
typename E>
145 const C& coord_impl_<3, C, E>::sli()
const
147 return internal::force_exact<E>(*this)[0];
150 template <
typename C,
typename E>
152 const C& coord_impl_<3, C, E>::row()
const
154 return internal::force_exact<E>(*this)[1];
157 template <
typename C,
typename E>
159 const C& coord_impl_<3, C, E>::col()
const
161 return internal::force_exact<E>(*this)[2];
169 template <
typename C,
typename E>
171 const C& mutable_coord_impl_<1, C, E>::ind()
const
173 return internal::force_exact<E>(*this)[0];
176 template <
typename C,
typename E>
178 C& mutable_coord_impl_<1, C, E>::ind()
180 return internal::force_exact<E>(*this)[0];
185 template <
typename C,
typename E>
187 const C& mutable_coord_impl_<2, C, E>::row()
const
189 return internal::force_exact<E>(*this)[0];
192 template <
typename C,
typename E>
194 C& mutable_coord_impl_<2, C, E>::row()
196 return internal::force_exact<E>(*this)[0];
199 template <
typename C,
typename E>
201 const C& mutable_coord_impl_<2, C, E>::col()
const
203 return internal::force_exact<E>(*this)[1];
206 template <
typename C,
typename E>
208 C& mutable_coord_impl_<2, C, E>::col()
210 return internal::force_exact<E>(*this)[1];
215 template <
typename C,
typename E>
217 const C& mutable_coord_impl_<3, C, E>::sli()
const
219 return internal::force_exact<E>(*this)[0];
222 template <
typename C,
typename E>
224 C& mutable_coord_impl_<3, C, E>::sli()
226 return internal::force_exact<E>(*this)[0];
229 template <
typename C,
typename E>
231 const C& mutable_coord_impl_<3, C, E>::row()
const
233 return internal::force_exact<E>(*this)[1];
236 template <
typename C,
typename E>
238 C& mutable_coord_impl_<3, C, E>::row()
240 return internal::force_exact<E>(*this)[1];
243 template <
typename C,
typename E>
245 const C& mutable_coord_impl_<3, C, E>::col()
const
247 return internal::force_exact<E>(*this)[2];
250 template <
typename C,
typename E>
252 C& mutable_coord_impl_<3, C, E>::col()
254 return internal::force_exact<E>(*this)[2];
257 # endif // ! MLN_INCLUDE_ONLY
264 #endif // ! MLN_CORE_INTERNAL_COORD_IMPL_HH