https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
Index: ChangeLog
from Nicolas Ballas <ballas(a)lrde.epita.fr>
Continue documentation.
* doc/tutorial/design/include/properties.tex: Add properties.
* doc/tutorial/design/include/imagetours.tex: Fix typos.
* doc/tutorial/design/design.tex: Update.
design.tex | 14 ++++++++
include/imagetours.tex | 6 +--
include/properties.tex | 83 ++++++++++++++++++++++++++++++++++++++++---------
3 files changed, 85 insertions(+), 18 deletions(-)
Index: doc/tutorial/design/include/properties.tex
--- doc/tutorial/design/include/properties.tex (revision 2537)
+++ doc/tutorial/design/include/properties.tex (working copy)
@@ -1,6 +1,7 @@
\section{Properties}
+
\subsection{Notation}
A property has several values.
@@ -107,13 +108,12 @@
between its sites.
An image on a non-localized space has this property set to $none$.
An image on a localized space has this property set to $space$.
-An image based on a isotropic grid has this property set to $isotropic\_gride$
+An image based on a isotropic grid has this property set to $isotropic\_grid$
An image based on a anisotropic grid has this property set to
-$anisotropic\_gride$
+$anisotropic\_grid$
An image based on a aligned and orthogonal grid has its property set to
$basic\_grid$
-%% FIXME: Is it true?
If an image has its \verb+localization+ set to $space$, the user must define
the neighborhood relationships between the sites.
Otherwise, the image underlying grid defines the neighborhood relationships.
@@ -139,8 +139,6 @@
+--- two_d
|
+--- three_d
-
-
\end{verbatim}
This property specifies the dimension of the image.
@@ -159,7 +157,7 @@
\index{Property: value\_access}
\begin{verbatim}
-value\_access: any
+value_access: any
|
+--- direct
|
@@ -170,19 +168,19 @@
Image values can either be computed on the fly by a function or stored in
-memory. If an image type has a direct acces on the values in memory, it is
+memory. If an image type has a direct access on the values in memory, it is
possible to take a reference of them. In this case, this property is set to
$direct$. In the other case, this property is set $indirect$. When an image
computes its values on the fly, this property is refined to $computed$.
-\subsubsection{vw\_storage}
-\index{Property: vw\_storage}
+\subsubsection{value\_storage}
+\index{Property: value\_storage}
\begin{verbatim}
-vw_storage: any
+value_storage: any
|
- +--- /ram/
+ +--- /memory/
| |
| +--- singleton
| |
@@ -192,6 +190,37 @@
+--- irrelevant
\end{verbatim}
+This property indicates how the values are stored in memory, when it is the
+case. If the values aren't stored in the $memory$, this property is set to
+$irrelevant$. If this property is set to $singleton$, only one value is store
+in memory for the whole image (this the case of the \verb+flat_image+ type).
+If this value is set to $one\_block$, all the image values are stored in a
+linear buffer in memory. And, an image is $piecewise$, when it's value are
+stored in several buffers in memory.
+
+
+\subsubsection{value\_alignment}
+\index{Property: value\_alignment}
+
+\begin{verbatim}
+value_alignment: any
+ |
+ +--- with_grid
+ |
+ +--- not_aligned
+ |
+ +--- irrelevant
+\end{verbatim}
+
+This property indicates if the image values are ordered the same way in memory
+than when we run over them through a \verb+fwd_piter+.
+When this is the case, the image values are aligned with the image underlying
+grid, this property is set to $with\_grid$.
+If the values are not ordered the same way in memory than the \verb+fwd_piter+
+order, this property is set to $not\_aligned$.
+If the image values are not stored in memory, this property is set to
+$irrelevant$.
+
%%%%%%%%%%%%%%%%%%%%%%%%
% access %
@@ -255,23 +284,38 @@
%% FIXME functions that modify globaly all the values...
\begin{verbatim}
-
vw_io: any
|
- +--- /vm_some/
+ +--- /some/
| |
| +--- vw_read
| |
| +--- vw_read_write
- +--- vw_none
+ | |
+ | +--- vw_global_read_write
+ +--- none
\end{verbatim}
+This property defines the value wise access of an image.
+If \verb+vw_io+ is set to $vw\_none$, the associated image type does not
+ provide any value wise access.
+If an image type provides a readable (or writable)
+value access, this property is set to $vw\_read$ (or $vw\_read\_write$).
+If the image provide a value wise access that allows the user to change
+globally all the image values through a function $value$ to $value$,
+this property is set to $vw\_global\_read\_write$.
+
+%% FIXME define the interface associated
+
+The method provided for this value access depend on the \verb+vm_set+ property.
+
+
\subsubsection{vw\_set}
\index{Property: vw\_set}
\begin{verbatim}
- vw_io: any
+ vw_set: any
|
+--- /some/
| |
@@ -282,6 +326,15 @@
\end{verbatim}
+This property precises what kind of value access is provided by an image type.
+If an image type does not provide any value access (\verb+vw_io+ set to $none$)
+, \verb+vw_set+ is set to $none$.
+Otherwise, \verb+vw_set+ is set to $uni$ if the image provides an
+access to the mathematical set of values taken by the image (through the method
+\verb+value_taken+).
+If \verb+vw_set+ is set to $multi$, the image provides an access to the values
+taken in memory (cells) (through the method \verb+cells+). Note that a value
+can be present twice in the cells set.
Index: doc/tutorial/design/include/imagetours.tex
--- doc/tutorial/design/include/imagetours.tex (revision 2537)
+++ doc/tutorial/design/include/imagetours.tex (working copy)
@@ -43,8 +43,8 @@
compose the definition domain of the image.
A value is associated to each site of the image. This is the destination domain
of the image.
-To access to a value of an image nammed $ima$ localized at the point p, we
-just use the mathematic notation: \verb+ima(p)+.
+To access to a value of an image named $ima$ localized at the point p, we
+just use the mathematics notation: \verb+ima(p)+.
Obviously, every image types of Milena provide an access $site$ to $value$,
through \verb+ima(p)+. Yet, depending on the image type, the values can be
@@ -62,7 +62,7 @@
%% Explain the different template parameters T/S/F...
All the image types are parametrized by different static parameters.
-In this document, we will used the following namming convention for the
+In this document, we will used the following naming convention for the
image types parameters:
\begin{itemize}
\item{\verb+T+:} represents an image value type.
Index: doc/tutorial/design/design.tex
--- doc/tutorial/design/design.tex (revision 2537)
+++ doc/tutorial/design/design.tex (working copy)
@@ -35,6 +35,20 @@
stringstyle=\color{green}\ttfamily
}
+\lstnewenvironment{cartouche}
+ {\lstset{tabsize=2,
+ frame=single,
+ breaklines=true,
+ basicstyle=\ttfamily,
+ framexleftmargin=13mm,
+ identifierstyle=\color{black},
+ keywordstyle=\color{black},
+ stringstyle=\color{black},
+ commentstyle=\color{black},
+ backgroundcolor=\color{grey},
+ xleftmargin=12mm}
+ }
+{}
%%%LISTINGS SETTINGS
URL: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008/milena
ChangeLog:
2008-10-09 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Add hyper_directional browsing.
This is the old directional browsing. hyper_directional browse an
hyper plan of a n dimensional box (It browse all the dimensions except
the given one. The given dimension is browsed by the "next()" method
of the argument functor defined by the user).
* mln/canvas/browsing/hyper_directional.hh: New.
* tests/canvas/browsing/Makefile.am: .
* tests/canvas/browsing/directional.cc: Remove.
* tests/canvas/browsing/hyper_directional.cc: New.
---
mln/canvas/browsing/hyper_directional.hh | 134 +++++++++++++++++++++++++++++
tests/canvas/browsing/Makefile.am | 4
tests/canvas/browsing/hyper_directional.cc | 121 ++++++++++++++++++++++++++
3 files changed, 257 insertions(+), 2 deletions(-)
Index: branches/cleanup-2008/milena/tests/canvas/browsing/directional.cc (deleted)
===================================================================
Index: branches/cleanup-2008/milena/tests/canvas/browsing/hyper_directional.cc
===================================================================
--- branches/cleanup-2008/milena/tests/canvas/browsing/hyper_directional.cc (revision 0)
+++ branches/cleanup-2008/milena/tests/canvas/browsing/hyper_directional.cc (revision 2534)
@@ -0,0 +1,121 @@
+// 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/canvas/browsing/hyper_directional.cc
+ *
+ * \brief Tests on mln::canvas::browsing::hyper_directional.
+ */
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/image/image3d.hh>
+#include <mln/canvas/browsing/hyper_directional.hh>
+#include <mln/fun/p2v/iota.hh>
+#include <mln/debug/println.hh>
+#include <mln/level/fill.hh>
+
+// FIXME: Move code below into mln/canvas/browsing/iota.hh.
+
+
+template <typename I_, typename F>
+struct assign_browsing_functor
+{
+ typedef I_ I;
+ enum { dim = I::site::dim };
+
+
+ I input;
+ F f;
+ int dir;
+
+ assign_browsing_functor(I& input, F f = F(), int dir_ = 0)
+ : input(input),
+ f(f),
+ dir(dir_)
+ {}
+
+ mln_psite(I) p;
+
+ void init() {}
+ void final() {}
+ void next()
+ {
+ input(p) = f(p);
+ //FIXME: Try to make more relevant test.
+ mln_assertion(p[dir] == 0);
+ }
+ void fwd() { next(); }
+ void bkd() { next(); }
+ void down() { next(); }
+};
+
+namespace mln
+{
+
+ template <typename I, typename F, typename B>
+ void my_test(Image<I>& ima_,
+ const Function_p2v<F>& f_,
+ const Browsing<B>& browse_,
+ int dir = 0)
+ {
+ I& ima = exact(ima_);
+ const F& f = exact(f_);
+ const B& browse = exact(browse_);
+
+ assign_browsing_functor<I, F> fun(ima, f, dir);
+ browse(fun);
+ }
+
+}
+
+
+int main()
+{
+ using namespace mln;
+ image2d<unsigned> ima2(3, 3);
+ image3d<unsigned> ima3(3, 3, 3);
+
+ level::fill(ima2, 0);
+ my_test(ima2, fun::p2v::iota, canvas::browsing::hyper_directional, 0);
+ debug::println(ima2);
+
+ level::fill(ima2, 0);
+ my_test(ima2, fun::p2v::iota, canvas::browsing::hyper_directional, 1);
+ debug::println(ima2);
+
+
+ level::fill(ima3, 0);
+ my_test(ima3, fun::p2v::iota, canvas::browsing::hyper_directional, 0);
+ debug::println(ima3);
+
+ level::fill(ima3, 0);
+ my_test(ima3, fun::p2v::iota, canvas::browsing::hyper_directional, 1);
+ debug::println(ima3);
+
+ level::fill(ima3, 0);
+ my_test(ima3, fun::p2v::iota, canvas::browsing::hyper_directional, 2);
+ debug::println(ima3);
+}
Index: branches/cleanup-2008/milena/tests/canvas/browsing/Makefile.am
===================================================================
--- branches/cleanup-2008/milena/tests/canvas/browsing/Makefile.am (revision 2533)
+++ branches/cleanup-2008/milena/tests/canvas/browsing/Makefile.am (revision 2534)
@@ -6,13 +6,13 @@
fwd \
snake_fwd \
snake_vert \
- directional \
+ hyper_directional \
dir_struct_elt_incr_update
fwd_SOURCES = fwd.cc
snake_fwd_SOURCES = snake_fwd.cc
snake_vert_SOURCES = snake_vert.cc
-directional_SOURCES = directional.cc
+hyper_directional_SOURCES = hyper_directional.cc
dir_struct_elt_incr_update_SOURCES = dir_struct_elt_incr_update.cc
TESTS = $(check_PROGRAMS)
Index: branches/cleanup-2008/milena/mln/canvas/browsing/hyper_directional.hh
===================================================================
--- branches/cleanup-2008/milena/mln/canvas/browsing/hyper_directional.hh (revision 0)
+++ branches/cleanup-2008/milena/mln/canvas/browsing/hyper_directional.hh (revision 2534)
@@ -0,0 +1,134 @@
+// 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_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH
+# define MLN_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH
+
+/*! \file mln/canvas/browsing/hyper_directional.hh
+ *
+ * \brief Hyper_Directional browsing of an image.
+ */
+
+# include <mln/core/concept/browsing.hh>
+# include <mln/core/concept/image.hh>
+
+namespace mln
+{
+
+ namespace canvas
+ {
+
+ namespace browsing
+ {
+
+ /*!
+ * \brief Browsing in a certain direction.
+ *
+ * This canvas browse all the point of an image 'input' of type
+ * 'I' and of dimension 'dim' in the direction 'dir'.
+ *
+ * The functor should provide (In addition to 'input', 'I',
+ * 'dim' and 'dir') three methods :
+ *
+ * - init() : Will be called at the beginning.
+ * - next() : Will be called at each point 'p' (also provided by
+ * the fonctor).
+ * - final(): Will be called at the end.
+ *
+ * F shall features : \n
+ * { \n
+ * --- as types: \n
+ * I; \n
+ * --- as attributes: \n
+ * dim; \n
+ * dir; // and test dir < dim \n
+ * input; \n
+ * p; \n
+ * --- as methods: \n
+ * void init(); \n
+ * void next(); \n
+ * void final(); \n
+ * } \n
+ *
+ */
+ struct hyper_directional_t : public Browsing< hyper_directional_t >
+ {
+ template <typename F>
+ void operator()(F& f) const;
+ }
+
+ hyper_directional;
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <typename F>
+ inline
+ void
+ hyper_directional_t::operator()(F& f) const
+ {
+ trace::entering("canvas::browsing::hyper_directional");
+ mln_precondition(f.dir < f.dim);
+ typedef typename F::I I;
+
+ mln_psite(I)
+ pmin = f.input.domain().pmin(),
+ pmax = f.input.domain().pmax();
+
+ f.p = pmin;
+
+ f.init();
+
+ do
+ {
+ f.next();
+
+ for (int c = F::dim - 1; c >= 0; --c)
+ {
+ if (c == int(f.dir))
+ continue;
+ if (f.p[c] != pmax[c])
+ {
+ ++f.p[c];
+ break;
+ }
+ f.p[c] = pmin[c];
+ }
+ } while (f.p != pmin);
+
+ f.final();
+ trace::exiting("canvas::browsing::hyper_directional");
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::canvas::browsing
+
+ } // end of namespace mln::canvas
+
+} // end of namespace mln
+
+#endif // ! MLN_CANVAS_BROWSING_HYPER_DIRECTIONAL_HH
URL: https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-10-08 Maxime van Noppen <yabo(a)lrde.epita.fr>
Fix moulette
* check.sh: Print the summary of the performed tests even when they
* are given on the command line.
check.sh | 1 +
1 file changed, 1 insertion(+)
Index: branches/scool-ng/tests/check.sh
===================================================================
--- branches/scool-ng/tests/check.sh (revision 116)
+++ branches/scool-ng/tests/check.sh (revision 117)
@@ -308,6 +308,7 @@
shift
done
+ print_summary
exit 0
fi
--
\__/ \__/
(00) Maxime `yabo` van Noppen (00)
___) \ Epita 2009 / (___
(_____/ \_____)