Olena-patches
Threads by month
- ----- 2025 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
November 2009
- 4 participants
- 70 discussions

17 Nov '09
https://svn.lrde.epita.fr/svn/oln/trunk/milena/sandbox
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Add some bench + canvas + subsampling + browsing code.
* bench: New directory.
* bench/input_iz.pgm.gz: New.
* bench/fastest_statistical_tour_browsing.cc: New.
* bench/fastest_forall_p_browsing.cc: New.
* bench/iz.cc: New.
* bench/fastest_statistical_tour_nbh_browsing.cc: New.
* bench/z_sub_browsing: New.
* bench/z_sub_browsing/fast.cc: New.
* bench/z_sub_browsing/debase.hh: New.
* bench/z_sub_browsing/integral.hh: New.
* bench/z_sub_browsing/+inc: New.
* bench/z_sub_browsing/in.pgm.gz: New.
* bench/z_sub_browsing/debase.cc: New.
* bench/z_sub_browsing/integral.cc: New.
* bench/z_sub_browsing/README: New.
* theo/mln/morpho/canvas/lena_blurred.pgm.gz: New.
* theo/mln/morpho/canvas/lena.pgm.gz: New.
* theo/mln/morpho/canvas/g.pbm.gz: New.
* theo/mln/morpho/canvas/lena_min.pgm.gz: New.
* theo/mln/morpho/canvas/reconstruction_on_set.hh: Layout.
* theo/mln/morpho/canvas/f_and_g.pbm.gz: New.
* theo/mln/morpho/canvas/regminid.pbm.gz: New.
* theo/mln/morpho/canvas/one_domain.cc: New.
* theo/mln/subsampling: New directory.
* theo/mln/subsampling/sizes.cc: New.
* theo/mln/subsampling/debase.hh: New.
* theo/mln/subsampling/integral.hh: New.
* theo/mln/subsampling/in.pgm.gz: New.
* theo/mln/subsampling/debase.cc: New.
* theo/mln/subsampling/integral.cc: New.
* theo/mln/browsing: New directory.
* theo/mln/browsing/window_sliding.cc: New.
bench/fastest_forall_p_browsing.cc | 384 ++++++++++++++++
bench/fastest_statistical_tour_browsing.cc | 168 +++++++
bench/fastest_statistical_tour_nbh_browsing.cc | 186 ++++++++
bench/iz.cc | 386 ++++++++++++++++
bench/z_sub_browsing/README | 5
bench/z_sub_browsing/debase.cc | 23 +
bench/z_sub_browsing/debase.hh | 351 +++++++++++++++
bench/z_sub_browsing/fast.cc | 139 ++++++
bench/z_sub_browsing/integral.cc | 23 +
bench/z_sub_browsing/integral.hh | 165 +++++++
theo/mln/browsing/window_sliding.cc | 52 ++
theo/mln/morpho/canvas/one_domain.cc | 569 +++++++++++++++++++++++++
theo/mln/subsampling/debase.cc | 23 +
theo/mln/subsampling/debase.hh | 351 +++++++++++++++
theo/mln/subsampling/integral.cc | 38 +
theo/mln/subsampling/integral.hh | 295 ++++++++++++
theo/mln/subsampling/sizes.cc | 45 +
17 files changed, 3203 insertions(+)
Index: bench/input_iz.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: bench/input_iz.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: bench/fastest_statistical_tour_browsing.cc
--- bench/fastest_statistical_tour_browsing.cc (revision 0)
+++ bench/fastest_statistical_tour_browsing.cc (revision 0)
@@ -0,0 +1,168 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/pw/all.hh>
+#include <mln/data/compare.hh>
+#include <mln/debug/println.hh>
+#include <mln/util/timer.hh>
+
+
+
+# define loop(n) for (unsigned i = 0; i < n; ++i)
+
+
+
+namespace mln
+{
+
+
+ // test_
+
+ template <typename I>
+ void test_(const std::string& routine, float t, const I& ima, mln_value(I) n)
+ {
+ std::cout << routine << ' ' << t << std::endl;
+ if (ima != (pw::cst(n) | ima.domain()))
+ std::cerr << "bug in " << routine << '!' << std::endl;
+ }
+
+
+
+ // piter
+
+ template <typename I>
+ void piter_based(I& ima)
+ {
+ mln_piter(I) p(ima.domain());
+ for_all(p)
+ if ((p.row() + p.col()) % 2 == 0)
+ ++ima(p);
+ for_all(p)
+ if ((p.row() + p.col()) % 2 == 1)
+ ++ima(p);
+ }
+
+
+ // row_col
+
+ template <typename I>
+ void row_col_based(I& ima)
+ {
+ const unsigned nrows = ima.nrows(), ncols = ima.ncols();
+ for (int row = 0; row < nrows; ++row)
+ for (int col = row % 2; col < ncols; col += 2)
+ ++ima.at_(row, col);
+ for (int row = 0; row < nrows; ++row)
+ for (int col = ! (row % 2); col < ncols; col += 2)
+ ++ima.at_(row, col);
+ }
+
+
+ // run_ptr
+
+ template <typename I>
+ void run_ptr_based(I& ima)
+ {
+ mln_box_runstart_piter(I) s(ima.domain());
+ const unsigned n = s.run_length();
+
+ // half-tour 0
+ unsigned skip = 0;
+ for_all(s)
+ {
+ mln_value(I)* ptr = &ima(s) + skip;
+ for (unsigned i = 0; i < n; i += 2)
+ {
+ ++*ptr;
+ ptr += 2;
+ }
+ skip = ! skip;
+ }
+
+ // half-tour 1
+ skip = 1;
+ for_all(s)
+ {
+ mln_value(I)* ptr = &ima(s) + skip;
+ for (unsigned i = 0; i < n; i += 2)
+ {
+ ++*ptr;
+ ptr += 2;
+ }
+ skip = ! skip;
+ }
+ }
+
+
+} // end of namespace mln
+
+
+
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned n = 10, size = 1000;
+ image2d<char> ima(size, size);
+ util::timer t;
+ std::string routine;
+
+
+ // piter
+
+ {
+ routine = "piter";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) piter_based(ima);
+ test_(routine, t.stop(), ima, n);
+ }
+
+
+ // row_col
+
+ {
+ routine = "row_col";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) row_col_based(ima);
+ test_(routine, t.stop(), ima, n);
+ }
+
+
+ // run_ptr
+
+ {
+ routine = "run_ptr";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) run_ptr_based(ima);
+ test_(routine, t.stop(), ima, n);
+ }
+
+}
Index: bench/fastest_forall_p_browsing.cc
--- bench/fastest_forall_p_browsing.cc (revision 0)
+++ bench/fastest_forall_p_browsing.cc (revision 0)
@@ -0,0 +1,384 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/util/timer.hh>
+
+
+
+# define loop(n) for (unsigned i = 0; i < n; ++i)
+
+
+
+namespace mln
+{
+
+
+ // (r, c)
+
+ template <typename I>
+ void bench_00(I& ima)
+ {
+ const unsigned nr = ima.nrows(), nc = ima.ncols();
+ for (int r = 0; r < nr; ++r)
+ for (int c = 0; c < nc; ++c)
+ ima.at_(r, c) = 0;
+ }
+
+
+ // ptr
+
+ template <typename I>
+ void bench_0(I& ima)
+ {
+ const unsigned n = ima.nelements();
+ mln_value(I)* ptr = ima.buffer();
+ for (unsigned i = 0; i < n; ++i)
+ *ptr++ = 0;
+ }
+
+ template <typename I>
+ void bench_0(I& ima1, const I& ima2)
+ {
+ const unsigned n = ima1.nelements();
+ mln_value(I)* ptr1 = ima1.buffer();
+ const mln_value(I)* ptr2 = ima2.buffer();
+ for (unsigned i = 0; i < n; ++i)
+ *ptr1++ = *ptr2++;
+ }
+
+
+ // piter
+
+ template <typename I>
+ void bench_1(I& ima)
+ {
+ mln_piter(I) p(ima.domain());
+ for_all(p)
+ ima(p) = 0;
+ }
+
+
+ // pixter
+
+ template <typename I>
+ void bench_2(I& ima)
+ {
+ mln_fwd_pixter(I) pxl(ima);
+ for_all(pxl)
+ pxl.val() = 0;
+ }
+
+ template <typename I>
+ void bench_2(I& ima1, const I& ima2)
+ {
+ mln_fwd_pixter(I) pxl1(ima1);
+ mln_fwd_pixter(const I) pxl2(ima2);
+ for_all_2(pxl1, pxl2)
+ pxl1.val() = pxl2.val();
+ }
+
+
+ // pixter -> offset
+
+ template <typename I>
+ void bench_3(I& ima)
+ {
+ mln_fwd_pixter(I) pxl(ima);
+ for_all(pxl)
+ {
+ unsigned p = pxl.offset();
+ ima.element(p) = 0;
+ }
+ }
+
+ template <typename I>
+ void bench_3(I& ima1, const I& ima2)
+ {
+ // border::equalize(ima1, ima2);
+ mln_fwd_pixter(I) pxl(ima1);
+ for_all(pxl)
+ {
+ unsigned p = pxl.offset();
+ ima1.element(p) = ima2.element(p);
+ }
+ }
+
+
+ // pixter -> point
+
+ template <typename I>
+ void bench_4(I& ima)
+ {
+ mln_fwd_pixter(I) pxl(ima);
+ for_all(pxl)
+ {
+ unsigned o = pxl.offset();
+ mln_psite(I) p = ima.point_at_index(o);
+ ima(p) = 0;
+ }
+ }
+
+
+
+ // box_runstart_piter -> ptr
+
+ template <typename I>
+ void bench_5(I& ima)
+ {
+ mln_box_runstart_piter(I) s(ima.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ mln_value(I)* ptr = & ima(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *ptr++ = 0;
+ }
+ }
+ }
+
+
+ // box_runstart_piter -> (ptr, point)
+
+ template <typename I>
+ void bench_6(I& ima)
+ {
+ typedef mln_site(I) P;
+ const unsigned dim_1 = P::dim - 1;
+ mln_box_runstart_piter(I) s(ima.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ mln_value(I)* ptr = & ima(s);
+ P p = s;
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *ptr++ = 0;
+ ++p[dim_1];
+ }
+ }
+ }
+
+ template <typename I>
+ void bench_6(I& ima1, const I& ima2)
+ {
+ typedef mln_site(I) P;
+ const unsigned dim_1 = P::dim - 1;
+ mln_box_runstart_piter(I) s(ima1.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ mln_value(I)* ptr1 = & ima1(s);
+ const mln_value(I)* ptr2 = & ima2(s);
+ P p = s;
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *ptr1++ = *ptr2++;
+ ++p[dim_1];
+ }
+ }
+ }
+
+
+// template <typename I>
+// void bench_6_alt(I& ima1, const I& ima2)
+// {
+// typedef mln_site(I) P;
+// const unsigned dim_1 = P::dim - 1;
+// mln_fwd_by_run_piter(I) p(ima1.domain());
+// for_all(p)
+// {
+// if (p.at_runstart())
+// {
+// p.update(ptr1, ima1);
+// p.update(ptr2, ima2);
+// }
+// *ptr1++ = *ptr2++;
+// p; // converts to point2d
+// }
+// }
+
+
+
+ // box_runstart_piter -> (offset, point)
+
+ template <typename I>
+ void bench_7(I& ima)
+ {
+ typedef mln_site(I) P;
+ const unsigned dim_1 = P::dim - 1;
+ mln_box_runstart_piter(I) s(ima.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ unsigned offset = ima.index_of_point(s);
+ P p = s;
+ for (unsigned i = 0; i < n; ++i)
+ {
+ ima.element(offset) = 0;
+ ++offset;
+ ++p[dim_1];
+ }
+ }
+ }
+
+
+
+} // end of namespace mln
+
+
+
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned n = 100, size = 1000;
+ image2d<int> ima(size, size), ima2(size, size);
+ util::timer t;
+
+
+ // (r, c)
+
+ {
+ t.start();
+ loop(n) bench_00(ima);
+ float ts = t.stop();
+ std::cout << "(r, c) " << ts << std::endl;
+ }
+
+
+ // ptr
+
+ {
+ t.start();
+ loop(n) bench_0(ima);
+ float ts = t.stop();
+ std::cout << "ptr " << ts << std::endl;
+ }
+
+// {
+// t.start();
+// loop(n) bench_0(ima, ima2);
+// float ts = t.stop();
+// std::cout << "2 ptrs " << ts << std::endl;
+// }
+
+
+ // piter
+
+ {
+ t.start();
+ loop(n) bench_1(ima);
+ std::cout << "piter " << t.stop() << std::endl;
+ }
+
+
+ // pixter
+
+ {
+ t.start();
+ loop(n) bench_2(ima);
+ float ts = t.stop();
+ std::cout << "pixter " << ts << std::endl;
+ }
+
+// {
+// t.start();
+// loop(n) bench_2(ima, ima2);
+// float ts = t.stop();
+// std::cout << "2 pixters " << ts << std::endl;
+// }
+
+
+ // pixter -> offset
+
+ {
+ t.start();
+ loop(n) bench_3(ima);
+ std::cout << "pixter -> offset " << t.stop() << std::endl;
+ }
+
+// {
+// t.start();
+// loop(n) bench_3(ima, ima2);
+// std::cout << t.stop() << std::endl;
+// }
+
+
+ // pixter -> point
+
+ {
+ t.start();
+ loop(n) bench_4(ima);
+ std::cout << "pixter -> point " << t.stop() << std::endl;
+ }
+
+
+ // box_runstart_piter -> ptr
+
+ {
+ t.start();
+ loop(n) bench_5(ima);
+ std::cout << "box_runstart_piter -> ptr " << t.stop() << std::endl;
+ }
+
+
+ // box_runstart_piter -> (ptr, point)
+
+ {
+ t.start();
+ loop(n) bench_6(ima);
+ float ts = t.stop();
+ std::cout << "runstart -> (ptr, point) " << ts << std::endl;
+ }
+
+// {
+// t.start();
+// loop(n) bench_6(ima, ima2);
+// float ts = t.stop();
+// std::cout << "runstart -> (2 ptrs, point) " << ts << std::endl;
+// }
+
+
+ // box_runstart_piter -> (offset, point)
+
+ {
+ t.start();
+ loop(n) bench_7(ima);
+ float ts = t.stop();
+ std::cout << "runstart -> (offset, point) " << ts << std::endl;
+ }
+
+// {
+// t.start();
+// loop(n) bench_7(ima, ima2);
+// float ts = t.stop();
+// std::cout << "runstart -> (2 offsets, point) " << ts << std::endl;
+// }
+
+}
Index: bench/iz.cc
--- bench/iz.cc (revision 0)
+++ bench/iz.cc (revision 0)
@@ -0,0 +1,386 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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.
+
+#include <queue>
+#include <mln/core/routine/duplicate.hh>
+#include <mln/data/fill.hh>
+#include <mln/extension/fill.hh>
+
+#include <mln/transform/influence_zone_geodesic.hh>
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/util/timer.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+
+
+# define loop(n) for (unsigned i = 0; i < n; ++i)
+
+
+
+namespace mln
+{
+
+
+ template <typename I, typename N>
+ mln_concrete(I) do_iz(const I& input, const N& nbh)
+ {
+ mln_ch_value(I, unsigned) dmap;
+ std::queue<unsigned> q;
+ mln_concrete(I) output;
+
+ // Initialization.
+ {
+ output = duplicate(input); // <-- init
+ extension::fill(output, 1); // For the extension to be ignored.
+
+ mln_pixter(const I) p(input);
+ mln_nixter(const I, N) n(p, nbh);
+ for_all(p)
+ if (p.val() != 0) // <-- inqueue_p_wrt_input_p
+ {
+ ; // <-- init_p
+ // FIXME: dmap.element(p.offset()) = 0;
+ for_all(n)
+ if (n.val() == 0) // <-- inqueue_p_wrt_input_n
+ {
+ q.push(p.offset());
+ break;
+ }
+ }
+ }
+
+ // Propagation.
+ {
+ unsigned p;
+
+ util::array<int> dp = offsets_wrt(input, nbh);
+ const unsigned n_nbhs = dp.nelements();
+
+ while (! q.empty())
+ {
+ p = q.front();
+ q.pop();
+ // pas de saturation
+ if (output.element(p) == 0)
+ std::cerr << "oops!" << std::endl;
+ for (unsigned i = 0; i < n_nbhs; ++i)
+ {
+ unsigned n = p + dp[i];
+ if (output.element(n) == 0)
+ {
+ output.element(n) = output.element(p); // <- process
+ q.push(n);
+ }
+ }
+ }
+ }
+
+ return output;
+ }
+
+
+
+ template <typename I, typename N>
+ mln_concrete(I) do_iz__bis(const I& input, const N& nbh)
+ {
+ std::queue<unsigned> q;
+ mln_concrete(I) output;
+
+ util::array<int> dp = offsets_wrt(input, nbh);
+ const unsigned n_nbhs = dp.nelements();
+
+ // Initialization.
+ {
+ output = duplicate(input); // <-- init
+ extension::fill(output, 1); // For the extension to be ignored.
+
+ mln_box_runstart_piter(I) s(input.domain());
+ const unsigned len = s.run_length();
+ for_all(s)
+ {
+ unsigned p = input.index_of_point(s);
+ for (unsigned i = 0; i < len; ++i, ++p)
+ if (input.element(p) != 0)
+ {
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ unsigned n = p + dp[j];
+ if (input.element(n) == 0)
+ {
+ q.push(p);
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ // Propagation.
+ {
+ unsigned p;
+
+ while (! q.empty())
+ {
+ p = q.front();
+ q.pop();
+ mln_invariant(output.element(p) != 0);
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ unsigned n = p + dp[j];
+ if (output.element(n) == 0)
+ {
+ output.element(n) = output.element(p); // <- process
+ q.push(n);
+ }
+ }
+ }
+ }
+
+ return output;
+ }
+
+
+
+
+
+ template <typename I, typename N>
+ mln_concrete(I) do_iz__ter(const I& input, const N& nbh)
+ {
+ std::queue<unsigned> q;
+ mln_concrete(I) output;
+
+ util::array<int> dp = offsets_wrt(input, nbh);
+ const unsigned n_nbhs = dp.nelements();
+ const unsigned
+ skip_border = 2 * input.border(),
+ nrows = input.nrows(),
+ ncols = input.ncols();
+
+ // Initialization.
+ {
+ output = duplicate(input); // <-- init
+ extension::fill(output, 1); // For the extension to be ignored.
+
+ unsigned p = input.index_of_point(point2d(0,0));
+ for (unsigned row = 0; row < nrows; ++row, p += skip_border)
+ {
+ for (unsigned i = 0; i < ncols; ++i, ++p)
+ if (input.element(p) != 0)
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ unsigned n = p + dp[j];
+ if (input.element(n) == 0)
+ {
+ q.push(p);
+ break;
+ }
+ }
+ }
+ }
+
+ // Propagation.
+ {
+ unsigned p;
+
+ while (! q.empty())
+ {
+ p = q.front();
+ q.pop();
+ mln_invariant(output.element(p) != 0);
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ unsigned n = p + dp[j];
+ if (output.element(n) == 0)
+ {
+ output.element(n) = output.element(p); // <- process
+ q.push(n);
+ }
+ }
+ }
+ }
+
+ return output;
+ }
+
+
+
+
+ template <typename I, typename N>
+ mln_concrete(I) do_iz__ptr(const I& input, const N& nbh)
+ {
+ std::queue<mln_value(I)*> q;
+ mln_concrete(I) output;
+
+ util::array<int> dp = offsets_wrt(input, nbh);
+ const unsigned n_nbhs = dp.nelements();
+ const unsigned
+ skip_border = 2 * input.border(),
+ nrows = input.nrows(),
+ ncols = input.ncols();
+
+ // Initialization.
+ {
+ output = duplicate(input);
+ // For the extension to be ignored:
+ extension::fill(input, 0); // in initialization
+ extension::fill(output, 1); // in propagation
+
+ const unsigned nelts = input.nelements();
+ const mln_value(I)* p_i = & input.at_(0, 0);
+ mln_value(I)* p_o = & output.at_(0, 0);
+ for (unsigned i = 0; i < nelts; ++i, ++p_i, ++p_o)
+ {
+ if (*p_i == 0)
+ continue;
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ const mln_value(I)* n_i = p_i + dp[j];
+ if (*n_i == 0)
+ {
+ q.push(p_o);
+ break;
+ }
+ }
+ }
+
+ }
+
+ // Propagation.
+ {
+ mln_value(I)* ptr;
+
+ while (! q.empty())
+ {
+ ptr = q.front();
+ q.pop();
+ mln_invariant(*ptr != 0);
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ {
+ mln_value(I)* ntr = ptr + dp[j];
+ if (*ntr == 0)
+ {
+ *ntr = *ptr;
+ q.push(ntr);
+ }
+ }
+ }
+ }
+
+ return output;
+ }
+
+
+
+} // end of namespace mln
+
+
+
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> in;
+ io::pgm::load(in, "input_iz.pgm");
+
+ util::timer t;
+ neighb2d nbh = c4();
+
+// {
+// t.start();
+// image2d<int_u8> ref = transform::influence_zone_geodesic(in, nbh, mln_max(unsigned));
+// float ts = t.stop();
+// std::cout << ts << std::endl;
+// io::pgm::save(ref, "ref.pgm");
+// }
+
+// {
+// t.start();
+// image2d<int_u8> out = do_iz__bis(in, nbh);
+// float ts = t.stop();
+// std::cout << ts << std::endl;
+// io::pgm::save(out, "iz_bis.pgm");
+// }
+
+// {
+// t.start();
+// image2d<int_u8> out = do_iz__ter(in, nbh);
+// float ts = t.stop();
+// std::cout << ts << std::endl;
+// io::pgm::save(out, "iz_ter.pgm");
+// }
+
+// {
+// t.start();
+// image2d<int_u8> out = do_iz__ptr(in, nbh);
+// float ts = t.stop();
+// std::cout << ts << std::endl;
+// io::pgm::save(out, "iz_ptr.pgm");
+// }
+
+
+ const unsigned n_times = 10;
+
+ {
+ t.start();
+ loop(n_times) transform::influence_zone_geodesic(in, nbh, mln_max(unsigned));
+ float ts = t.stop();
+ std::cout << ts << std::endl;
+ }
+
+ {
+ t.start();
+ loop(n_times) do_iz(in, nbh);
+ float ts = t.stop();
+ std::cout << ts << std::endl;
+ }
+
+ {
+ t.start();
+ loop(n_times) do_iz__bis(in, nbh);
+ float ts = t.stop();
+ std::cout << ts << std::endl;
+ }
+
+ {
+ t.start();
+ loop(n_times) do_iz__ter(in, nbh);
+ float ts = t.stop();
+ std::cout << ts << std::endl;
+ }
+
+ {
+ t.start();
+ loop(n_times) do_iz__ptr(in, nbh);
+ float ts = t.stop();
+ std::cout << ts << std::endl;
+ }
+
+}
Index: bench/fastest_statistical_tour_nbh_browsing.cc
--- bench/fastest_statistical_tour_nbh_browsing.cc (revision 0)
+++ bench/fastest_statistical_tour_nbh_browsing.cc (revision 0)
@@ -0,0 +1,186 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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.
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/pw/all.hh>
+#include <mln/data/compare.hh>
+#include <mln/debug/println.hh>
+#include <mln/util/timer.hh>
+
+
+
+# define loop(n) for (unsigned i = 0; i < n; ++i)
+
+
+
+namespace mln
+{
+
+
+ // test_
+
+ template <typename I>
+ void test_(const std::string& routine, float t, const I& ima, unsigned n)
+ {
+ dpoint2d dp(1, 1);
+ box2d
+ b = ima.domain(),
+ inner(b.pmin() + dp, b.pmax() - dp);
+ std::cout << routine << ' ' << t << std::endl;
+ if ((ima | inner) != (pw::cst(4 * n) | inner))
+ std::cerr << "bug in " << routine << '!' << std::endl;
+ // FIXME: other tests...
+ }
+
+
+
+ // piter
+
+ template <typename I, typename N>
+ void piter_based(I& ima, const N& nbh)
+ {
+ mln_piter(I) p(ima.domain());
+ mln_niter(N) n(nbh, p);
+ for_all(p)
+ if ((p.row() + p.col()) % 2 == 0)
+ for_all(n)
+ ++ima(n);
+ for_all(p)
+ if ((p.row() + p.col()) % 2 == 1)
+ for_all(n)
+ ++ima(n);
+ }
+
+
+ // row_col
+
+ template <typename I, typename N>
+ void row_col_based(I& ima, const N& nbh)
+ {
+ const unsigned nrows = ima.nrows(), ncols = ima.ncols();
+ unsigned n_nbhs = nbh.size();
+ for (int row = 0; row < nrows; ++row)
+ for (int col = row % 2; col < ncols; col += 2)
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ ++ima.at_(row + nbh.dp(j).row(), col + nbh.dp(j).col());
+ for (int row = 0; row < nrows; ++row)
+ for (int col = ! (row % 2); col < ncols; col += 2)
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ ++ima.at_(row + nbh.dp(j).row(), col + nbh.dp(j).col());
+ }
+
+
+ // run_ptr
+
+ template <typename I, typename N>
+ void run_ptr_based(I& ima, const N& nbh)
+ {
+ mln_box_runstart_piter(I) s(ima.domain());
+ const unsigned n = s.run_length();
+
+ util::array<int> dp = offsets_wrt(ima, nbh);
+ const unsigned n_nbhs = dp.nelements();
+
+ // half-tour 0
+ unsigned skip = 0;
+ for_all(s)
+ {
+ mln_value(I)* ptr = &ima(s) + skip;
+ for (unsigned i = 0; i < n; i += 2)
+ {
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ ++*(ptr + dp(j));
+ ptr += 2;
+ }
+ skip = ! skip;
+ }
+
+ // half-tour 1
+ skip = 1;
+ for_all(s)
+ {
+ mln_value(I)* ptr = &ima(s) + skip;
+ for (unsigned i = 0; i < n; i += 2)
+ {
+ for (unsigned j = 0; j < n_nbhs; ++j)
+ ++*(ptr + dp(j));
+ ptr += 2;
+ }
+ skip = ! skip;
+ }
+ }
+
+
+} // end of namespace mln
+
+
+
+
+
+int main()
+{
+ using namespace mln;
+
+ const unsigned n = 10, size = 1000;
+ image2d<char> ima(size, size);
+ neighb2d nbh = c4();
+ util::timer t;
+ std::string routine;
+
+
+ // piter
+
+ {
+ routine = "piter";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) piter_based(ima, nbh);
+ test_(routine, t.stop(), ima, n);
+ }
+
+
+ // row_col
+
+ {
+ routine = "row_col";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) row_col_based(ima, nbh);
+ test_(routine, t.stop(), ima, n);
+ }
+
+
+ // run_ptr
+
+ {
+ routine = "run_ptr";
+ data::fill(ima, 0);
+ t.start();
+ loop(n) run_ptr_based(ima, nbh);
+ test_(routine, t.stop(), ima, n);
+ }
+
+}
Index: bench/z_sub_browsing/fast.cc
--- bench/z_sub_browsing/fast.cc (revision 0)
+++ bench/z_sub_browsing/fast.cc (revision 0)
@@ -0,0 +1,139 @@
+#include <mln/core/image/image2d.hh>
+#include <mln/util/array.hh>
+#include <mln/util/timer.hh>
+#include <mln/data/fill.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+
+
+namespace mln
+{
+
+// template <typename I>
+// void
+// test1(const I& input, I& out)
+// {
+// unsigned s = 2;
+// util::timer timer_;
+// timer_.start();
+
+// mln_box_runstart_piter(I) sp(out.domain());
+
+// const unsigned n = sp.run_length();
+
+// unsigned row_offset = input.domain().ncols()
+// + 2 * input.border();
+
+// util::array< mln_value(I)*> ptr(s);
+// util::array<const mln_value(I)*> ptr_input(s);
+
+// sp.start();
+// while (sp.is_valid())
+// {
+// mln_site(I)
+// site = sp; // Site at scale 1.
+
+// unsigned nptr = 0;
+// for (; sp.is_valid() && nptr < ptr.size(); ++nptr)
+// {
+// ptr(nptr) = & out(sp);
+// ptr_input(nptr) = & input(sp);
+// sp.next();
+// }
+// ptr.resize(nptr);
+
+// for (unsigned col = 0; col < n; col += s, site[1] += s)
+// {
+// for (unsigned i = 0; i < ptr.size() ; ++i)
+// for (unsigned j = 0; j < s; ++j)
+// *ptr(i)++ = *ptr_input(i)++;
+// }
+// }
+
+// float t_ = timer_;
+// std::cout << "Test 1 - " << t_ << std::endl;
+// }
+
+
+ template <typename I>
+ void
+ test2(const I& input, I& out, unsigned s)
+ {
+ const unsigned s_2 = s * s, round_it = s_2 / 2;
+ util::timer timer_;
+ timer_.start();
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+
+ mln_box_runstart_piter(I) sp(input.domain());
+
+ const unsigned n = sp.run_length();
+
+ int row_offset = input.domain().ncols() + 2 * input.border();
+ int row_offset_s = row_offset - s;
+ int row_offset_next = - (s - 1) * row_offset;
+
+ mln_value(I)* ptr = out.buffer();
+ const mln_value(I)* ptr_input;
+
+ sp.start();
+ while (sp.is_valid())
+ {
+ mln_site(I)
+ site = sp; // Site at scale 1.
+
+ ptr_input = & input(sp);
+
+ for (unsigned col = 0; col < n; col += s, site[1] += s)
+ {
+
+ // tile
+ S sum = 0;
+ for (unsigned i = 0; i < s;)
+ {
+ for (unsigned j = 0; j < s; ++j)
+ sum += *ptr_input++;
+
+ ++i;
+ if (i < s)
+ ptr_input += row_offset_s;
+ }
+
+ ptr_input += row_offset_next;
+ *ptr++ = sum / s_2;
+ }
+
+ for (unsigned i = 0; i < s; ++i)
+ sp.next();
+ }
+
+ float t_ = timer_;
+ std::cout << t_ << std::endl;
+ }
+
+
+
+} // end of namespace mln
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ def::coord
+ r = 3144,
+ c = 2252;
+
+ image2d<int_u8> input;
+ io::pgm::load(input, "in.pgm");
+
+ unsigned s = 3;
+ box2d b = make::box2d((input.nrows() + s - 1) / s,
+ (input.ncols() + s - 1) / s);
+ image2d<int_u8> output(b, 0);
+ test2(input, output, s);
+
+ io::pgm::save(output, "out.pgm");
+
+}
Index: bench/z_sub_browsing/debase.hh
--- bench/z_sub_browsing/debase.hh (revision 0)
+++ bench/z_sub_browsing/debase.hh (revision 0)
@@ -0,0 +1,351 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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_SUBSAMPLING_DEBASE_HH
+# define MLN_SUBSAMPLING_DEBASE_HH
+
+/// \file
+///
+/// Debase subsampling.
+
+#include <mln/core/concept/image.hh>
+
+#define MLN_FLOAT double
+#include <sandbox/theo/exec/gaussian_directional_2d.hh>
+
+
+
+namespace mln
+{
+
+ namespace subsampling
+ {
+
+ /// FIXME: Doc.
+
+ template <typename I>
+ mln_concrete(I)
+ debase(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift); // FIXME: Add round_up_size.
+
+
+ template <typename I>
+ mln_concrete(I)
+ debase(const Image<I>& input, unsigned gap);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation.
+
+ namespace impl
+ {
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+ mln_concrete(I) output(b);
+ mln_piter(I) p(output.domain());
+ for_all(p)
+ output(p) = input(p * gap + shift);
+
+ trace::exiting("subsampling::impl::debase");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ const mln_value(I)* pi = & input(s * gap + shift);
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *po++ = *pi;
+ pi += gap;
+ }
+ }
+
+ trace::exiting("subsampling::impl::debase_fastest");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_gaussian_antialiased_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_gaussian_antialiased_fastest");
+
+ const I& input = exact(input_);
+
+ image2d<MLN_FLOAT> temp(input.domain());
+ data::fill(temp, input);
+ temp = linear::gaussian_directional_2d(temp, 1, 1.5, 0);
+ temp = linear::gaussian_directional_2d(temp, 0, 1.5, 0);
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ const MLN_FLOAT* pi = & temp(s * gap + shift);
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *po++ = V(*pi + 0.49);
+ pi += gap;
+ }
+ }
+
+ trace::entering("subsampling::impl::debase_gaussian_antialiased_fastest");
+ return output;
+ }
+
+
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_2d_antialias_pointer_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_2d_antialias_pointer_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ const unsigned nrows = input.nrows();
+ const unsigned ncols = input.ncols();
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ for (unsigned row = 0; row < nrows; row += gap)
+ {
+ const V* ptr1 = & input.at_(row, 0);
+ const V* ptr2 = & input.at_(row + 1, 0);
+ const V* ptr3 = & input.at_(row + 2, 0);
+ for (unsigned col = 0; col < ncols; col += gap)
+ {
+ S s;
+
+ // mean
+ s = *ptr1++ + *ptr1++ + *ptr1++;
+ s += *ptr2++ + *ptr2++ + *ptr2++;
+ s += *ptr3++ + *ptr3++ + *ptr3++;
+ output.at_(row / gap, col / gap) = (s + 4) / 9;
+// // cut
+// s = 1 * *ptr1++ + 2 * *ptr1++ + 1 * *ptr1++;
+// s += 2 * *ptr2++ + 3 * *ptr2++ + 2 * *ptr2++;
+// s += 1 * *ptr3++ + 2 * *ptr3++ + 1 * *ptr3++;
+// output.at_(row / gap, col / gap) = (s + 7) / 15;
+ }
+ }
+
+ trace::exiting("subsampling::impl::debase_2d_antialias_pointer_fastest");
+ return output;
+ }
+
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_2d_antialias_offset_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_2d_antialias_offset_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+ box<P> b(pmin, pmax);
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ const V* ptr1 = & input.at_(0, 0);
+ const V* ptr2 = & input.at_(1, 0);
+ const V* ptr3 = & input.at_(2, 0);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+
+ unsigned offset = input.delta_index(point2d(3,0) - point2d(0,3*n));
+
+ for_all(s)
+ {
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ S s;
+ s = *ptr1++ + *ptr1++ + *ptr1++;
+ s += *ptr2++ + *ptr2++ + *ptr2++;
+ s += *ptr3++ + *ptr3++ + *ptr3++;
+ *po++ = (s + 4) / 9;
+ }
+ ptr1 += offset;
+ ptr2 += offset;
+ ptr3 += offset;
+ }
+
+ trace::exiting("subsampling::impl::debase_2d_antialias_offset_fastest");
+ return output;
+ }
+
+
+ } // end of namespace mln::subsampling::impl
+
+
+
+ // Dispatch.
+
+ namespace internal
+ {
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_dispatch(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ return impl::debase_2d_antialias_pointer_fastest /* debase_2d_antialias_offset_fastest */(input, gap, shift);
+ }
+
+
+ } // end of namespace mln::subsampling::internal
+
+
+
+ // Facades.
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::debase");
+
+ typedef mln_site(I) P;
+
+ mln_precondition(exact(input).is_valid());
+ mln_precondition(exact(input).domain().pmin() == literal::origin);
+ mln_precondition(gap > 1);
+ for (unsigned i = 0; i < P::dim; ++i)
+ mln_precondition(shift[i] < gap);
+
+ mln_concrete(I) output;
+ output = internal::debase_dispatch(input, gap, shift);
+
+ trace::exiting("subsampling::debase");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input, unsigned gap)
+ {
+ return debase(input, gap, literal::zero);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::subsampling
+
+} // end of namespace mln
+
+
+#endif // ! MLN_SUBSAMPLING_DEBASE_HH
Index: bench/z_sub_browsing/integral.hh
--- bench/z_sub_browsing/integral.hh (revision 0)
+++ bench/z_sub_browsing/integral.hh (revision 0)
@@ -0,0 +1,165 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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_SUBSAMPLING_INTEGRAL_HH
+# define MLN_SUBSAMPLING_INTEGRAL_HH
+
+/// \file
+///
+/// Both subsampling and integral image computation.
+
+#include <mln/core/concept/image.hh>
+
+
+
+namespace mln
+{
+
+ namespace subsampling
+ {
+
+ /// FIXME: Doc.
+
+ template <typename I>
+ mln_concrete(I)
+ integral(const Image<I>& input, unsigned scale);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation.
+
+ namespace impl
+ {
+
+
+ template <unsigned scale, typename I>
+ inline
+ mln_concrete(I)
+ integral_(const Image<I>& input_)
+ {
+ trace::entering("subsampling::impl::integral_");
+
+ const I& input = exact(input_);
+ const unsigned scale2 = scale * scale, round_it = scale2 / 2;
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ typedef mln_site(I) P;
+
+ box<P> b = make::box2d(input.nrows() / scale, input.ncols() / scale);
+ const unsigned nrows = b.nrows(), ncols = b.ncols();
+
+ typedef mln_concrete(I) O;
+ O output(b, 0); // no external border in 'output'
+ V* po = output.buffer();
+
+ unsigned
+ tile_cr = input.delta_index(dpoint2d(scale, - ncols * scale)),
+ cr = input.delta_index(dpoint2d(1, - (int)scale));
+
+ const V* pi = & input.at_(0, 0); // first point of tiles
+ for (unsigned row = 0; row < nrows; ++row)
+ {
+ S hsum = 0, hsum2 = 0; // horizontal integral
+ for (unsigned col = 0; col < ncols; ++col)
+ {
+ S sum = 0, sum2 = 0;
+ const V* ptr = pi;
+
+ for (unsigned r = 0; r < scale; ++r)
+ {
+ for (unsigned c = 0; c < scale; ++c)
+ {
+ sum += *ptr;
+ // sum2 += *ptr * *ptr;
+ ++ptr;
+ }
+ ptr += cr;
+ }
+
+ // ...
+ pi += scale;
+ *po++ = (round_it + sum) / scale2;
+ }
+ pi += tile_cr;
+ }
+
+ trace::exiting("subsampling::impl::integral_");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ integral(const Image<I>& input, unsigned scale)
+ {
+ // mln_precondition(input.nrows() % scale == 0);
+ // mln_precondition(input.ncols() % scale == 0);
+ if (scale == 3)
+ return integral_<3>(input);
+ else
+ std::cerr << "NYI!" << std::endl;
+ }
+
+ } // end of namespace mln::subsampling::impl
+
+
+
+
+ // Facades.
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ integral(const Image<I>& input_, unsigned scale)
+ {
+ trace::entering("subsampling::integral");
+
+ const I& input = exact(input_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(input.domain().pmin() == literal::origin);
+ mln_precondition(scale > 1);
+
+ mln_concrete(I) output;
+ output = impl::integral(input, scale);
+
+ trace::exiting("subsampling::integral");
+ return output;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::subsampling
+
+} // end of namespace mln
+
+
+#endif // ! MLN_SUBSAMPLING_INTEGRAL_HH
Index: bench/z_sub_browsing/in.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: bench/z_sub_browsing/in.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: bench/z_sub_browsing/debase.cc
--- bench/z_sub_browsing/debase.cc (revision 0)
+++ bench/z_sub_browsing/debase.cc (revision 0)
@@ -0,0 +1,23 @@
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/util/timer.hh>
+
+#include "debase.hh"
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> in;
+ io::pgm::load(in, "in.pgm");
+
+ util::timer t;
+ t.start();
+ image2d<int_u8> out = subsampling::debase(in, 3, dpoint2d(1,1));
+ float t_ = t.stop();
+ std::cout << t_ << std::endl;
+
+ io::pgm::save(out, "out.pgm");
+}
Index: bench/z_sub_browsing/integral.cc
--- bench/z_sub_browsing/integral.cc (revision 0)
+++ bench/z_sub_browsing/integral.cc (revision 0)
@@ -0,0 +1,23 @@
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/util/timer.hh>
+
+#include "integral.hh"
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> in;
+ io::pgm::load(in, "in.pgm");
+
+ util::timer t;
+ t.start();
+ image2d<int_u8> out = subsampling::integral(in, 3);
+ float t_ = t.stop();
+ std::cout << t_ << std::endl;
+
+ io::pgm::save(out, "out.pgm");
+}
Index: bench/z_sub_browsing/README
--- bench/z_sub_browsing/README (revision 0)
+++ bench/z_sub_browsing/README (revision 0)
@@ -0,0 +1,5 @@
+debase en 03 DNDEBUG: 0.08
+integral: 0.16
+fast: ???
+
+les 3 codes font une moyenne de tiles pour le sub-sampling
Index: theo/mln/morpho/canvas/lena_blurred.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/lena_blurred.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/lena.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/lena.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/g.pbm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/g.pbm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/lena_min.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/lena_min.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/reconstruction_on_set.hh
Index: theo/mln/morpho/canvas/f_and_g.pbm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/f_and_g.pbm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/regminid.pbm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/morpho/canvas/regminid.pbm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/morpho/canvas/one_domain.cc
--- theo/mln/morpho/canvas/one_domain.cc (revision 0)
+++ theo/mln/morpho/canvas/one_domain.cc (revision 0)
@@ -0,0 +1,569 @@
+
+# include <mln/core/concept/image.hh>
+# include <mln/core/concept/neighborhood.hh>
+# include <mln/morpho/canvas/internal/find_root.hh>
+
+# include <mln/data/fill.hh>
+# include <mln/data/sort_psites.hh>
+# include <mln/border/equalize.hh>
+# include <mln/border/fill.hh>
+
+
+// cc
+
+#include <mln/core/image/image2d.hh>
+#include <mln/core/alias/neighb2d.hh>
+#include <mln/debug/println.hh>
+#include <mln/io/pbm/load.hh>
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pbm/save.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/data/compare.hh>
+#include <mln/util/timer.hh>
+
+#include <mln/labeling/regional_maxima.hh>
+#include <mln/labeling/regional_minima.hh>
+#include <mln/pw/all.hh>
+
+
+
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace canvas
+ {
+
+
+ template <typename I, typename N, typename F>
+ inline
+ mln_result(F)
+ one_domain_union_find(const Image<I>& f_, const Neighborhood<N>& nbh_,
+ F& functor)
+ {
+ trace::entering("morpho::canvas::one_domain_union_find");
+
+ const I& f = exact(f_);
+ const N& nbh = exact(nbh_);
+
+ typedef typename F::S S;
+ typedef mln_psite(I) P;
+ typedef mln_value(I) V;
+
+ // Auxiliary data.
+ mln_ch_value(I, bool) deja_vu;
+ mln_ch_value(I, P) parent;
+ mln_result(F) output;
+
+ // Initialization.
+ {
+ initialize(output, f);
+ functor.output = output;
+
+ initialize(parent, f);
+ initialize(deja_vu, f);
+ data::fill(deja_vu, false);
+
+ functor.set_default(); // <-- set_default
+ }
+
+ // First pass.
+ {
+ mln_bkd_piter(S) p(functor.s());
+ mln_niter(N) n(nbh, p);
+ for_all(p)
+ if (functor.domain(p)) // <-- domain
+ {
+ // Make-Set.
+ parent(p) = p;
+ functor.init(p); // <-- init
+
+ for_all(n) if (f.domain().has(n))
+ {
+ // See below (*)
+ if (functor.domain(n)) // <-- domain
+ {
+ if (deja_vu(n))
+ {
+ if (functor.equiv(p, n)) // <-- equiv
+ {
+ // Do-Union.
+ P r = internal::find_root(parent, n);
+ if (r != p)
+ {
+// if (do_merge(p, r))
+ {
+ parent(r) = p;
+ functor.merge(p, r); // <-- merge
+ }
+// else
+// no_merge(p, r);
+ }
+ }
+ else
+ functor.do_no_union(p, n); // <-- do_no_union
+ }
+ }
+ else
+ {
+ mln_invariant(deja_vu(n) == false);
+ functor.border(p, n); // <-- border
+ }
+ }
+ deja_vu(p) = true;
+ }
+ }
+
+ // Second pass.
+ {
+ mln_fwd_piter(S) p(functor.s());
+ for_all(p)
+ if (functor.domain(p)) // <-- domain
+ if (parent(p) == p)
+ functor.root(p); // <-- root
+ else
+ output(p) = output(parent(p));
+ }
+
+ trace::exiting("morpho::canvas::one_domain_union_find");
+ return output;
+ }
+
+ } // end of namespace mln::morpho::canvas
+
+ } // end of namespace mln::morpho
+
+
+
+ // base functor
+
+ struct functor_base
+ {
+ void set_default()
+ {
+ }
+ template <typename P>
+ void init(const P&)
+ {
+ }
+ template <typename P>
+ void root(const P&)
+ {
+ }
+ template <typename P>
+ bool domain(const P&)
+ {
+ return true;
+ }
+ template <typename P1, typename P2>
+ void do_no_union(const P1&, const P2&)
+ {
+ }
+ template <typename P1, typename P2>
+ void border(const P1&, const P2&)
+ {
+ }
+ template <typename P1, typename P2>
+ bool equiv(const P1&, const P2&)
+ {
+ return true;
+ }
+ template <typename P1, typename P2>
+ void merge(const P1&, const P2&)
+ {
+ }
+ // no default for:
+ // typedef S
+ // .s()
+ };
+
+
+ // "binary reconstruction by dilation" functor
+
+ template <typename F, typename G>
+ struct rd_functor : functor_base
+ {
+ typedef mln_concrete(F) result;
+
+ const F& f;
+ const G& g;
+
+ typedef mln_domain(F) S;
+
+ rd_functor(const F& f, const G& g)
+ : f(f), g(g)
+ {
+ }
+
+ result output;
+ typedef mln_psite(F) P;
+
+ void set_default()
+ {
+ mln::data::fill(output, false);
+ }
+
+ bool domain(const P& p) const
+ {
+ return g(p) == true;
+ }
+
+ void init(const P& p)
+ {
+ output(p) = f(p);
+ }
+
+ void merge(const P& p, const P& r)
+ {
+ output(p) = output(p) || output(r);
+ }
+
+ S s() const
+ {
+ return f.domain();
+ }
+
+ };
+
+
+ // "labeling" functor
+
+ template <typename I, typename L>
+ struct lab_functor : functor_base
+ {
+ typedef mln_ch_value(I, L) result;
+
+ const I& input;
+ mln_value(I) val;
+
+ L nlabels;
+ bool status;
+
+ lab_functor(const I& input, const mln_value(I)& val)
+ : input(input), val(val)
+ {
+ }
+
+ result output;
+ typedef mln_psite(I) P;
+
+ typedef mln_domain(I) S;
+
+ S s() const
+ {
+ return input.domain();
+ }
+
+ void set_default()
+ {
+ data::fill(output, L(literal::zero));
+ nlabels = 0;
+ status = true;
+ }
+
+ bool domain(const P& p) const
+ {
+ return input(p) == val;
+ }
+
+ bool equiv(const P& p, const P& n)
+ {
+ return input(n) == val;
+ }
+
+ void root(const P& p)
+ {
+ if (status == false)
+ return;
+
+ if (nlabels == mln_max(L))
+ {
+ status = false;
+ trace::warning("labeling aborted!");
+ }
+ else
+ output(p) = ++nlabels;
+ }
+
+ };
+
+
+ // "regional maxima labeling" functor
+
+ template <typename I, typename L>
+ struct regmaxlab_functor : functor_base
+ {
+ typedef mln_ch_value(I, L) result;
+
+ const I& input;
+
+ L nlabels;
+ bool status;
+ mln_ch_value(I, bool) attr;
+
+ typedef mln_psite(I) P;
+ typedef p_array<P> S;
+ S s_;
+
+ result output;
+
+ regmaxlab_functor(const I& input)
+ : input(input)
+ {
+ s_ = data::sort_psites_increasing(input);
+ }
+
+ const S& s() const
+ {
+ return s_;
+ }
+
+ void set_default()
+ {
+ initialize(attr, input);
+ data::fill(attr, true);
+ data::fill(output, L(literal::zero));
+ nlabels = 0;
+ status = true;
+ }
+
+ bool equiv(const P& p, const P& n)
+ {
+ return input(n) == input(p);
+ }
+
+ void merge(const P& p, const P& r)
+ {
+ attr(p) = attr(p) && attr(r);
+ }
+
+ void do_no_union(const P& p, const P& n)
+ {
+ mln_invariant(input(n) > input(p));
+ attr(p) = false;
+ (void)n;
+ }
+
+ void root(const P& p)
+ {
+ if (attr(p) == false || status == false)
+ return;
+
+ if (nlabels == mln_max(L))
+ {
+ status = false;
+ trace::warning("labeling aborted!");
+ }
+ else
+ output(p) = ++nlabels;
+ }
+
+ };
+
+
+ // "regional minima identification" functor
+
+ template <typename I>
+ struct regminid_functor : functor_base
+ {
+ typedef mln_ch_value(I, bool) result;
+
+ const I& input;
+
+ typedef mln_psite(I) P;
+ typedef p_array<P> S;
+ S s_;
+
+ result output;
+
+ regminid_functor(const I& input)
+ : input(input)
+ {
+ s_ = data::sort_psites_decreasing(input);
+ }
+
+ const S& s() const
+ {
+ return s_;
+ }
+
+ void init(const P& p)
+ {
+ output(p) = true;
+ }
+
+ bool equiv(const P& p, const P& n)
+ {
+ return input(n) == input(p);
+ }
+
+ void merge(const P& p, const P& r)
+ {
+ output(p) = output(p) && output(r);
+ }
+
+ void do_no_union(const P& p, const P& n)
+ {
+ if (input(n) < input(p))
+ output(p) = false;
+ }
+
+ };
+
+
+
+ // "reconstruction by dilation on function" functor
+
+ template <typename F, typename G>
+ struct rdf_functor : functor_base
+ {
+ typedef mln_concrete(F) result;
+
+ const F& f;
+ const G& g;
+
+ typedef mln_value(F) V;
+ typedef mln_psite(F) P;
+ typedef p_array<P> S;
+ S s_;
+
+ result output;
+
+ rdf_functor(const F& f, const G& g)
+ : f(f), g(g)
+ {
+ s_ = data::sort_psites_decreasing(g);
+ }
+
+ const S& s() const
+ {
+ return f.domain();
+ }
+
+ void set_default()
+ {
+ mln::data::fill(output, f);
+ }
+
+ bool equiv(const P& p, const P& n)
+ {
+ return g(r) == g(p) || g(p) >= output(r);
+ }
+
+ void merge(const P& p, const P& r)
+ {
+ if (output(r) > output(p))
+ output(p) = output(r);
+ }
+
+ void do_no_union(const P& p, const P& n)
+ {
+ output(p) = mln_max(V);
+ }
+
+ void root(const P& p)
+ {
+ if (output(p) == mln_max(V))
+ output(p) = g(p);
+ }
+
+ };
+
+
+
+} // end of namespace mln
+
+
+
+int main()
+{
+ using namespace mln;
+
+ typedef value::int_u8 L;
+ neighb2d nbh = c4();
+
+ util::timer t;
+
+
+ // On sets.
+
+// {
+// typedef image2d<bool> I;
+
+// I f, g, ref;
+
+// io::pbm::load(f, "f_and_g.pbm");
+// io::pbm::load(g, "g.pbm");
+
+// {
+// t.start();
+// rd_functor<I,I> fun(f, g);
+// I rd = morpho::canvas::one_domain_union_find(f, nbh, fun);
+// std::cout << "rd: " << t.stop() << std::endl;
+// io::pbm::save(rd, "rd.pbm");
+// }
+
+// {
+// t.start();
+// lab_functor<I,L> fun(f, true);
+// image2d<L> lab = morpho::canvas::one_domain_union_find(f, nbh, fun);
+// std::cout << "lab: " << t.stop() << std::endl;
+// io::pgm::save(lab, "lab.pgm");
+// }
+// }
+
+
+ // On functions.
+
+ {
+ typedef image2d<value::int_u8> I;
+ I f;
+ io::pgm::load(f, "./lena_blurred.pgm");
+
+// {
+// // regional maxima labeling
+// t.start();
+// regmaxlab_functor<I,L> fun(f);
+// image2d<L> lab = morpho::canvas::one_domain_union_find(f, nbh, fun);
+// std::cout << "regmax lab: " << t.stop() << std::endl;
+// io::pgm::save(lab, "regmaxlab.pgm");
+
+// L nlabels_ref;
+// if (lab != labeling::regional_maxima(f, nbh, nlabels_ref)
+// || fun.nlabels != nlabels_ref)
+// std::cerr << "oops" << std::endl;
+// }
+
+// {
+// // regional minima identification
+// t.start();
+// regminid_functor<I> fun(f);
+// image2d<bool> id = morpho::canvas::one_domain_union_find(f, nbh, fun);
+// std::cout << "regmin id: " << t.stop() << std::endl;
+// io::pbm::save(id, "regminid.pbm");
+
+// L forget_it;
+// if (id != ((pw::value(labeling::regional_minima(f, nbh, forget_it)) != pw::cst(0)) | id.domain()))
+// std::cerr << "oops" << std::endl;
+// }
+
+ {
+ // reconstruction by dilation
+ I f, g;
+ io::pgm::load(f, "lena.pgm");
+ io::pgm::load(g, "lena_min.pgm");
+ if (! (f <= g))
+ std::cerr << "OK" << std::endl;
+
+ rdf_functor<I,I> fun(f, g);
+ I rdf = morpho::canvas::one_domain_union_find(f, nbh, fun);
+ std::cout << "rdf: " << t.stop() << std::endl;
+ io::pgm::save(rdf, "rdf.pbm");
+
+ }
+
+ }
+
+}
Index: theo/mln/subsampling/sizes.cc
--- theo/mln/subsampling/sizes.cc (revision 0)
+++ theo/mln/subsampling/sizes.cc (revision 0)
@@ -0,0 +1,45 @@
+#include <iostream>
+#include <cstdlib>
+
+
+void usage(const char* argv[])
+{
+ std::cerr << argv[0] << " n_scales s q nr nc" << std::endl;
+ std::abort();
+}
+
+
+unsigned sub(unsigned nbr, unsigned down_scaling)
+{
+ return (nbr + down_scaling - 1) / down_scaling;
+}
+
+
+int main(int argc, const char* argv[])
+{
+ unsigned n_scales = std::atoi(argv[1]);
+ unsigned s = std::atoi(argv[2]);
+ unsigned q = std::atoi(argv[3]);
+
+ unsigned nr_1 = std::atoi(argv[4]);
+ unsigned nc_1 = std::atoi(argv[5]);
+
+ unsigned* nc;
+ nc = new unsigned[n_scales + 1];
+
+ nc[1] = nc_1;
+ nc[2] = sub(nc[1], s);
+ for (unsigned i = 3; i <= n_scales; ++i)
+ nc[i] = sub(nc[i - 1], q);
+
+ for (unsigned i = 1; i <= n_scales; ++i)
+ std::cout << nc[i] << ' ';
+ std::cout << std::endl;
+
+ for (unsigned i = n_scales; i > 2; --i)
+ nc[i - 1] = q * nc[i];
+
+ for (unsigned i = 1; i <= n_scales; ++i)
+ std::cout << nc[i] << ' ';
+ std::cout << std::endl;
+}
Index: theo/mln/subsampling/debase.hh
--- theo/mln/subsampling/debase.hh (revision 0)
+++ theo/mln/subsampling/debase.hh (revision 0)
@@ -0,0 +1,351 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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_SUBSAMPLING_DEBASE_HH
+# define MLN_SUBSAMPLING_DEBASE_HH
+
+/// \file
+///
+/// Debase subsampling.
+
+#include <mln/core/concept/image.hh>
+
+#define MLN_FLOAT double
+#include <sandbox/theo/exec/gaussian_directional_2d.hh>
+
+
+
+namespace mln
+{
+
+ namespace subsampling
+ {
+
+ /// FIXME: Doc.
+
+ template <typename I>
+ mln_concrete(I)
+ debase(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift); // FIXME: Add round_up_size.
+
+
+ template <typename I>
+ mln_concrete(I)
+ debase(const Image<I>& input, unsigned gap);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation.
+
+ namespace impl
+ {
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+ mln_concrete(I) output(b);
+ mln_piter(I) p(output.domain());
+ for_all(p)
+ output(p) = input(p * gap + shift);
+
+ trace::exiting("subsampling::impl::debase");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ const mln_value(I)* pi = & input(s * gap + shift);
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *po++ = *pi;
+ pi += gap;
+ }
+ }
+
+ trace::exiting("subsampling::impl::debase_fastest");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_gaussian_antialiased_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_gaussian_antialiased_fastest");
+
+ const I& input = exact(input_);
+
+ image2d<MLN_FLOAT> temp(input.domain());
+ data::fill(temp, input);
+ temp = linear::gaussian_directional_2d(temp, 1, 1.5, 0);
+ temp = linear::gaussian_directional_2d(temp, 0, 1.5, 0);
+
+ typedef mln_value(I) V;
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+ for_all(s)
+ {
+ const MLN_FLOAT* pi = & temp(s * gap + shift);
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ *po++ = V(*pi + 0.49);
+ pi += gap;
+ }
+ }
+
+ trace::entering("subsampling::impl::debase_gaussian_antialiased_fastest");
+ return output;
+ }
+
+
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_2d_antialias_pointer_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_2d_antialias_pointer_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+
+ box<P> b(pmin, pmax);
+
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ const unsigned nrows = input.nrows();
+ const unsigned ncols = input.ncols();
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ for (unsigned row = 0; row < nrows; row += gap)
+ {
+ const V* ptr1 = & input.at_(row, 0);
+ const V* ptr2 = & input.at_(row + 1, 0);
+ const V* ptr3 = & input.at_(row + 2, 0);
+ for (unsigned col = 0; col < ncols; col += gap)
+ {
+ S s;
+
+ // mean
+ s = *ptr1++ + *ptr1++ + *ptr1++;
+ s += *ptr2++ + *ptr2++ + *ptr2++;
+ s += *ptr3++ + *ptr3++ + *ptr3++;
+ output.at_(row / gap, col / gap) = (s + 4) / 9;
+// // cut
+// s = 1 * *ptr1++ + 2 * *ptr1++ + 1 * *ptr1++;
+// s += 2 * *ptr2++ + 3 * *ptr2++ + 2 * *ptr2++;
+// s += 1 * *ptr3++ + 2 * *ptr3++ + 1 * *ptr3++;
+// output.at_(row / gap, col / gap) = (s + 7) / 15;
+ }
+ }
+
+ trace::exiting("subsampling::impl::debase_2d_antialias_pointer_fastest");
+ return output;
+ }
+
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_2d_antialias_offset_fastest(const Image<I>& input_,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::impl::debase_2d_antialias_offset_fastest");
+
+ const I& input = exact(input_);
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+
+ typedef mln_site(I) P;
+ P pmin = input.domain().pmin() / gap,
+ pmax = input.domain().pmax() / gap;
+ box<P> b(pmin, pmax);
+ typedef mln_concrete(I) O;
+ O output(b);
+
+ const V* ptr1 = & input.at_(0, 0);
+ const V* ptr2 = & input.at_(1, 0);
+ const V* ptr3 = & input.at_(2, 0);
+
+ mln_box_runstart_piter(O) s(output.domain());
+ const unsigned n = s.run_length();
+
+ unsigned offset = input.delta_index(point2d(3,0) - point2d(0,3*n));
+
+ for_all(s)
+ {
+ mln_value(O)* po = & output(s);
+ for (unsigned i = 0; i < n; ++i)
+ {
+ S s;
+ s = *ptr1++ + *ptr1++ + *ptr1++;
+ s += *ptr2++ + *ptr2++ + *ptr2++;
+ s += *ptr3++ + *ptr3++ + *ptr3++;
+ *po++ = (s + 4) / 9;
+ }
+ ptr1 += offset;
+ ptr2 += offset;
+ ptr3 += offset;
+ }
+
+ trace::exiting("subsampling::impl::debase_2d_antialias_offset_fastest");
+ return output;
+ }
+
+
+ } // end of namespace mln::subsampling::impl
+
+
+
+ // Dispatch.
+
+ namespace internal
+ {
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase_dispatch(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ return impl::debase_2d_antialias_pointer_fastest /* debase_2d_antialias_offset_fastest */(input, gap, shift);
+ }
+
+
+ } // end of namespace mln::subsampling::internal
+
+
+
+ // Facades.
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input,
+ unsigned gap,
+ const mln_deduce(I, site, delta)& shift)
+ {
+ trace::entering("subsampling::debase");
+
+ typedef mln_site(I) P;
+
+ mln_precondition(exact(input).is_valid());
+ mln_precondition(exact(input).domain().pmin() == literal::origin);
+ mln_precondition(gap > 1);
+ for (unsigned i = 0; i < P::dim; ++i)
+ mln_precondition(shift[i] < gap);
+
+ mln_concrete(I) output;
+ output = internal::debase_dispatch(input, gap, shift);
+
+ trace::exiting("subsampling::debase");
+ return output;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ debase(const Image<I>& input, unsigned gap)
+ {
+ return debase(input, gap, literal::zero);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::subsampling
+
+} // end of namespace mln
+
+
+#endif // ! MLN_SUBSAMPLING_DEBASE_HH
Index: theo/mln/subsampling/integral.hh
--- theo/mln/subsampling/integral.hh (revision 0)
+++ theo/mln/subsampling/integral.hh (revision 0)
@@ -0,0 +1,295 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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_SUBSAMPLING_INTEGRAL_HH
+# define MLN_SUBSAMPLING_INTEGRAL_HH
+
+/// \file
+///
+/// Both subsampling and integral image computation.
+
+#include <mln/core/concept/image.hh>
+#include <mln/debug/println.hh>
+
+
+
+namespace mln
+{
+
+ namespace subsampling
+ {
+
+ /// FIXME: Doc.
+
+ template <typename I>
+ mln_concrete(I)
+ integral(const Image<I>& input, unsigned scale);
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // Implementation.
+
+ namespace impl
+ {
+
+
+ template <unsigned scale, typename I>
+ inline
+ mln_concrete(I)
+ integral__why_is_it_slow(const Image<I>& input_)
+ {
+ trace::entering("subsampling::impl::integral__why_is_it_slow");
+
+ const I& input = exact(input_);
+ const unsigned scale2 = scale * scale, round_it = scale2 / 2;
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ typedef mln_site(I) P;
+
+ box<P> b = make::box2d(input.nrows() / scale, input.ncols() / scale);
+ const unsigned nrows = b.nrows(), ncols = b.ncols();
+
+ typedef mln_concrete(I) O;
+ O output(b, 0); // no external border in 'output'
+ V* po = output.buffer();
+
+ unsigned
+ tile_cr = input.delta_index(dpoint2d(scale, - ncols * scale)),
+ cr = input.delta_index(dpoint2d(1, - (int)scale));
+
+ const V* pi = & input.at_(0, 0); // first point of tiles
+
+ // (row, col) are tile coordinates.
+ for (unsigned row = 0; row < nrows; ++row)
+ {
+ S hsum = 0, hsum2 = 0; // horizontal integral
+ for (unsigned col = 0; col < ncols; ++col)
+ {
+ S sum = 0, sum2 = 0;
+ const V* ptr = pi;
+
+ for (unsigned r = 0; r < scale; ++r)
+ {
+ for (unsigned c = 0; c < scale; ++c)
+ {
+ sum += *ptr;
+ ++ptr;
+ }
+ ptr += cr;
+ }
+ // ...
+ pi += scale;
+ *po++ = (round_it + sum) / scale2;
+ }
+ pi += tile_cr;
+ }
+
+ trace::exiting("subsampling::impl::integral__why_is_it_slow");
+ return output;
+ }
+
+
+
+ template <unsigned scale, typename I>
+ inline
+ mln_concrete(I)
+ integral_(const Image<I>& input_)
+ {
+ trace::entering("subsampling::impl::integral_");
+
+ const I& input = exact(input_);
+ const unsigned scale2 = scale * scale, round_it = scale2 / 2;
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ typedef mln_site(I) P;
+
+ box<P> b = make::box2d((input.nrows() + scale - 1) / scale,
+ (input.ncols() + scale - 1) / scale);
+ typedef mln_concrete(I) O;
+ O output(b, 0);
+ V* po = output.buffer();
+
+ const unsigned nrows = input.nrows();
+ const unsigned ncols = input.ncols();
+
+ typedef const V* Ptr;
+ Ptr ptr[scale];
+ for (unsigned row = 0; row < nrows; row += scale)
+ {
+ for (unsigned r = 0; r < scale; ++r)
+ ptr[r] = & input.at_(row + r, 0);
+
+ for (unsigned col = 0; col < ncols; col += scale)
+ {
+ S sum = 0;
+ for (unsigned r = 0; r < scale; ++r)
+ for (unsigned c = 0; c < scale; ++c)
+ // g++ does *not* un-roll this inner loop!!!
+ // icc does...
+ sum += *ptr[r]++;
+
+ *po++ = (round_it + sum) / scale2;
+ }
+ }
+
+ trace::exiting("subsampling::impl::integral_");
+ return output;
+ }
+
+
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ integral_3(const Image<I>& input_)
+ {
+ trace::entering("subsampling::impl::integral_3");
+
+ const unsigned scale = 3;
+
+ const I& input = exact(input_);
+ const unsigned area = scale * scale;
+
+ typedef mln_value(I) V;
+ typedef mln_sum(V) S;
+ typedef mln_site(I) P;
+
+ box<P> b = make::box2d((input.nrows() + scale - 1) / scale,
+ (input.ncols() + scale - 1) / scale);
+ const unsigned up = b.ncols();
+
+ mln_concrete(I) sub(b, 0);
+ V* p_sub = sub.buffer();
+
+ mln_ch_value(I, S) integral_sum(b, 0);
+ S* p_isum = integral_sum.buffer();
+
+ mln_ch_value(I, S) integral_sum_2(b, 0);
+ S* p_isum_2 = integral_sum_2.buffer();
+
+ const unsigned nrows = input.nrows();
+ const unsigned ncols = input.ncols();
+
+ for (unsigned row = 0; row < nrows; row += scale)
+ {
+ S h_sum = 0, h_sum_2 = 0;
+ const V* ptr1 = & input.at_(row, 0);
+ const V* ptr2 = & input.at_(row + 1, 0);
+ const V* ptr3 = & input.at_(row + 2, 0);
+ for (unsigned col = 0; col < ncols; col += scale)
+ {
+ S sum;
+ sum = *ptr1++ + *ptr1++ + *ptr1++;
+ sum += *ptr2++ + *ptr2++ + *ptr2++;
+ sum += *ptr3++ + *ptr3++ + *ptr3++;
+
+ S val = sum / area;
+ *p_sub++ = val;
+
+ h_sum += val;
+ h_sum_2 += val * val;
+
+ if (row != 0)
+ {
+ *p_isum = h_sum + *(p_isum - up);
+ *p_isum_2 = h_sum_2 + *(p_isum_2 - up);
+ }
+ else
+ {
+ // exception
+ *p_isum = h_sum;
+ *p_isum_2 = h_sum_2;
+ }
+
+ p_isum += 1;
+ p_isum_2 += 1;
+ }
+ }
+
+ debug::println(sub);
+ debug::println(integral_sum);
+ debug::println(integral_sum_2);
+
+ trace::exiting("subsampling::impl::integral_3");
+ return sub;
+ }
+
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ integral(const Image<I>& input, unsigned scale)
+ {
+ // mln_precondition(input.nrows() % scale == 0);
+ // mln_precondition(input.ncols() % scale == 0);
+ if (scale == 3)
+ return integral_3(input);
+ else
+ std::cerr << "NYI!" << std::endl;
+ }
+
+
+ } // end of namespace mln::subsampling::impl
+
+
+
+
+ // Facades.
+
+ template <typename I>
+ inline
+ mln_concrete(I)
+ integral(const Image<I>& input_, unsigned scale)
+ {
+ trace::entering("subsampling::integral");
+
+ const I& input = exact(input_);
+
+ mln_precondition(input.is_valid());
+ mln_precondition(input.domain().pmin() == literal::origin);
+ mln_precondition(scale > 1);
+
+ mln_concrete(I) output;
+ output = impl::integral(input, scale);
+
+ trace::exiting("subsampling::integral");
+ return output;
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::subsampling
+
+} // end of namespace mln
+
+
+#endif // ! MLN_SUBSAMPLING_INTEGRAL_HH
Index: theo/mln/subsampling/in.pgm.gz
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes on: theo/mln/subsampling/in.pgm.gz
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Index: theo/mln/subsampling/debase.cc
--- theo/mln/subsampling/debase.cc (revision 0)
+++ theo/mln/subsampling/debase.cc (revision 0)
@@ -0,0 +1,23 @@
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/util/timer.hh>
+
+#include "debase.hh"
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+ image2d<int_u8> in;
+ io::pgm::load(in, "in.pgm");
+
+ util::timer t;
+ t.start();
+ image2d<int_u8> out = subsampling::debase(in, 3, dpoint2d(1,1));
+ float t_ = t.stop();
+ std::cout << t_ << std::endl;
+
+ io::pgm::save(out, "out.pgm");
+}
Index: theo/mln/subsampling/integral.cc
--- theo/mln/subsampling/integral.cc (revision 0)
+++ theo/mln/subsampling/integral.cc (revision 0)
@@ -0,0 +1,38 @@
+#include <mln/io/pgm/load.hh>
+#include <mln/io/pgm/save.hh>
+#include <mln/util/timer.hh>
+
+#include "integral.hh"
+
+#include <mln/debug/iota.hh>
+#include <mln/debug/println.hh>
+
+
+int main()
+{
+ using namespace mln;
+ using value::int_u8;
+
+
+ image2d<int_u8> in(6, 9);
+ debug::iota(in);
+ debug::println(in);
+
+ image2d<int_u8> out = subsampling::integral(in, 3);
+// debug::println(out);
+
+
+// {
+// image2d<int_u8> in;
+// io::pgm::load(in, "in.pgm");
+
+// util::timer t;
+// t.start();
+// image2d<int_u8> out = subsampling::integral(in, 3);
+// float t_ = t.stop();
+// std::cout << t_ << std::endl;
+
+// io::pgm::save(out, "out.pgm");
+// }
+
+}
Index: theo/mln/browsing/window_sliding.cc
--- theo/mln/browsing/window_sliding.cc (revision 0)
+++ theo/mln/browsing/window_sliding.cc (revision 0)
@@ -0,0 +1,52 @@
+#include <iostream>
+#include <cassert>
+
+
+
+
+void window_sliding(unsigned nr, unsigned nc,
+ unsigned h, unsigned w)
+{
+ const unsigned h_2 = h / 2;
+ const int d_row_up = - 1 - h_2, d_row_down = h_2;
+
+ // top part
+ for (int row = 0; row <= h_2; ++row)
+ {
+ assert(row + d_up < 0);
+ assert(row + d_down >= 0 && row + d_down < nr);
+ // top left
+ // ...
+
+ // top middle
+ // ...
+
+ // top right
+ // ...
+ }
+ // main part
+ for (int row = h_2 + 1; row <= nr - 1 - h_2; ++row)
+ {
+ assert(row + d_up >= 0 && row + d_up < nr);
+ assert(row + d_down >= 0 && row + d_down < nr);
+ }
+ // bottom part
+ for (int row = nr - h_2; row < nr; ++row)
+ {
+ assert(row + d_up >= 0 && row + d_up < nr);
+ assert(row + d_down >= nr);
+ }
+}
+
+
+
+int main()
+{
+
+// unsigned nr = 50, nc = 100;
+
+ unsigned nr = 10, nc = 10;
+ unsigned h = 3, w = 5;
+ window_sliding(nr, nc, h, w);
+
+}
1
0

[Olena] #206: Add the sources of the images of the ISMM 2009 paper to the Olena repository
by Olena Trac 12 Nov '09
by Olena Trac 12 Nov '09
12 Nov '09
#206: Add the sources of the images of the ISMM 2009 paper to the Olena
repository
-----------------------------------+----------------------------------------
Reporter: levill_r | Owner: levill_r
Type: enhancement | Status: new
Priority: minor | Milestone: Olena 1.1
Component: other | Version: 1.0
Keywords: reproducible research |
-----------------------------------+----------------------------------------
Most of the work is already done, since the repository of the ISMM 2009
paper contains the material to automatically generate the images (needs
some clean up though).
Once moved to the Olena repository, remove the generators from the ISMM
2009 repository and only keep the end products (and possibly add Make
rules to automate the update (copy) of the images from the Olena
repository).
--
Ticket URL: <https://trac.lrde.org/olena/ticket/206>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
1
1

12 Nov '09
#173: Complete the graph fusion example started with Géraud Béguin
----------------------+-----------------------------------------------------
Reporter: levill_r | Owner: Olena Team
Type: task | Status: new
Priority: minor | Milestone:
Component: other | Version: 1.0
Keywords: IGR |
----------------------+-----------------------------------------------------
See:
* source:branches/cleanup-2008/milena/sandbox/beguin/irm.cc
* source:branches/cleanup-2008/milena/sandbox/beguin/fusion_graph.hh
--
Ticket URL: <https://trac.lrde.org/olena/ticket/173>
Olena <http://olena.lrde.epita.fr>
Olena, a generic and efficient C++ image processing library.
2
1
* mln/core/box_runend_piter.hh: New iterator.
* tests/core/other/Makefile.am,
* tests/core/other/box_runend_piter.cc: New test.
---
milena/ChangeLog | 9 ++
milena/mln/core/box_runend_piter.hh | 178 +++++++++++++++++++++++++++
milena/tests/core/other/Makefile.am | 2 +
milena/tests/core/other/box_runend_piter.cc | 41 ++++++
4 files changed, 230 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/core/box_runend_piter.hh
create mode 100644 milena/tests/core/other/box_runend_piter.cc
diff --git a/milena/ChangeLog b/milena/ChangeLog
index cdfda50..f835a42 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,12 @@
+2009-11-09 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add box_runend_piter.
+
+ * mln/core/box_runend_piter.hh: New iterator.
+
+ * tests/core/other/Makefile.am,
+ * tests/core/other/box_runend_piter.cc: New test.
+
2009-11-03 Guillaume Lazzara <z(a)lrde.epita.fr>
* mln/value/label_32.hh: New.
diff --git a/milena/mln/core/box_runend_piter.hh b/milena/mln/core/box_runend_piter.hh
new file mode 100644
index 0000000..a0b1d32
--- /dev/null
+++ b/milena/mln/core/box_runend_piter.hh
@@ -0,0 +1,178 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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_BOX_RUNEND_PITER_HH
+# define MLN_CORE_BOX_RUNEND_PITER_HH
+
+/// \file
+///
+/// Definition of iterators on points by lines.
+
+# include <mln/core/internal/site_iterator_base.hh>
+# include <mln/core/site_set/box.hh>
+
+
+#define mln_box_runend_piter(I) typename mln::box_runend_piter<mln_psite(I)>
+#define mln_box_runend_piter_(I) mln::box_runend_piter<mln_psite(I)>
+
+
+namespace mln
+{
+
+ /*! \brief A generic backward iterator on points by lines.
+ *
+ * The parameter \c P is the type of points.
+ */
+ template <typename P>
+ class box_runend_piter :
+ public internal::site_set_iterator_base< box<P>,
+ box_runend_piter<P> >
+ {
+ typedef box_runend_piter<P> self_;
+ typedef internal::site_set_iterator_base< box<P>, self_ > super_;
+ public:
+
+ // Make definitions from super class available.
+ enum { dim = super_::dim };
+
+ /*! \brief Constructor.
+ *
+ * \param[in] b A box.
+ */
+ box_runend_piter(const box<P>& b);
+
+ /// Delayed initialization.
+ void init_(const box<P>& b);
+
+ box_runend_piter();
+
+ /// Test the iterator validity.
+ bool is_valid_() const;
+
+ /// Invalidate the iterator.
+ void invalidate_();
+
+ /// Start an iteration.
+ void start_();
+
+ /// Go to the next point.
+ void next_();
+
+ /// Give the lenght of the run
+ unsigned run_length() const;
+
+ private:
+ using super_::p_;
+ using super_::s_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+
+ // box_runend_piter<P>
+
+ template <typename P>
+ inline
+ box_runend_piter<P>::box_runend_piter()
+ {
+ }
+
+ template <typename P>
+ inline
+ box_runend_piter<P>::box_runend_piter(const box<P>& b)
+ {
+ init_(b);
+ }
+
+ template <typename P>
+ inline
+ void
+ box_runend_piter<P>::init_(const box<P>& b)
+ {
+ this->change_target(b);
+ }
+
+
+ template <typename P>
+ inline
+ bool
+ box_runend_piter<P>::is_valid_() const
+ {
+ return p_[0] != static_cast<mln_coord(P)>(s_->pmin()[0] - 1);
+ }
+
+ template <typename P>
+ inline
+ void
+ box_runend_piter<P>::invalidate_()
+ {
+ p_[0] = static_cast<mln_coord(P)>(s_->pmin()[0] - 1);
+ }
+
+ template <typename P>
+ inline
+ void
+ box_runend_piter<P>::start_()
+ {
+ p_ = s_->pmax();
+ }
+
+ template <typename P>
+ inline
+ void
+ box_runend_piter<P>::next_()
+ {
+ // Do we want this run for image in 3d?
+ for (int c = dim - 2; c >= 0; --c)
+ {
+ if (p_[c] != s_->pmin()[c])
+ {
+ --p_[c];
+ break;
+ }
+ else
+ p_[c] = s_->pmax()[c];
+ }
+
+ if (p_ == s_->pmax())
+ invalidate_();
+ }
+
+ template <typename P>
+ inline
+ unsigned
+ box_runend_piter<P>::run_length() const
+ {
+ return s_->len(dim - 1);
+ }
+
+
+# endif // ! MLN_INCLUDE_ONLY
+
+} // end of namespace mln
+
+
+#endif // ! MLN_CORE_BOX_RUNEND_PITER_HH
diff --git a/milena/tests/core/other/Makefile.am b/milena/tests/core/other/Makefile.am
index b86e4e3..9443837 100644
--- a/milena/tests/core/other/Makefile.am
+++ b/milena/tests/core/other/Makefile.am
@@ -21,6 +21,7 @@ include $(top_srcdir)/milena/tests/tests.mk
check_PROGRAMS = \
box_runstart_piter \
+ box_runend_piter \
category \
dpoints_pixter \
graph_elt_neighborhood \
@@ -40,6 +41,7 @@ check_PROGRAMS = \
w_window
box_runstart_piter_SOURCES = box_runstart_piter.cc
+box_runend_piter_SOURCES = box_runend_piter.cc
category_SOURCES = category.cc
dpoints_pixter_SOURCES = dpoints_pixter.cc
graph_elt_neighborhood_SOURCES = graph_elt_neighborhood.cc
diff --git a/milena/tests/core/other/box_runend_piter.cc b/milena/tests/core/other/box_runend_piter.cc
new file mode 100644
index 0000000..fe7cb43
--- /dev/null
+++ b/milena/tests/core/other/box_runend_piter.cc
@@ -0,0 +1,41 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of Olena.
+//
+// Olena is free software: you can redistribute it and/or modify it under
+// the terms of the GNU General Public License as published by the Free
+// Software Foundation, version 2 of the License.
+//
+// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+//
+// As a special exception, you may use this file as part of a free
+// software project 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.
+
+#include <mln/core/alias/box2d.hh>
+#include <mln/core/box_runend_piter.hh>
+
+
+int main()
+{
+ using namespace mln;
+
+ box2d b(3,3);
+ box_runend_piter<point2d> p(b);
+ unsigned i = 2;
+ for_all(p)
+ mln_assertion(p == point2d(i, 2));
+
+ mln_assertion(p.run_length() == 3);
+}
--
1.5.6.5
1
0
---
milena/ChangeLog | 90 +++++++++++++++++++++++-----------------------
milena/sandbox/ChangeLog | 20 +++++-----
2 files changed, 55 insertions(+), 55 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index f8e112a..cdfda50 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -2,36 +2,6 @@
* mln/value/label_32.hh: New.
-2009-10-02 Roland Levillain <roland(a)lrde.epita.fr>
-
- Add ISMM 2009 input images and generate outputs.
-
- * apps/papers/levillain.09.ismm/Makefile.am (data_DATA):
- New variable.
- (lena-s.ppm, graph-s.png, graph-s.neato, m283-s.off):
- New targets.
- * apps/papers/levillain.09.ismm/seeds.pgm,
- * apps/papers/levillain.09.ismm/m283-c.off:
- New (imported).
-
-2009-10-02 Roland Levillain <roland(a)lrde.epita.fr>
-
- Import the code of the illustrations of the ISMM 2009 paper.
-
- * apps/papers/,
- * apps/papers/levillain.09.ismm/:
- New directories.
- * apps/papers/levillain.09.ismm/chain.hh,
- * apps/papers/levillain.09.ismm/complex.cc,
- * apps/papers/levillain.09.ismm/graph.cc,
- * apps/papers/levillain.09.ismm/image2d.cc:
- New (imported from ISMM 2009).
- Adjust.
- * apps/Makefile.am (SUBDIRS): Add papers.
- * apps/papers/Makefile.am,
- * apps/papers/levillain.09.ismm/Makefile.am:
- New.
-
2009-10-28 Guillaume Lazzara <z(a)lrde.epita.fr>
Small fixes.
@@ -57,6 +27,15 @@
* mln/data/all.hh: Include this new file.
+2009-10-26 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Regen Makefile helpers.
+
+ * doc/examples/examples.mk,
+ * headers.mk,
+ * tests/unit_test/unit-tests.mk:
+ Regen.
+
2009-10-22 Guillaume Lazzara <z(a)lrde.epita.fr>
Small fixes.
@@ -72,15 +51,6 @@
* milena/mln/subsampling/subsampling.hh: Fix invalid min rows and
cols.
-2009-10-26 Roland Levillain <roland(a)lrde.epita.fr>
-
- Regen Makefile helpers.
-
- * doc/examples/examples.mk,
- * headers.mk,
- * tests/unit_test/unit-tests.mk:
- Regen.
-
2009-10-16 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Add AVS field file support.
@@ -136,6 +106,36 @@
* mln/data/memcpy_.hh (mln::data::impl::memcpy_): Here.
+2009-10-02 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Add ISMM 2009 input images and generate outputs.
+
+ * apps/papers/levillain.09.ismm/Makefile.am (data_DATA):
+ New variable.
+ (lena-s.ppm, graph-s.png, graph-s.neato, m283-s.off):
+ New targets.
+ * apps/papers/levillain.09.ismm/seeds.pgm,
+ * apps/papers/levillain.09.ismm/m283-c.off:
+ New (imported).
+
+2009-10-02 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Import the code of the illustrations of the ISMM 2009 paper.
+
+ * apps/papers/,
+ * apps/papers/levillain.09.ismm/:
+ New directories.
+ * apps/papers/levillain.09.ismm/chain.hh,
+ * apps/papers/levillain.09.ismm/complex.cc,
+ * apps/papers/levillain.09.ismm/graph.cc,
+ * apps/papers/levillain.09.ismm/image2d.cc:
+ New (imported from ISMM 2009).
+ Adjust.
+ * apps/Makefile.am (SUBDIRS): Add papers.
+ * apps/papers/Makefile.am,
+ * apps/papers/levillain.09.ismm/Makefile.am:
+ New.
+
2009-10-02 Guillaume Lazzara <z(a)lrde.epita.fr>
Small fixes in documentation.
@@ -269,6 +269,12 @@
(mln::world::inter_pixel::dbl_neighb2d):
...this typedef.
+2009-09-30 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Fix a precondition in apps/graph-morpho/io.hh.
+
+ * apps/graph-morpho/io.hh (println): Here.
+
2009-09-29 Roland Levillain <roland(a)lrde.epita.fr>
Use Milena's dilation/erosion in graph morpho on bin_1complex_image2d.
@@ -280,12 +286,6 @@
(impl::dilation_v2e(const mln::bin_1complex_image2d&)):
Here.
-2009-09-30 Roland Levillain <roland(a)lrde.epita.fr>
-
- Fix a precondition in apps/graph-morpho/io.hh.
-
- * apps/graph-morpho/io.hh (println): Here.
-
2009-09-29 Roland Levillain <roland(a)lrde.epita.fr>
Small improvements in mln::util::tracked_ptr.
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index cd27478..9323781 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -11,18 +11,18 @@
Fix compilation issues in IGR's code.
- * sandbox/fabien/igr/Makefile: Add target 'all' and do not use
+ * fabien/igr/Makefile: Add target 'all' and do not use
watershed.hh as dependency.
- * sandbox/fabien/igr/fun_labels.cc,
- * sandbox/fabien/igr/graph.cc,
- * sandbox/fabien/igr/mean_slices.cc,
- * sandbox/fabien/igr/nbasins_finder.cc,
- * sandbox/fabien/igr/seg2d.cc,
- * sandbox/fabien/igr/seg_vol_irm.hh,
- * sandbox/fabien/igr/watershed2d.cc,
- * sandbox/fabien/igr/watershed3d.cc,
- * sandbox/fabien/igr/wst_edges.cc: Fix compilations issues.
+ * fabien/igr/fun_labels.cc,
+ * fabien/igr/graph.cc,
+ * fabien/igr/mean_slices.cc,
+ * fabien/igr/nbasins_finder.cc,
+ * fabien/igr/seg2d.cc,
+ * fabien/igr/seg_vol_irm.hh,
+ * fabien/igr/watershed2d.cc,
+ * fabien/igr/watershed3d.cc,
+ * fabien/igr/wst_edges.cc: Fix compilations issues.
2009-10-28 Guillaume Lazzara <z(a)lrde.epita.fr>
--
1.5.6.5
2
1
* src/all_methods.erb.cc,
* src/all_methods.erb.hh,
* src/data.cc,
* src/data.hh,
* src/data.hxx,
* src/dyn.hh,
* src/function.erb.cc,
* src/function.erb.hh,
* src/function_loader.cc,
* src/function_loader.hh,
* src/name_of.hh,
* src/ruby_stream.cc,
* src/ruby_stream.hh,
* test/fixtures/my_lib/damien.hh,
* test/fixtures/my_lib/damien.hxx:
Here.
---
dynamic-use-of-static-c++/ChangeLog | 21 ++++++++++++++++++++
dynamic-use-of-static-c++/src/all_methods.erb.cc | 2 +-
dynamic-use-of-static-c++/src/all_methods.erb.hh | 2 +-
dynamic-use-of-static-c++/src/data.cc | 2 +-
dynamic-use-of-static-c++/src/data.hh | 2 +-
dynamic-use-of-static-c++/src/data.hxx | 2 +-
dynamic-use-of-static-c++/src/dyn.hh | 7 ++---
dynamic-use-of-static-c++/src/function.erb.cc | 6 ++--
dynamic-use-of-static-c++/src/function.erb.hh | 6 ++--
dynamic-use-of-static-c++/src/function_loader.cc | 2 +-
dynamic-use-of-static-c++/src/function_loader.hh | 2 +-
dynamic-use-of-static-c++/src/name_of.hh | 6 ++--
dynamic-use-of-static-c++/src/ruby_stream.cc | 6 ++--
dynamic-use-of-static-c++/src/ruby_stream.hh | 6 ++--
.../test/fixtures/my_lib/damien.hh | 9 +++----
.../test/fixtures/my_lib/damien.hxx | 11 ++++-----
16 files changed, 55 insertions(+), 37 deletions(-)
diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog
index f7e7988..4c5bdb4 100644
--- a/dynamic-use-of-static-c++/ChangeLog
+++ b/dynamic-use-of-static-c++/ChangeLog
@@ -1,5 +1,26 @@
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Normalize header guards.
+
+ * src/all_methods.erb.cc,
+ * src/all_methods.erb.hh,
+ * src/data.cc,
+ * src/data.hh,
+ * src/data.hxx,
+ * src/dyn.hh,
+ * src/function.erb.cc,
+ * src/function.erb.hh,
+ * src/function_loader.cc,
+ * src/function_loader.hh,
+ * src/name_of.hh,
+ * src/ruby_stream.cc,
+ * src/ruby_stream.hh,
+ * test/fixtures/my_lib/damien.hh,
+ * test/fixtures/my_lib/damien.hxx:
+ Here.
+
+2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Add missing header guards.
* libmd5/md5.hh,
diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.cc b/dynamic-use-of-static-c++/src/all_methods.erb.cc
index 347ffc6..531d525 100644
--- a/dynamic-use-of-static-c++/src/all_methods.erb.cc
+++ b/dynamic-use-of-static-c++/src/all_methods.erb.cc
@@ -59,4 +59,4 @@ namespace dyn
}
-#endif // !DYN_ALL_METHODS_CC
+#endif // ! DYN_ALL_METHODS_CC
diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.hh b/dynamic-use-of-static-c++/src/all_methods.erb.hh
index 948ccdd..a838d3b 100644
--- a/dynamic-use-of-static-c++/src/all_methods.erb.hh
+++ b/dynamic-use-of-static-c++/src/all_methods.erb.hh
@@ -59,4 +59,4 @@ namespace dyn
}
-#endif // !DYN_ALL_METHODS_HH
+#endif // ! DYN_ALL_METHODS_HH
diff --git a/dynamic-use-of-static-c++/src/data.cc b/dynamic-use-of-static-c++/src/data.cc
index 127dc87..2912e35 100644
--- a/dynamic-use-of-static-c++/src/data.cc
+++ b/dynamic-use-of-static-c++/src/data.cc
@@ -150,4 +150,4 @@ dyn::data operator+(const dyn::data& lhs, const dyn::data& rhs)
return dyn::internal::operator_plus(lhs, rhs);
}
-#endif
+#endif // ! DYN_DATA_CC
diff --git a/dynamic-use-of-static-c++/src/data.hh b/dynamic-use-of-static-c++/src/data.hh
index aa8c192..0725464 100644
--- a/dynamic-use-of-static-c++/src/data.hh
+++ b/dynamic-use-of-static-c++/src/data.hh
@@ -441,4 +441,4 @@ struct dyn_choose_data_proxy<T, (dyn::policy::type)(dyn::policy::is_ref + dyn::p
# include "data.hxx"
# endif
-#endif
+#endif // ! DYN_DATA_HH
diff --git a/dynamic-use-of-static-c++/src/data.hxx b/dynamic-use-of-static-c++/src/data.hxx
index 1ff7886..2990596 100644
--- a/dynamic-use-of-static-c++/src/data.hxx
+++ b/dynamic-use-of-static-c++/src/data.hxx
@@ -83,4 +83,4 @@ bool operator!=(const dyn::data& lhs, const dyn::data& rhs);
bool operator==(const dyn::data& lhs, const dyn::data& rhs);
dyn::data operator+(const dyn::data& lhs, const dyn::data& rhs);
-#endif
+#endif // ! DYN_DATA_HXX
diff --git a/dynamic-use-of-static-c++/src/dyn.hh b/dynamic-use-of-static-c++/src/dyn.hh
index d12a790..1e7cbf8 100644
--- a/dynamic-use-of-static-c++/src/dyn.hh
+++ b/dynamic-use-of-static-c++/src/dyn.hh
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef DYN_HH
-# define DYN_HH
+#ifndef DYN_DYN_HH
+# define DYN_DYN_HH
# include "config.hh"
@@ -83,5 +83,4 @@ namespace dyn
# include "function_loader.hh"
-#endif
-
+#endif // ! DYN_DYN_HH
diff --git a/dynamic-use-of-static-c++/src/function.erb.cc b/dynamic-use-of-static-c++/src/function.erb.cc
index b83fd7b..93c50b5 100644
--- a/dynamic-use-of-static-c++/src/function.erb.cc
+++ b/dynamic-use-of-static-c++/src/function.erb.cc
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef FUNCTION_HXX
-#define FUNCTION_HXX
+#ifndef DYN_FUNCTION_CC
+# define DYN_FUNCTION_CC
# include <cassert>
# include <string>
@@ -69,4 +69,4 @@ namespace dyn
} // end of namespace dyn
-#endif
+#endif // ! DYN_FUNCTION_CC
diff --git a/dynamic-use-of-static-c++/src/function.erb.hh b/dynamic-use-of-static-c++/src/function.erb.hh
index b814938..c796640 100644
--- a/dynamic-use-of-static-c++/src/function.erb.hh
+++ b/dynamic-use-of-static-c++/src/function.erb.hh
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef FUNCTION_HH
-#define FUNCTION_HH
+#ifndef DYN_FUNCTION_HH
+# define DYN_FUNCTION_HH
# include <cassert>
# include <string>
@@ -85,4 +85,4 @@ namespace dyn
} // end of namespace dyn
-#endif
+#endif // ! DYN_FUNCTION_HH
diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc
index 0b300be..9dbc138 100644
--- a/dynamic-use-of-static-c++/src/function_loader.cc
+++ b/dynamic-use-of-static-c++/src/function_loader.cc
@@ -587,4 +587,4 @@ namespace dyn {
} // end of namespace dyn
-#endif
+#endif // ! DYN_FUNCTION_LOADER_CC
diff --git a/dynamic-use-of-static-c++/src/function_loader.hh b/dynamic-use-of-static-c++/src/function_loader.hh
index 27edb37..b57d9b5 100644
--- a/dynamic-use-of-static-c++/src/function_loader.hh
+++ b/dynamic-use-of-static-c++/src/function_loader.hh
@@ -51,4 +51,4 @@ namespace dyn {
} // end of namespace dyn
-#endif
+#endif // ! DYN_FUNCTION_LOADER_HH
diff --git a/dynamic-use-of-static-c++/src/name_of.hh b/dynamic-use-of-static-c++/src/name_of.hh
index dca878b..ad688ff 100644
--- a/dynamic-use-of-static-c++/src/name_of.hh
+++ b/dynamic-use-of-static-c++/src/name_of.hh
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef NAME_OF
-# define NAME_OF
+#ifndef DYN_NAME_OF_HH
+# define DYN_NAME_OF_HH
# include <typeinfo>
@@ -207,4 +207,4 @@ mlc_set_name(std::ostringstream);
# endif
-#endif
+#endif // ! DYN_NAME_OF_HH
diff --git a/dynamic-use-of-static-c++/src/ruby_stream.cc b/dynamic-use-of-static-c++/src/ruby_stream.cc
index 04a9d16..e7f8abe 100644
--- a/dynamic-use-of-static-c++/src/ruby_stream.cc
+++ b/dynamic-use-of-static-c++/src/ruby_stream.cc
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef RUBY_STREAM_CC
-# define RUBY_STREAM_CC
+#ifndef DYN_RUBY_STREAM_CC
+# define DYN_RUBY_STREAM_CC
# include "ruby_stream.hh"
@@ -33,4 +33,4 @@ namespace ruby
eval_type eval;
}
-#endif
+#endif // ! DYN_RUBY_STREAM_CC
diff --git a/dynamic-use-of-static-c++/src/ruby_stream.hh b/dynamic-use-of-static-c++/src/ruby_stream.hh
index 12c9455..f327d20 100644
--- a/dynamic-use-of-static-c++/src/ruby_stream.hh
+++ b/dynamic-use-of-static-c++/src/ruby_stream.hh
@@ -23,8 +23,8 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef RUBY_STREAM_HH
-#define RUBY_STREAM_HH
+#ifndef DYN_RUBY_STREAM_HH
+# define DYN_RUBY_STREAM_HH
// #define DEBUG_RUBY_STREAM
@@ -122,4 +122,4 @@ ruby::stream& operator<< (ruby::stream& stream, const T& obj)
return stream;
}
-#endif
+#endif // ! DYN_RUBY_STREAM_HH
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
index 63dc041..c2222a8 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
@@ -23,10 +23,10 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef DAMIEN_HH
-#define DAMIEN_HH
+#ifndef MY_LIB_DAMIEN_HH
+# define MY_LIB_DAMIEN_HH
-#include <iostream>
+# include <iostream>
struct up
{
@@ -82,5 +82,4 @@ void print(const T&);
template <typename T>
T sqr(const T&);
-#endif
-
+#endif // ! MY_LIB_DAMIEN_HH
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
index 0202a44..8269ac3 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
@@ -23,11 +23,11 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#ifndef DAMIEN_HXX
-#define DAMIEN_HXX
+#ifndef MY_LIB_DAMIEN_HXX
+# define MY_LIB_DAMIEN_HXX
-#include <iostream>
-#include "damien.hh"
+# include <iostream>
+# include "damien.hh"
template <typename T>
const T* down<T>::get_t() const { return &t_; }
@@ -78,5 +78,4 @@ T sqr(const T& a)
}
-#endif
-
+#endif // ! MY_LIB_DAMIEN_HXX
--
1.6.5
1
0
* libmd5/md5.hh,
* src/config.hh.in,
* test/fixtures/my_lib/lib.hh:
Here.
---
dynamic-use-of-static-c++/ChangeLog | 9 +++++++++
dynamic-use-of-static-c++/libmd5/md5.hh | 5 +++++
dynamic-use-of-static-c++/src/config.hh.in | 13 +++++++++----
.../test/fixtures/my_lib/lib.hh | 17 +++++++++++------
4 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog
index 410c942..f7e7988 100644
--- a/dynamic-use-of-static-c++/ChangeLog
+++ b/dynamic-use-of-static-c++/ChangeLog
@@ -1,5 +1,14 @@
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Add missing header guards.
+
+ * libmd5/md5.hh,
+ * src/config.hh.in,
+ * test/fixtures/my_lib/lib.hh:
+ Here.
+
+2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+
* README: Update.
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
diff --git a/dynamic-use-of-static-c++/libmd5/md5.hh b/dynamic-use-of-static-c++/libmd5/md5.hh
index 5c72059..d348342 100644
--- a/dynamic-use-of-static-c++/libmd5/md5.hh
+++ b/dynamic-use-of-static-c++/libmd5/md5.hh
@@ -39,6 +39,9 @@ documentation and/or software.
*/
+#ifndef MD5_HH
+# define MD5_HH
+
#include <cstdio>
#include <fstream>
#include <iostream>
@@ -107,3 +110,5 @@ private:
uint4 s, uint4 ac);
};
+
+#endif // ! MD5_HH
diff --git a/dynamic-use-of-static-c++/src/config.hh.in b/dynamic-use-of-static-c++/src/config.hh.in
index 0ce13fc..1939af5 100644
--- a/dynamic-use-of-static-c++/src/config.hh.in
+++ b/dynamic-use-of-static-c++/src/config.hh.in
@@ -25,7 +25,12 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
-#define DYNDIR "@DYNDIR@"
-#define DYN_DATADIR "@DYN_DATADIR@"
-#define DYN_FIXTURES "@DYN_FIXTURES@"
-#define MILENA_DIR "@MILENA_DIR@"
+#ifndef DYN_CONFIG_HH
+# define DYN_CONFIG_HH
+
+# define DYNDIR "@DYNDIR@"
+# define DYN_DATADIR "@DYN_DATADIR@"
+# define DYN_FIXTURES "@DYN_FIXTURES@"
+# define MILENA_DIR "@MILENA_DIR@"
+
+#endif // ! DYN_CONFIG_HH
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
index a03fc22..e3a42c7 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
@@ -25,10 +25,13 @@
// part of generic lib
-#include <cmath>
-#include <iostream>
-#include <sstream> // Warning does not work without me
-#include <vector>
+#ifndef MY_LIB_LIB_HH
+# define MY_LIB_LIB_HH
+
+# include <cmath>
+# include <iostream>
+# include <sstream> // Warning does not work without me
+# include <vector>
template <class T>
struct u
@@ -126,8 +129,10 @@ namespace my_lib
std::ostream& ostr_;
};
-#define stl_each(c, i) for (i = c.begin(); i != c.end(); ++i)
+# define stl_each(c, i) for (i = c.begin(); i != c.end(); ++i)
-#define echo(i) std::cout << i << std::endl
+# define echo(i) std::cout << i << std::endl
} // end of my_lib
+
+#endif // ! MY_LIB_LIB_HH
--
1.6.5
1
0
---
dynamic-use-of-static-c++/ChangeLog | 4 ++++
dynamic-use-of-static-c++/README | 32 ++++++++++++++++++++------------
2 files changed, 24 insertions(+), 12 deletions(-)
diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog
index 3654b03..410c942 100644
--- a/dynamic-use-of-static-c++/ChangeLog
+++ b/dynamic-use-of-static-c++/ChangeLog
@@ -1,5 +1,9 @@
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+ * README: Update.
+
+2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Aesthetic changes w.r.t. white space and comments.
* bin/dyn-config.in,
diff --git a/dynamic-use-of-static-c++/README b/dynamic-use-of-static-c++/README
index 112dac3..9fb6982 100644
--- a/dynamic-use-of-static-c++/README
+++ b/dynamic-use-of-static-c++/README
@@ -1,23 +1,31 @@
HOW TO USE THIS PROJECT
+ Note: These instructions have been updated since this project has
+ been re-integrated into the Olena repository (October 2009).
+ However, they will probably evolve again, since the project should
+ eventually become a part of the Olena distribution. The biggest
+ change will probably be to run things from the parent directory
+ (Olena's) and enable a configure flag to activate this module.
+
From the repository:
- # Initialize the build system
+ # Initialize the build system.
./bootstrap
- # Make a build dir
+ # Make a build dir.
mkdir _build && cd _build
- # Configure the build for your system
- # The config.site try to use more efficient tools (g++-4.0 and ccache)
- # it also enable the configure caching.
- # With --prefix you can set the destination (here _install)
+ # Configure the build for your system.
+ ../configure
+
+ # You can also use the file `config.site' shipped with the
+ # distribution, though it is a bit old. `config.site' tries to use
+ # more efficient tools (g++-4.0 and ccache). It also enables
+ # configure's caching mechanism. With `--prefix' you can set the
+ # destination (here, `../_install').
CONFIG_SITE=`pwd`/../config.site ../configure --prefix=`pwd`/../_install
- # For now need to add the bin directory to your path because dyn-config is
- # by programs compiled with our system
+ # You may want to add the `bin/' directory to your path, but it is
+ # no longer mandatory (`dyn-config' from `bin/' used to be required
+ # by programs compiled with our system).
export PATH=$PATH:`pwd`/bin
-
- make check # The test with a latest prototype of olena will fail if you
- # don't checkout it:
- # cd test/olena && svn co https://svn.lrde.epita.fr/svn/oln/prototypes/proto-stl-style
--
1.6.5
1
0

03 Nov '09
* bin/dyn-config.in,
* bin/mk_swig_input,
* bin/swig_tree_to_yaml,
* bin/yaml_to_dyn_decls,
* config/erbx,
* data/function.cc,
* src/wrappers/milena.cc,
* src/wrappers/milena.hh,
* swig/dyn.i,
* swig/mln.i,
* swig/run.in,
* test/test_methods.cc,
* test/wrappers/test-milena.cc:
Here.
---
dynamic-use-of-static-c++/ChangeLog | 19 +++++++
dynamic-use-of-static-c++/bin/dyn-config.in | 2 +-
dynamic-use-of-static-c++/bin/mk_swig_input | 2 +-
dynamic-use-of-static-c++/bin/swig_tree_to_yaml | 2 +-
dynamic-use-of-static-c++/bin/yaml_to_dyn_decls | 2 +-
dynamic-use-of-static-c++/config/erbx | 2 +-
dynamic-use-of-static-c++/data/function.cc | 1 +
dynamic-use-of-static-c++/src/wrappers/milena.cc | 48 +++++++++---------
dynamic-use-of-static-c++/src/wrappers/milena.hh | 48 +++++++++---------
dynamic-use-of-static-c++/swig/dyn.i | 51 ++++++++++----------
dynamic-use-of-static-c++/swig/mln.i | 51 ++++++++++----------
dynamic-use-of-static-c++/swig/run.in | 2 +-
dynamic-use-of-static-c++/test/test_methods.cc | 4 +-
.../test/wrappers/test-milena.cc | 48 +++++++++---------
14 files changed, 153 insertions(+), 129 deletions(-)
diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog
index a510774..3654b03 100644
--- a/dynamic-use-of-static-c++/ChangeLog
+++ b/dynamic-use-of-static-c++/ChangeLog
@@ -1,5 +1,24 @@
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Aesthetic changes w.r.t. white space and comments.
+
+ * bin/dyn-config.in,
+ * bin/mk_swig_input,
+ * bin/swig_tree_to_yaml,
+ * bin/yaml_to_dyn_decls,
+ * config/erbx,
+ * data/function.cc,
+ * src/wrappers/milena.cc,
+ * src/wrappers/milena.hh,
+ * swig/dyn.i,
+ * swig/mln.i,
+ * swig/run.in,
+ * test/test_methods.cc,
+ * test/wrappers/test-milena.cc:
+ Here.
+
+2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Add missing copyright headers.
* bin/dyn-config.in,
diff --git a/dynamic-use-of-static-c++/bin/dyn-config.in b/dynamic-use-of-static-c++/bin/dyn-config.in
index 6ff4d94..84b7b0e 100755
--- a/dynamic-use-of-static-c++/bin/dyn-config.in
+++ b/dynamic-use-of-static-c++/bin/dyn-config.in
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/env ruby
# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
#
diff --git a/dynamic-use-of-static-c++/bin/mk_swig_input b/dynamic-use-of-static-c++/bin/mk_swig_input
index 022cb26..b29cecd 100755
--- a/dynamic-use-of-static-c++/bin/mk_swig_input
+++ b/dynamic-use-of-static-c++/bin/mk_swig_input
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/env ruby
# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
#
diff --git a/dynamic-use-of-static-c++/bin/swig_tree_to_yaml b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
index 696d96c..144b555 100755
--- a/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
+++ b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/env ruby
# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
#
diff --git a/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
index e7a6fc9..52ad7aa 100755
--- a/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
+++ b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/env ruby
# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
#
diff --git a/dynamic-use-of-static-c++/config/erbx b/dynamic-use-of-static-c++/config/erbx
index 383a883..1cb423f 100755
--- a/dynamic-use-of-static-c++/config/erbx
+++ b/dynamic-use-of-static-c++/config/erbx
@@ -1,4 +1,4 @@
-#!/usr/bin/env ruby
+#! /usr/bin/env ruby
# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
#
diff --git a/dynamic-use-of-static-c++/data/function.cc b/dynamic-use-of-static-c++/data/function.cc
index e42cbed..7c5a043 100644
--- a/dynamic-use-of-static-c++/data/function.cc
+++ b/dynamic-use-of-static-c++/data/function.cc
@@ -1,4 +1,5 @@
#include "dyn-light.hh"
+
int foo()
{
return 42;
diff --git a/dynamic-use-of-static-c++/src/wrappers/milena.cc b/dynamic-use-of-static-c++/src/wrappers/milena.cc
index 9baf0e7..5f9bc95 100644
--- a/dynamic-use-of-static-c++/src/wrappers/milena.cc
+++ b/dynamic-use-of-static-c++/src/wrappers/milena.cc
@@ -1,27 +1,27 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project 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.
+/* Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
#include <wrappers/milena.hh>
diff --git a/dynamic-use-of-static-c++/src/wrappers/milena.hh b/dynamic-use-of-static-c++/src/wrappers/milena.hh
index ed4b702..87e8253 100644
--- a/dynamic-use-of-static-c++/src/wrappers/milena.hh
+++ b/dynamic-use-of-static-c++/src/wrappers/milena.hh
@@ -1,27 +1,27 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project 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.
+/* Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_WRAPPERS_MILENA_HH
# define DYN_WRAPPERS_MILENA_HH
diff --git a/dynamic-use-of-static-c++/swig/dyn.i b/dynamic-use-of-static-c++/swig/dyn.i
index 390d2e1..16884ce 100644
--- a/dynamic-use-of-static-c++/swig/dyn.i
+++ b/dynamic-use-of-static-c++/swig/dyn.i
@@ -1,28 +1,29 @@
-// -*- C++ -*-
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project 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.
+ // -*- C++ -*-
+
+/* Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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
/// \brief A wrapper of libdyn.
diff --git a/dynamic-use-of-static-c++/swig/mln.i b/dynamic-use-of-static-c++/swig/mln.i
index dcfe644..0539cfc 100644
--- a/dynamic-use-of-static-c++/swig/mln.i
+++ b/dynamic-use-of-static-c++/swig/mln.i
@@ -1,28 +1,29 @@
-// -*- C++ -*-
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project 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.
+ // -*- C++ -*-
+
+/* Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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
/// \brief A wrapper of libdynmilena.
diff --git a/dynamic-use-of-static-c++/swig/run.in b/dynamic-use-of-static-c++/swig/run.in
index 41ec0e8..92d54fe 100755
--- a/dynamic-use-of-static-c++/swig/run.in
+++ b/dynamic-use-of-static-c++/swig/run.in
@@ -1,4 +1,4 @@
-#!/bin/sh
+#! /bin/sh
# Copyright (C) 2003, 2004, 2006, 2009 Laboratoire d'Informatique de Paris 6
# (LIP6), département Systèmes Répartis Coopératifs (SRC), Université
diff --git a/dynamic-use-of-static-c++/test/test_methods.cc b/dynamic-use-of-static-c++/test/test_methods.cc
index 477ae06..3416a53 100644
--- a/dynamic-use-of-static-c++/test/test_methods.cc
+++ b/dynamic-use-of-static-c++/test/test_methods.cc
@@ -23,9 +23,11 @@
exception does not however invalidate any other reasons why the
executable file might be covered by the GNU General Public License. */
+#include <iostream>
+
#include "dyn-all.hh"
+
using namespace dyn::language;
-#include <iostream>
int main()
{
diff --git a/dynamic-use-of-static-c++/test/wrappers/test-milena.cc b/dynamic-use-of-static-c++/test/wrappers/test-milena.cc
index 831c9db..036c15d 100644
--- a/dynamic-use-of-static-c++/test/wrappers/test-milena.cc
+++ b/dynamic-use-of-static-c++/test/wrappers/test-milena.cc
@@ -1,27 +1,27 @@
-// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of Olena.
-//
-// Olena is free software: you can redistribute it and/or modify it under
-// the terms of the GNU General Public License as published by the Free
-// Software Foundation, version 2 of the License.
-//
-// Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
-//
-// As a special exception, you may use this file as part of a free
-// software project 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.
+/* Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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
/// Exercise the Milena wrappers.
--
1.6.5
1
0
* bin/dyn-config.in,
* bin/mk_swig_input,
* bin/swig_tree_to_yaml,
* bin/yaml_to_dyn_decls,
* bootstrap,
* config/erbx,
* config/mk_local_config_rb_in.rb,
* config/rbconfig_gen.rb,
* config/ruby.m4,
* src/all_methods.erb.cc,
* src/all_methods.erb.hh,
* src/config.hh.in,
* src/cxx_symbols.rb,
* src/data.cc,
* src/data.hh,
* src/data.hxx,
* src/dyn.hh,
* src/function.erb.cc,
* src/function.erb.hh,
* src/function_loader.cc,
* src/function_loader.hh,
* src/function_loader.rb,
* src/name_of.cc,
* src/name_of.hh,
* src/policy.cc,
* src/policy.hh,
* src/ruby_stream.cc,
* src/ruby_stream.hh,
* test/fixtures/my_lib/damien.hh,
* test/fixtures/my_lib/damien.hxx,
* test/fixtures/my_lib/lib.hh,
* test/test_containers.cc,
* test/test_damien.cc,
* test/test_function_loader.cc,
* test/test_function_loader.rb,
* test/test_function_loader_cxx.rb,
* test/test_methods.cc,
* test/test_milena.cc,
* test/test_var_and_val.cc,
* test/vaucanson/test-loader.cc:
Here.
---
dynamic-use-of-static-c++/ChangeLog | 46 ++++++++++++++++++++
dynamic-use-of-static-c++/bin/dyn-config.in | 17 +++++++
dynamic-use-of-static-c++/bin/mk_swig_input | 17 +++++++
dynamic-use-of-static-c++/bin/swig_tree_to_yaml | 17 +++++++
dynamic-use-of-static-c++/bin/yaml_to_dyn_decls | 17 +++++++
dynamic-use-of-static-c++/bootstrap | 16 +++++++
dynamic-use-of-static-c++/config/erbx | 16 +++++++
.../config/mk_local_config_rb_in.rb | 16 +++++++
dynamic-use-of-static-c++/config/rbconfig_gen.rb | 16 +++++++
dynamic-use-of-static-c++/config/ruby.m4 | 15 ++++++
dynamic-use-of-static-c++/src/all_methods.erb.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/all_methods.erb.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/config.hh.in | 27 +++++++++++
dynamic-use-of-static-c++/src/cxx_symbols.rb | 16 +++++++
dynamic-use-of-static-c++/src/data.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/data.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/data.hxx | 25 +++++++++++
dynamic-use-of-static-c++/src/dyn.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/function.erb.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/function.erb.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/function_loader.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/function_loader.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/function_loader.rb | 16 +++++++
dynamic-use-of-static-c++/src/name_of.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/name_of.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/policy.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/policy.hh | 25 +++++++++++
dynamic-use-of-static-c++/src/ruby_stream.cc | 25 +++++++++++
dynamic-use-of-static-c++/src/ruby_stream.hh | 25 +++++++++++
.../test/fixtures/my_lib/damien.hh | 25 +++++++++++
.../test/fixtures/my_lib/damien.hxx | 25 +++++++++++
.../test/fixtures/my_lib/lib.hh | 25 +++++++++++
dynamic-use-of-static-c++/test/test_containers.cc | 26 +++++++++++
dynamic-use-of-static-c++/test/test_damien.cc | 26 +++++++++++
.../test/test_function_loader.cc | 25 +++++++++++
.../test/test_function_loader.rb | 16 +++++++
.../test/test_function_loader_cxx.rb | 16 +++++++
dynamic-use-of-static-c++/test/test_methods.cc | 25 +++++++++++
dynamic-use-of-static-c++/test/test_milena.cc | 25 +++++++++++
dynamic-use-of-static-c++/test/test_var_and_val.cc | 26 +++++++++++
.../test/vaucanson/test-loader.cc | 25 +++++++++++
41 files changed, 937 insertions(+), 0 deletions(-)
diff --git a/dynamic-use-of-static-c++/ChangeLog b/dynamic-use-of-static-c++/ChangeLog
index 9de4a05..a510774 100644
--- a/dynamic-use-of-static-c++/ChangeLog
+++ b/dynamic-use-of-static-c++/ChangeLog
@@ -1,5 +1,51 @@
2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+ Add missing copyright headers.
+
+ * bin/dyn-config.in,
+ * bin/mk_swig_input,
+ * bin/swig_tree_to_yaml,
+ * bin/yaml_to_dyn_decls,
+ * bootstrap,
+ * config/erbx,
+ * config/mk_local_config_rb_in.rb,
+ * config/rbconfig_gen.rb,
+ * config/ruby.m4,
+ * src/all_methods.erb.cc,
+ * src/all_methods.erb.hh,
+ * src/config.hh.in,
+ * src/cxx_symbols.rb,
+ * src/data.cc,
+ * src/data.hh,
+ * src/data.hxx,
+ * src/dyn.hh,
+ * src/function.erb.cc,
+ * src/function.erb.hh,
+ * src/function_loader.cc,
+ * src/function_loader.hh,
+ * src/function_loader.rb,
+ * src/name_of.cc,
+ * src/name_of.hh,
+ * src/policy.cc,
+ * src/policy.hh,
+ * src/ruby_stream.cc,
+ * src/ruby_stream.hh,
+ * test/fixtures/my_lib/damien.hh,
+ * test/fixtures/my_lib/damien.hxx,
+ * test/fixtures/my_lib/lib.hh,
+ * test/test_containers.cc,
+ * test/test_damien.cc,
+ * test/test_function_loader.cc,
+ * test/test_function_loader.rb,
+ * test/test_function_loader_cxx.rb,
+ * test/test_methods.cc,
+ * test/test_milena.cc,
+ * test/test_var_and_val.cc,
+ * test/vaucanson/test-loader.cc:
+ Here.
+
+2009-11-03 Roland Levillain <roland(a)lrde.epita.fr>
+
Adjust the initialization of the SWIG Python Milena wrappers.
* swig/mln.i: Call dyn::mln::initialize in %init section.
diff --git a/dynamic-use-of-static-c++/bin/dyn-config.in b/dynamic-use-of-static-c++/bin/dyn-config.in
index 0271082..6ff4d94 100755
--- a/dynamic-use-of-static-c++/bin/dyn-config.in
+++ b/dynamic-use-of-static-c++/bin/dyn-config.in
@@ -1,4 +1,21 @@
#!/usr/bin/env ruby
+
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'optparse'
require 'pathname'
diff --git a/dynamic-use-of-static-c++/bin/mk_swig_input b/dynamic-use-of-static-c++/bin/mk_swig_input
index 5efcc49..022cb26 100755
--- a/dynamic-use-of-static-c++/bin/mk_swig_input
+++ b/dynamic-use-of-static-c++/bin/mk_swig_input
@@ -1,4 +1,21 @@
#!/usr/bin/env ruby
+
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
load Pathname.new(__FILE__).dirname.parent + 'configure'
includes = []
diff --git a/dynamic-use-of-static-c++/bin/swig_tree_to_yaml b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
index eb63157..696d96c 100755
--- a/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
+++ b/dynamic-use-of-static-c++/bin/swig_tree_to_yaml
@@ -1,4 +1,21 @@
#!/usr/bin/env ruby
+
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
str = STDIN.read
str.gsub!(/^(\s*) \+\+\+ (\w+) -+$/, '\1- \2:')
str.gsub!(/^(\s*)\+\+\+ (\w+) -+$/, '\1\2:')
diff --git a/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
index 85ad16a..e7a6fc9 100755
--- a/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
+++ b/dynamic-use-of-static-c++/bin/yaml_to_dyn_decls
@@ -1,4 +1,21 @@
#!/usr/bin/env ruby
+
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'yaml'
require 'rubygems'
require_gem 'ruby_ex'
diff --git a/dynamic-use-of-static-c++/bootstrap b/dynamic-use-of-static-c++/bootstrap
index e4a288a..5f624d0 100755
--- a/dynamic-use-of-static-c++/bootstrap
+++ b/dynamic-use-of-static-c++/bootstrap
@@ -1,5 +1,21 @@
#! /bin/sh
+# Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
# Failures do matter.
set -e
# Tell what's going on.
diff --git a/dynamic-use-of-static-c++/config/erbx b/dynamic-use-of-static-c++/config/erbx
index bd49f97..383a883 100755
--- a/dynamic-use-of-static-c++/config/erbx
+++ b/dynamic-use-of-static-c++/config/erbx
@@ -1,5 +1,21 @@
#!/usr/bin/env ruby
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
# For this project only
DYN_MAX_ARGUMENTS = 10
ALL_METHODS = { 'fake_method' => ['*'] }
diff --git a/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb b/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb
index 985b1c3..734cae4 100644
--- a/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb
+++ b/dynamic-use-of-static-c++/config/mk_local_config_rb_in.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
# STDERR.puts "MK: #{ARGV.inspect}"
def usage
diff --git a/dynamic-use-of-static-c++/config/rbconfig_gen.rb b/dynamic-use-of-static-c++/config/rbconfig_gen.rb
index 24fdf95..5cf310e 100644
--- a/dynamic-use-of-static-c++/config/rbconfig_gen.rb
+++ b/dynamic-use-of-static-c++/config/rbconfig_gen.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'rbconfig'
def gen_m4 ( config )
diff --git a/dynamic-use-of-static-c++/config/ruby.m4 b/dynamic-use-of-static-c++/config/ruby.m4
index ac5cddd..679ceb9 100644
--- a/dynamic-use-of-static-c++/config/ruby.m4
+++ b/dynamic-use-of-static-c++/config/ruby.m4
@@ -1,3 +1,18 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
AC_DEFUN([RUBY],
diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.cc b/dynamic-use-of-static-c++/src/all_methods.erb.cc
index ae973f3..347ffc6 100644
--- a/dynamic-use-of-static-c++/src/all_methods.erb.cc
+++ b/dynamic-use-of-static-c++/src/all_methods.erb.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_ALL_METHODS_CC
# define DYN_ALL_METHODS_CC
diff --git a/dynamic-use-of-static-c++/src/all_methods.erb.hh b/dynamic-use-of-static-c++/src/all_methods.erb.hh
index 8f67a80..948ccdd 100644
--- a/dynamic-use-of-static-c++/src/all_methods.erb.hh
+++ b/dynamic-use-of-static-c++/src/all_methods.erb.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_ALL_METHODS_HH
# define DYN_ALL_METHODS_HH
diff --git a/dynamic-use-of-static-c++/src/config.hh.in b/dynamic-use-of-static-c++/src/config.hh.in
index 1327cf4..0ce13fc 100644
--- a/dynamic-use-of-static-c++/src/config.hh.in
+++ b/dynamic-use-of-static-c++/src/config.hh.in
@@ -1,3 +1,30 @@
+ // -*- C++ -*-
+
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#define DYNDIR "@DYNDIR@"
#define DYN_DATADIR "@DYN_DATADIR@"
#define DYN_FIXTURES "@DYN_FIXTURES@"
diff --git a/dynamic-use-of-static-c++/src/cxx_symbols.rb b/dynamic-use-of-static-c++/src/cxx_symbols.rb
index cdf52bd..91ad4b0 100644
--- a/dynamic-use-of-static-c++/src/cxx_symbols.rb
+++ b/dynamic-use-of-static-c++/src/cxx_symbols.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
class SimpleSymbol
attr_reader :code
def initialize ( code )
diff --git a/dynamic-use-of-static-c++/src/data.cc b/dynamic-use-of-static-c++/src/data.cc
index 3af1dcd..127dc87 100644
--- a/dynamic-use-of-static-c++/src/data.cc
+++ b/dynamic-use-of-static-c++/src/data.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_DATA_CC
# define DYN_DATA_CC
diff --git a/dynamic-use-of-static-c++/src/data.hh b/dynamic-use-of-static-c++/src/data.hh
index 812c3cd..aa8c192 100644
--- a/dynamic-use-of-static-c++/src/data.hh
+++ b/dynamic-use-of-static-c++/src/data.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_DATA_HH
# define DYN_DATA_HH
diff --git a/dynamic-use-of-static-c++/src/data.hxx b/dynamic-use-of-static-c++/src/data.hxx
index 5b993a9..1ff7886 100644
--- a/dynamic-use-of-static-c++/src/data.hxx
+++ b/dynamic-use-of-static-c++/src/data.hxx
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_DATA_HXX
# define DYN_DATA_HXX
diff --git a/dynamic-use-of-static-c++/src/dyn.hh b/dynamic-use-of-static-c++/src/dyn.hh
index f816c28..d12a790 100644
--- a/dynamic-use-of-static-c++/src/dyn.hh
+++ b/dynamic-use-of-static-c++/src/dyn.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_HH
# define DYN_HH
diff --git a/dynamic-use-of-static-c++/src/function.erb.cc b/dynamic-use-of-static-c++/src/function.erb.cc
index 4624aed..b83fd7b 100644
--- a/dynamic-use-of-static-c++/src/function.erb.cc
+++ b/dynamic-use-of-static-c++/src/function.erb.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 FUNCTION_HXX
#define FUNCTION_HXX
diff --git a/dynamic-use-of-static-c++/src/function.erb.hh b/dynamic-use-of-static-c++/src/function.erb.hh
index 0bcda9a..b814938 100644
--- a/dynamic-use-of-static-c++/src/function.erb.hh
+++ b/dynamic-use-of-static-c++/src/function.erb.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 FUNCTION_HH
#define FUNCTION_HH
diff --git a/dynamic-use-of-static-c++/src/function_loader.cc b/dynamic-use-of-static-c++/src/function_loader.cc
index 62efcbc..0b300be 100644
--- a/dynamic-use-of-static-c++/src/function_loader.cc
+++ b/dynamic-use-of-static-c++/src/function_loader.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_FUNCTION_LOADER_CC
# define DYN_FUNCTION_LOADER_CC
diff --git a/dynamic-use-of-static-c++/src/function_loader.hh b/dynamic-use-of-static-c++/src/function_loader.hh
index 29b5197..27edb37 100644
--- a/dynamic-use-of-static-c++/src/function_loader.hh
+++ b/dynamic-use-of-static-c++/src/function_loader.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_FUNCTION_LOADER_HH
# define DYN_FUNCTION_LOADER_HH
diff --git a/dynamic-use-of-static-c++/src/function_loader.rb b/dynamic-use-of-static-c++/src/function_loader.rb
index 8ec56e6..1f6c91a 100644
--- a/dynamic-use-of-static-c++/src/function_loader.rb
+++ b/dynamic-use-of-static-c++/src/function_loader.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
DYN_DATADIR = Pathname.new(__FILE__).dirname.parent + '_build/data' # FIXME
diff --git a/dynamic-use-of-static-c++/src/name_of.cc b/dynamic-use-of-static-c++/src/name_of.cc
index 7b2b6da..bf2c24f 100644
--- a/dynamic-use-of-static-c++/src/name_of.cc
+++ b/dynamic-use-of-static-c++/src/name_of.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_NAME_OF_CC
# define DYN_NAME_OF_CC
diff --git a/dynamic-use-of-static-c++/src/name_of.hh b/dynamic-use-of-static-c++/src/name_of.hh
index 67e26a5..dca878b 100644
--- a/dynamic-use-of-static-c++/src/name_of.hh
+++ b/dynamic-use-of-static-c++/src/name_of.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 NAME_OF
# define NAME_OF
diff --git a/dynamic-use-of-static-c++/src/policy.cc b/dynamic-use-of-static-c++/src/policy.cc
index 54b1d72..7ea9bb7 100644
--- a/dynamic-use-of-static-c++/src/policy.cc
+++ b/dynamic-use-of-static-c++/src/policy.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_POLICY_CC
# define DYN_POLICY_CC
diff --git a/dynamic-use-of-static-c++/src/policy.hh b/dynamic-use-of-static-c++/src/policy.hh
index eae4201..ef6ce55 100644
--- a/dynamic-use-of-static-c++/src/policy.hh
+++ b/dynamic-use-of-static-c++/src/policy.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DYN_POLICY_HH
# define DYN_POLICY_HH
diff --git a/dynamic-use-of-static-c++/src/ruby_stream.cc b/dynamic-use-of-static-c++/src/ruby_stream.cc
index 2ae7ecb..04a9d16 100644
--- a/dynamic-use-of-static-c++/src/ruby_stream.cc
+++ b/dynamic-use-of-static-c++/src/ruby_stream.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 RUBY_STREAM_CC
# define RUBY_STREAM_CC
diff --git a/dynamic-use-of-static-c++/src/ruby_stream.hh b/dynamic-use-of-static-c++/src/ruby_stream.hh
index 4f861fe..12c9455 100644
--- a/dynamic-use-of-static-c++/src/ruby_stream.hh
+++ b/dynamic-use-of-static-c++/src/ruby_stream.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 RUBY_STREAM_HH
#define RUBY_STREAM_HH
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
index 369ebe9..63dc041 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DAMIEN_HH
#define DAMIEN_HH
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
index e7448e1..0202a44 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/damien.hxx
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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 DAMIEN_HXX
#define DAMIEN_HXX
diff --git a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
index c861ea5..a03fc22 100644
--- a/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
+++ b/dynamic-use-of-static-c++/test/fixtures/my_lib/lib.hh
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
// part of generic lib
#include <cmath>
diff --git a/dynamic-use-of-static-c++/test/test_containers.cc b/dynamic-use-of-static-c++/test/test_containers.cc
index 6a79e02..4c06461 100644
--- a/dynamic-use-of-static-c++/test/test_containers.cc
+++ b/dynamic-use-of-static-c++/test/test_containers.cc
@@ -1,8 +1,34 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include <algorithm>
#include "my_lib/lib.hh"
#include "dyn-all.hh"
+
using namespace dyn::language;
int main()
diff --git a/dynamic-use-of-static-c++/test/test_damien.cc b/dynamic-use-of-static-c++/test/test_damien.cc
index 1b55fd1..b705acb 100644
--- a/dynamic-use-of-static-c++/test/test_damien.cc
+++ b/dynamic-use-of-static-c++/test/test_damien.cc
@@ -1,6 +1,32 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include "my_lib/damien.hh"
#include "dyn-all.hh"
+
using namespace dyn::language;
namespace dyn
diff --git a/dynamic-use-of-static-c++/test/test_function_loader.cc b/dynamic-use-of-static-c++/test/test_function_loader.cc
index fc8984a..b15dc4b 100644
--- a/dynamic-use-of-static-c++/test/test_function_loader.cc
+++ b/dynamic-use-of-static-c++/test/test_function_loader.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include <sstream>
#include "my_lib/lib.hh"
diff --git a/dynamic-use-of-static-c++/test/test_function_loader.rb b/dynamic-use-of-static-c++/test/test_function_loader.rb
index ee2c4ed..cd55e84 100644
--- a/dynamic-use-of-static-c++/test/test_function_loader.rb
+++ b/dynamic-use-of-static-c++/test/test_function_loader.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
require 'yaml'
test = Pathname.new(__FILE__).dirname
diff --git a/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb b/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb
index ddbb118..d337df3 100644
--- a/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb
+++ b/dynamic-use-of-static-c++/test/test_function_loader_cxx.rb
@@ -1,3 +1,19 @@
+# Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE).
+#
+# This file is part of Olena.
+#
+# Olena is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, version 2 of the License.
+#
+# Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
require 'pathname'
require 'yaml'
test = Pathname.new(__FILE__).dirname
diff --git a/dynamic-use-of-static-c++/test/test_methods.cc b/dynamic-use-of-static-c++/test/test_methods.cc
index 1ea7f0b..477ae06 100644
--- a/dynamic-use-of-static-c++/test/test_methods.cc
+++ b/dynamic-use-of-static-c++/test/test_methods.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include "dyn-all.hh"
using namespace dyn::language;
#include <iostream>
diff --git a/dynamic-use-of-static-c++/test/test_milena.cc b/dynamic-use-of-static-c++/test/test_milena.cc
index 67d10cb..ca56416 100644
--- a/dynamic-use-of-static-c++/test/test_milena.cc
+++ b/dynamic-use-of-static-c++/test/test_milena.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include "dyn-all.hh"
using namespace dyn::language;
diff --git a/dynamic-use-of-static-c++/test/test_var_and_val.cc b/dynamic-use-of-static-c++/test/test_var_and_val.cc
index b5da732..c1e647b 100644
--- a/dynamic-use-of-static-c++/test/test_var_and_val.cc
+++ b/dynamic-use-of-static-c++/test/test_var_and_val.cc
@@ -1,6 +1,32 @@
+/* Copyright (C) 2005, 2009 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include "my_lib/lib.hh"
#include "dyn-all.hh"
+
using namespace dyn::language;
int main()
diff --git a/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc b/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc
index 64fac50..7144e82 100644
--- a/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc
+++ b/dynamic-use-of-static-c++/test/vaucanson/test-loader.cc
@@ -1,3 +1,28 @@
+/* Copyright (C) 2005 EPITA Research and Development Laboratory (LRDE)
+
+ This file is part of Olena.
+
+ Olena is free software: you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation, version 2 of the License.
+
+ Olena 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 Olena. If not, see <http://www.gnu.org/licenses/>.
+
+ As a special exception, you may use this file as part of a free
+ software project 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. */
+
#include "dyn.hh"
using namespace dyn::language;
--
1.6.5
1
0