
https://svn.lrde.epita.fr/svn/oln/trunk/milena Index: ChangeLog from Thierry Geraud <thierry.geraud@lrde.epita.fr> Add the notion of concrete image associated type. New material for the notion of concrete images. * mln/trait: New. * mln/trait/image_from_mesh.hh: New. * mln/trait/concrete.hh: New. * mln/core/macros.hh (mln_ch_value): Remove; now in... * mln/trait/ch_value.hh: New. * tests/trait_ch_value.cc: New. * mln/tag: New directory. * mln/tag/skeleton.hh: New. Replace change_value by skeleton in images. * mln/core/concept/image.hh, * mln/core/concept/doc/image.hh (change_value): Remove. (skeleton): New. * mln/pw/image.hh, * mln/core/decorated_image.hh, * mln/core/image_if.hh, * mln/core/rle_image.hh, * mln/core/image2d_b.hh, * mln/core/cast_image.hh, * mln/core/safe.hh, * mln/core/sub_image.hh, * mln/core/sparse_image.hh, * mln/core/t_image.hh, * mln/core/image1d_b.hh, * mln/core/image3d_b.hh, * mln/value/stack.hh: Update. Misc. * tests/interpolated.cc: Typo. * mln/level/paste.hh (paste_pw_): Rename as... (paste_generic_): ...this. * tests/level_paste.cc: Update. mln/core/cast_image.hh | 11 +-- mln/core/concept/doc/image.hh | 19 ++---- mln/core/concept/image.hh | 13 ++-- mln/core/decorated_image.hh | 11 +-- mln/core/image1d_b.hh | 10 +-- mln/core/image2d_b.hh | 10 +-- mln/core/image3d_b.hh | 10 +-- mln/core/image_if.hh | 12 ++-- mln/core/macros.hh | 17 +---- mln/core/rle_image.hh | 11 +-- mln/core/safe.hh | 9 +-- mln/core/sparse_image.hh | 11 +-- mln/core/sub_image.hh | 9 +-- mln/core/t_image.hh | 11 --- mln/level/paste.hh | 4 - mln/pw/image.hh | 12 +--- mln/tag/skeleton.hh | 60 ++++++++++++++++++++ mln/trait/ch_value.hh | 126 ++++++++++++++++++++++++++++++++++++++++++ mln/trait/concrete.hh | 60 ++++++++++++++++++++ mln/trait/image_from_mesh.hh | 82 +++++++++++++++++++++++++++ mln/value/stack.hh | 12 +--- tests/level_paste.cc | 4 + tests/trait_ch_value.cc | 43 ++++++++++++++ 23 files changed, 449 insertions(+), 118 deletions(-) Index: tests/level_paste.cc --- tests/level_paste.cc (revision 1136) +++ tests/level_paste.cc (working copy) @@ -53,6 +53,8 @@ debug::iota(ima2); debug::println(ima2); - level::paste(ima, ima2); + level::paste(ima, ima2); // Fast version. debug::println(ima2); + + level::impl::paste_generic_(ima, ima2); // Not so fast version... } Index: tests/trait_ch_value.cc --- tests/trait_ch_value.cc (revision 0) +++ tests/trait_ch_value.cc (revision 0) @@ -0,0 +1,43 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +/*! \file tests/trait_ch_value.cc + * + * \brief Tests on mln::trait::ch_value. + */ + +#include <mln/core/image2d_b.hh> +#include <mln/trait/ch_value.hh> + + +int main() +{ + using namespace mln; + + typedef image2d_b<int> I; + trait::ch_value<I, bool>::ret ima; +} Index: tests/interpolated.cc Index: mln/trait/image_from_mesh.hh --- mln/trait/image_from_mesh.hh (revision 0) +++ mln/trait/image_from_mesh.hh (revision 0) @@ -0,0 +1,82 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_TRAIT_IMAGE_FROM_MESH_HH +# define MLN_TRAIT_IMAGE_FROM_MESH_HH + +/*! \file mln/core/trait/image_from_mesh.hh + * + * \brief Definition of the "image from mesh" trait. + */ + +# include <mln/core/grids.hh> + + +# define mln_image_from_mesh(I, V) typename mln::trait::image_from_mesh< I, V >::ret + + + +namespace mln +{ + + + // Fwd decls. + template <typename T> struct image1d_b; + template <typename T> struct image2d_b; + template <typename T> struct image3d_b; + + + namespace trait + { + + template <typename M, typename V> struct image_from_mesh; + + template <typename V> + struct image_from_mesh< grid::tick, V > + { + typedef image1d_b<V> ret; + }; + + template <typename V> + struct image_from_mesh< grid::square, V > + { + typedef image2d_b<V> ret; + }; + + template <typename V> + struct image_from_mesh< grid::cube, V > + { + typedef image3d_b<V> ret; + }; + + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_IMAGE_FROM_MESH_HH Index: mln/trait/concrete.hh --- mln/trait/concrete.hh (revision 0) +++ mln/trait/concrete.hh (revision 0) @@ -0,0 +1,60 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_TRAIT_CONCRETE_HH +# define MLN_TRAIT_CONCRETE_HH + +/*! \file mln/core/trait/concrete.hh + * + * \brief Definition of the concrete image trait. + */ + +# include <mln/trait/ch_value.hh> + + +# define mln_concrete(I) typename mln::trait::concrete< I >::ret + + +namespace mln +{ + + namespace trait + { + + template <typename I> + struct concrete + { + typedef typename I::value value; + typedef typename ch_value<I, value>::ret ret; + }; + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_CONCRETE_HH Index: mln/trait/ch_value.hh --- mln/trait/ch_value.hh (revision 0) +++ mln/trait/ch_value.hh (revision 0) @@ -0,0 +1,126 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_TRAIT_CH_VALUE_HH +# define MLN_TRAIT_CH_VALUE_HH + +/*! \file mln/core/trait/ch_value.hh + * + * \brief Definition of the "change value" image trait. + */ + +# include <mln/tag/skeleton.hh> +# include <mln/trait/image_from_mesh.hh> +# include <mln/metal/vec.hh> + + +# define mln_ch_value(I, V) typename mln::trait::ch_value< I, V >::ret + + + +namespace mln +{ + + namespace trait + { + + + template <typename I, typename V> struct ch_value; // Fwd decl. + + + namespace impl + { + + template <typename I, typename V> struct ch_value_; // Decl. + + template < template <class> class M, typename I, + typename V > + struct ch_value_< M< tag::image<I> >, V > + { + typedef M< mln_ch_value(I, V) > ret; + }; + + template < template <class> class M, typename T, + typename V > + struct ch_value_< M< tag::value<T> >, V > + { + typedef M< V > ret; + }; + + template < template <class, class> class M, typename T, typename I, + typename V > + struct ch_value_< M< tag::value<T>, tag::image<I> >, V > + { + typedef mln_ch_value(I, V) ret; + }; + + template < template <class, class> class M, typename P, typename T, + typename V > + struct ch_value_< M< tag::psite<P>, tag::value<T> >, V > + { + typedef M< P, V > ret; + }; + + template < template <class, class> class M, unsigned n, typename I, + typename V > + struct ch_value_< M< tag::unsigned_<n>, tag::image<I> >, V > // value::stack ! + { + typedef metal::vec<n, V> value; + typedef mln_ch_value(I, value) ret; + }; + + template < template <class, class> class M, typename I, typename S, + typename V > + struct ch_value_< M< tag::image<I>, tag::pset<S> >, V > + { + typedef M< mln_ch_value(I, V), S > ret; + }; + + template < template <class, class> class M, typename F, typename S, + typename V > + struct ch_value_< M< tag::function<F>, tag::pset<S> >, V > + { + typedef typename S::mesh mesh; + typedef typename image_from_mesh< mesh, V >::ret ret; // FIXME: from_psite instead? coord=int!? + }; + + } // end of namespace mln::trait::impl + + + template <typename I, typename V> + struct ch_value + { + typedef typename I::skeleton skeleton; + typedef typename impl::ch_value_<skeleton, V>::ret ret; + }; + + } // end of namespace mln::trait + +} // end of namespace mln + + +#endif // ! MLN_TRAIT_CH_VALUE_HH Index: mln/pw/image.hh --- mln/pw/image.hh (revision 1136) +++ mln/pw/image.hh (working copy) @@ -67,6 +67,11 @@ typedef internal::image_base_< S, image<F,S> > super_; public: + + /// Skeleton. + typedef image< tag::function<F>, tag::pset<S> > skeleton; + + // From super class. typedef mln_psite(super_) psite; @@ -106,13 +111,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. FIXME! - template <typename U> - struct change_value - { - typedef internal::fixme ret; - }; - protected: F f_; S pset_; Index: mln/core/macros.hh --- mln/core/macros.hh (revision 1136) +++ mln/core/macros.hh (working copy) @@ -184,18 +184,7 @@ - - -/*! \brief Shortcut to change the value type of an image type. - * - * \c I is an image type - * \c T is the new value type - */ -# define mln_ch_value(I, T) typename I ::template change_value< T >::ret - - - -// FIXME: Doc! +// FIXME: Just include trait/all.hh !!! # define mln_fwd_pixter(I) typename mln::trait::fwd_pixter< I >::ret # define mln_fwd_pixter_(I) mln::trait::fwd_pixter< I >::ret @@ -216,4 +205,8 @@ +# include <mln/trait/ch_value.hh> + + + #endif // ! MLN_CORE_MACROS_HH Index: mln/core/decorated_image.hh --- mln/core/decorated_image.hh (revision 1136) +++ mln/core/decorated_image.hh (working copy) @@ -77,17 +77,16 @@ typedef mln::value::proxy<const self_> rvalue; typedef typename impl_::lvalue lvalue; + + /// Skeleton. + typedef decorated_image< tag::image<I>, tag::data<D> > skeleton; + + rvalue operator()(const mln_psite(I)& p) const; lvalue operator()(const mln_psite(I)& p); mln_value(I) read_(const mln_psite(I)& p) const; - template <typename V> - struct change_value - { - typedef decorated_image<mln_ch_value(I, V), D> ret; - }; - /// Const promotion via convertion. operator decorated_image<const I, D>() const; Index: mln/core/image_if.hh --- mln/core/image_if.hh (revision 1136) +++ mln/core/image_if.hh (working copy) @@ -48,6 +48,11 @@ image_if<I,F>, pset_if<mln_pset(I),F> > { + + /// Skeleton. + typedef image_if< tag::image<I>, tag::function<F> > skeleton; + + /// Point_Set associated type. typedef pset_if<mln_pset(I), F> pset; @@ -60,12 +65,6 @@ /// Give the definition domain. const pset& domain() const; - template <typename T> - struct change_value - { - typedef image_if<mln_ch_value(I,T), F> ret; - }; - /// Const promotion via convertion. operator image_if<const I, F>() const; @@ -89,6 +88,7 @@ } + # ifndef MLN_INCLUDE_ONLY template <typename I, typename F> Index: mln/core/rle_image.hh --- mln/core/rle_image.hh (revision 1136) +++ mln/core/rle_image.hh (working copy) @@ -58,6 +58,11 @@ typedef internal::run_psite<P> psite; typedef mln::value::set<T> vset; + + /// Skeleton. + typedef rle_image< tag::psite<P>, tag::value<T> > skeleton; + + rle_image(); /// Add a new range to the image. @@ -75,12 +80,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. - template <typename U> - struct change_value - { - typedef rle_image<P, U> ret; - }; protected: /// Image values. std::vector<T> values_; Index: mln/core/image2d_b.hh --- mln/core/image2d_b.hh (revision 1136) +++ mln/core/image2d_b.hh (working copy) @@ -100,12 +100,10 @@ /// Return type of read-write access. typedef T& lvalue; - /// Change value type. - template <typename U> - struct change_value - { - typedef image2d_b<U> ret; - }; + + /// Skeleton. + typedef image2d_b< tag::value<T> > skeleton; + /// Value_Set associated type. typedef mln::value::set<T> vset; Index: mln/core/cast_image.hh --- mln/core/cast_image.hh (revision 1136) +++ mln/core/cast_image.hh (working copy) @@ -67,6 +67,10 @@ typedef mln::value::set<T> vset; + /// Skeleton. + typedef cast_image< tag::value<T>, tag::image<I> > skeleton; + + /// Constructor. cast_image_(const Image<I>& ima); @@ -89,13 +93,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. - template <typename U> - struct change_value - { - typedef mln_ch_value(I, U) ret; - }; - protected: const I& ima_; }; Index: mln/core/safe.hh --- mln/core/safe.hh (revision 1136) +++ mln/core/safe.hh (working copy) @@ -42,6 +42,9 @@ typedef internal::image_adaptor_< I, safe_image<I> > super_; public: + /// Skeleton. + typedef safe_image< tag::image<I> > skeleton; + safe_image(I& ima, const mln_value(I)& default_value); mln_rvalue(I) operator()(const mln_psite(I)& p) const; @@ -49,12 +52,6 @@ typedef typename super_::lvalue lvalue; lvalue operator()(const mln_psite(I)& p); - template <typename U> - struct change_value - { - typedef safe_image<mln_ch_value(I, U)> ret; - }; - /// Const promotion via convertion. operator safe_image<const I>() const; Index: mln/core/sub_image.hh --- mln/core/sub_image.hh (revision 1136) +++ mln/core/sub_image.hh (working copy) @@ -44,16 +44,13 @@ typedef internal::image_adaptor_<I, sub_image<I,S>, S> super_; public: + /// Skeleton. + typedef sub_image< tag::image<I>, tag::pset<S> > skeleton; + sub_image(I& ima, const S& pset); bool owns_(const mln_psite(I)& p) const; - template <typename U> - struct change_value - { - typedef internal::fixme ret; - }; - const S& domain() const; /// Const promotion via convertion. Index: mln/core/concept/image.hh --- mln/core/concept/image.hh (revision 1136) +++ mln/core/concept/image.hh (working copy) @@ -34,7 +34,10 @@ # include <mln/core/concept/point_set.hh> # include <mln/core/concept/mesh.hh> -# include <mln/core/trait/all.hh> + +# include <mln/core/trait/all.hh> // FIXME: Move out of core! +# include <mln/trait/ch_value.hh> // FIXME: Should be in all.hh! + # include <mln/metal/is_a.hh> @@ -68,11 +71,7 @@ rvalue operator()(const psite& p) const; lvalue operator()(const psite& p); - template <typename T> - struct change_value - { - typedef ret; - }; + typedef skeleton; // provided by internal::image_base_: @@ -128,7 +127,7 @@ typedef mln_rvalue(E) rvalue; typedef mln_lvalue(E) lvalue; - typedef mln_ch_value(E, value) change; + typedef typename E::skeleton skeleton; bool (E::*m3)() const = & E::has_data; m3 = 0; Index: mln/core/concept/doc/image.hh --- mln/core/concept/doc/image.hh (revision 1136) +++ mln/core/concept/doc/image.hh (working copy) @@ -63,6 +63,14 @@ typedef void vset; + + /*! \brief Associate type that describes how this type of image + * is constructed. + */ + typedef void skeleton; + + + /*! \brief Test if the image have been initialized. */ bool has_data() const; @@ -108,17 +116,6 @@ - /*! \brief Trait that gives the corresponding image type with - the value type changes to T. - */ - template <typename T> - struct change_value - { - typedef ret; - }; - - - /*! \brief Point set associated type. * \invariant This type has to derive from mln::Point_Set. */ Index: mln/core/sparse_image.hh --- mln/core/sparse_image.hh (revision 1136) +++ mln/core/sparse_image.hh (working copy) @@ -58,6 +58,11 @@ typedef internal::run_psite<P> psite; typedef mln::value::set<T> vset; + + /// Skeleton. + typedef sparse_image< tag::psite<P>, tag::value<T> > skeleton; + + sparse_image(); /// Add a new range to the image. @@ -75,12 +80,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. - template <typename U> - struct change_value - { - typedef sparse_image<P, U> ret; - }; protected: /// Image values. std::vector< std::vector<value> > values_; Index: mln/core/t_image.hh --- mln/core/t_image.hh (revision 1136) +++ mln/core/t_image.hh (working copy) @@ -49,6 +49,8 @@ template <typename I> struct t_image : public internal::image_adaptor_< I, t_image<I> > { + /// Skeleton. + typedef t_image< tag::image<I> > skeleton; /// Test if a pixel value is accessible at \p p. bool owns_(const mln_point(I)& p) const; @@ -65,15 +67,6 @@ /// Read-write access of pixel value at point site \p p. lvalue operator()(const mln_point(I)& p); - - /// Change value type. - template <typename U> - struct change_value - { - typedef mln_ch_value(I, U) ret; - }; - - /// Constructor. t_image(I& ima, unsigned c1, unsigned c2); Index: mln/core/image1d_b.hh --- mln/core/image1d_b.hh (revision 1136) +++ mln/core/image1d_b.hh (working copy) @@ -100,12 +100,10 @@ /// Return type of read-write access. typedef T& lvalue; - /// Change value type. - template <typename U> - struct change_value - { - typedef image1d_b<U> ret; - }; + + /// Skeleton. + typedef image1d_b< tag::value<T> > skeleton; + /// Value_Set associated type. typedef mln::value::set<T> vset; Index: mln/core/image3d_b.hh --- mln/core/image3d_b.hh (revision 1136) +++ mln/core/image3d_b.hh (working copy) @@ -100,12 +100,10 @@ /// Return type of read-write access. typedef T& lvalue; - /// Change value type. - template <typename U> - struct change_value - { - typedef image3d_b<U> ret; - }; + + /// Skeleton. + typedef image3d_b< tag::value<T> > skeleton; + /// Value_Set associated type. typedef mln::value::set<T> vset; Index: mln/level/paste.hh --- mln/level/paste.hh (revision 1136) +++ mln/level/paste.hh (working copy) @@ -70,7 +70,7 @@ { template <typename I, typename J> - void paste_pw_(const Image<I>& data_, Image<J>& destination_) + void paste_generic_(const Image<I>& data_, Image<J>& destination_) { const I& data = exact(data_); J& destination = exact(destination_); @@ -110,7 +110,7 @@ if (sizeof(mln_value(I)) = sizeof(mln_value(J))) paste_fast_(data, destination); else - paste_pw_(data, destination); + paste_generic_(data, destination); } } // end of namespace mln::level::impl Index: mln/tag/skeleton.hh --- mln/tag/skeleton.hh (revision 0) +++ mln/tag/skeleton.hh (revision 0) @@ -0,0 +1,60 @@ +// Copyright (C) 2007 EPITA Research and Development Laboratory +// +// This file is part of the Olena Library. This library is free +// software; you can redistribute it and/or modify it under the terms +// of the GNU General Public License version 2 as published by the +// Free Software Foundation. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this library; see the file COPYING. If not, write to +// the Free Software Foundation, 51 Franklin Street, Fifth Floor, +// Boston, MA 02111-1307, USA. +// +// As a special exception, you may use this file as part of a free +// software library without restriction. Specifically, if other files +// instantiate templates or use macros or inline functions from this +// file, or you compile this file and link it with other files to +// produce an executable, this file does not by itself cause the +// resulting executable to be covered by the GNU General Public +// License. This exception does not however invalidate any other +// reasons why the executable file might be covered by the GNU General +// Public License. + +#ifndef MLN_CORE_TAG_SKELETON_HH +# define MLN_CORE_TAG_SKELETON_HH + +/*! \file mln/core/tag/skeleton.hh + * + * \brief Definition of tags used in the skeleton types associated to + * image types. + */ + + +namespace mln +{ + + namespace tag + { + + // With param. + template <typename I> struct image { typedef I param; }; + template <typename V> struct value { typedef V param; }; + template <typename P> struct psite { typedef P param; }; + template <typename S> struct pset { typedef S param; }; + template <typename D> struct data { typedef D param; }; + template <typename F> struct function { typedef F param; }; + + // With value. + template <unsigned u> struct unsigned_ { enum { value = u }; }; + + } // end of namespace mln::tag + +} // end of namespace mln + + +#endif // ! MLN_CORE_TAG_SKELETON_HH Index: mln/value/stack.hh --- mln/value/stack.hh (revision 1136) +++ mln/value/stack.hh (working copy) @@ -101,6 +101,10 @@ typedef mln::value::set<value> vset; + /// Skeleton. + typedef stack_image< tag::unsigned_<n>, tag::image<I> > skeleton; + + /// Constructor. stack_image(const metal::vec<n,I*>& imas); @@ -125,14 +129,6 @@ /// Give the set of values of the image. const vset& values() const; - /// Change value type. - template <typename U> - struct change_value - { - typedef metal::vec<n,U> vec_n_U; - typedef mln_ch_value(I, vec_n_U) ret; - }; - protected: metal::vec<n,I*> imas_; };