3455: Add missing traces in basic routines in geom/* (ticket #49).

* mln/geom/bbox.hh, * mln/geom/max_col.hh, * mln/geom/max_ind.hh, * mln/geom/max_row.hh, * mln/geom/max_sli.hh, * mln/geom/min_col.hh, * mln/geom/min_ind.hh, * mln/geom/min_row.hh, * mln/geom/min_sli.hh, * mln/geom/ncols.hh, * mln/geom/ninds.hh, * mln/geom/nrows.hh, * mln/geom/nslis.hh: add missing traces. --- milena/ChangeLog | 18 ++++++++++++++++++ milena/mln/geom/bbox.hh | 18 ++++++++++++++++-- milena/mln/geom/max_col.hh | 16 +++++++++++++--- milena/mln/geom/max_ind.hh | 9 +++++++-- milena/mln/geom/max_row.hh | 16 +++++++++++++--- milena/mln/geom/max_sli.hh | 9 +++++++-- milena/mln/geom/min_col.hh | 16 +++++++++++++--- milena/mln/geom/min_ind.hh | 9 +++++++-- milena/mln/geom/min_row.hh | 16 +++++++++++++--- milena/mln/geom/min_sli.hh | 9 +++++++-- milena/mln/geom/ncols.hh | 23 ++++++++++++++++------- milena/mln/geom/ninds.hh | 9 +++++++-- milena/mln/geom/nrows.hh | 23 ++++++++++++++++------- milena/mln/geom/nslis.hh | 16 ++++++++++------ 14 files changed, 163 insertions(+), 44 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 438bfe2..9de7f13 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,5 +1,23 @@ 2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr> + Add missing traces in basic routines in geom/* (ticket #49). + + * mln/geom/bbox.hh, + * mln/geom/max_col.hh, + * mln/geom/max_ind.hh, + * mln/geom/max_row.hh, + * mln/geom/max_sli.hh, + * mln/geom/min_col.hh, + * mln/geom/min_ind.hh, + * mln/geom/min_row.hh, + * mln/geom/min_sli.hh, + * mln/geom/ncols.hh, + * mln/geom/ninds.hh, + * mln/geom/nrows.hh, + * mln/geom/nslis.hh: add missing traces. + +2009-03-02 Guillaume Lazzara <lazzara@lrde.epita.fr> + Cleanup scribo sandbox. * sandbox/scribo/Makefile: add new rules. diff --git a/milena/mln/geom/bbox.hh b/milena/mln/geom/bbox.hh index 9a7d5bc..32d8377 100644 --- a/milena/mln/geom/bbox.hh +++ b/milena/mln/geom/bbox.hh @@ -135,27 +135,41 @@ namespace mln template <typename I> box<mln_site(I)> bbox(const Image<I>& ima_) { + trace::entering("geom::bbox"); + const I& ima = exact(ima_); mln_precondition(ima.is_valid()); - return geom::bbox(ima.domain()); + box<mln_site(I)> b = geom::bbox(ima.domain()); + + trace::exiting("geom::bbox"); + return b; } template <typename W> box<mln_psite(W)> bbox(const Window<W>& win) { + trace::entering("geom::bbox"); + typedef mln_psite(W) P; accu::bbox<P> b; P O = literal::origin; mln_qiter(W) q(exact(win), O); for_all(q) b.take(q); + + trace::exiting("geom::bbox"); return b; } template <typename W> box<mln_psite(W)> bbox(const Weighted_Window<W>& win) { - return bbox(exact(win).win()); + trace::entering("geom::bbox"); + + box<mln_psite(W)> b = bbox(exact(win).win()); + + trace::exiting("geom::bbox"); + return b; } diff --git a/milena/mln/geom/max_col.hh b/milena/mln/geom/max_col.hh index 6152e5d..561810e 100644 --- a/milena/mln/geom/max_col.hh +++ b/milena/mln/geom/max_col.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -57,8 +57,13 @@ namespace mln inline mln_deduce(I, site, coord) max_col(const Image<I>& ima) { + trace::entering("mln::geom::max_col"); + mln_precondition(exact(ima).is_valid()); - return geom::bbox(ima).pmax().col(); + mln_deduce(I, site, coord) maxcol = geom::bbox(ima).pmax().col(); + + trace::exiting("mln::geom::max_col"); + return maxcol; } @@ -66,8 +71,13 @@ namespace mln inline mln_deduce(B, point, coord) max_col(const Box<B>& b) { + trace::entering("mln::geom::max_col"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return exact(b).pmax().col(); + mln_deduce(B, point, coord) maxcol = exact(b).pmax().col(); + + trace::exiting("mln::geom::max_col"); + return maxcol; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/max_ind.hh b/milena/mln/geom/max_ind.hh index 6d5baf0..15bcc86 100644 --- a/milena/mln/geom/max_ind.hh +++ b/milena/mln/geom/max_ind.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -53,8 +53,13 @@ namespace mln inline mln_deduce(I, site, coord) max_ind(const Image<I>& ima) { + trace::entering("mln::geom::max_ind"); + mln_precondition(exact(ima).is_valid()); - return exact(ima).bbox().pmax().ind(); + mln_deduce(I, site, coord) maxind = exact(ima).bbox().pmax().ind(); + + trace::exiting("mln::geom::max_ind"); + return maxind; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/max_row.hh b/milena/mln/geom/max_row.hh index cf33984..db49bb9 100644 --- a/milena/mln/geom/max_row.hh +++ b/milena/mln/geom/max_row.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -58,8 +58,13 @@ namespace mln inline mln_deduce(I, site, coord) max_row(const Image<I>& ima) { + trace::entering("mln::geom::max_row"); + mln_precondition(exact(ima).is_valid()); - return geom::bbox(ima).pmax().row(); + mln_deduce(I, site, coord) maxrow = geom::bbox(ima).pmax().row(); + + trace::exiting("mln::geom::max_row"); + return maxrow; } @@ -67,8 +72,13 @@ namespace mln inline mln_deduce(B, point, coord) max_row(const Box<B>& b) { + trace::entering("mln::geom::max_row"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return exact(b).pmax().row(); + mln_deduce(B, point, coord) maxrow = exact(b).pmax().row(); + + trace::exiting("mln::geom::max_row"); + return maxrow; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/max_sli.hh b/milena/mln/geom/max_sli.hh index 07920d6..18f9aad 100644 --- a/milena/mln/geom/max_sli.hh +++ b/milena/mln/geom/max_sli.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -53,8 +53,13 @@ namespace mln inline mln_deduce(I, site, coord) max_sli(const Image<I>& ima) { + trace::entering("mln::geom::max_sli"); + mln_precondition(exact(ima).is_valid()); - return exact(ima).bbox().pmax().sli(); + mln_deduce(I, site, coord) maxsli = exact(ima).bbox().pmax().sli(); + + trace::exiting("mln::geom::max_sli"); + return maxsli; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/min_col.hh b/milena/mln/geom/min_col.hh index cf66a3d..631d989 100644 --- a/milena/mln/geom/min_col.hh +++ b/milena/mln/geom/min_col.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -58,8 +58,13 @@ namespace mln inline mln_deduce(I, site, coord) min_col(const Image<I>& ima) { + trace::entering("mln::geom::min_col"); + mln_precondition(exact(ima).is_valid()); - return geom::bbox(ima).pmin().col(); + mln_deduce(I, site, coord) mincol = geom::bbox(ima).pmin().col(); + + trace::exiting("mln::geom::min_col"); + return mincol; } @@ -67,8 +72,13 @@ namespace mln inline mln_deduce(B, point, coord) min_col(const Box<B>& b) { + trace::entering("mln::geom::min_col"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return exact(b).pmin().col(); + mln_deduce(B, point, coord) mincol = exact(b).pmin().col(); + + trace::exiting("mln::geom::min_col"); + return mincol; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/min_ind.hh b/milena/mln/geom/min_ind.hh index 892b2fc..65e5721 100644 --- a/milena/mln/geom/min_ind.hh +++ b/milena/mln/geom/min_ind.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -53,8 +53,13 @@ namespace mln inline mln_deduce(I, site, coord) min_ind(const Image<I>& ima) { + trace::entering("mln::geom::min_ind"); + mln_precondition(exact(ima).is_valid()); - return exact(ima).bbox().pmin().ind(); + mln_deduce(I, site, coord) minind = exact(ima).bbox().pmin().ind(); + + trace::exiting("mln::geom::min_ind"); + return minind; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/min_row.hh b/milena/mln/geom/min_row.hh index 0d991ca..05ee4cb 100644 --- a/milena/mln/geom/min_row.hh +++ b/milena/mln/geom/min_row.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -61,8 +61,13 @@ namespace mln inline mln_deduce(I, site, coord) min_row(const Image<I>& ima) { + trace::entering("mln::geom::min_row"); + mln_precondition(exact(ima).is_valid()); - return geom::bbox(ima).pmin().row(); + mln_deduce(I, site, coord) minrow = geom::bbox(ima).pmin().row(); + + trace::exiting("mln::geom::min_row"); + return minrow; } @@ -70,8 +75,13 @@ namespace mln inline mln_deduce(B, point, coord) min_row(const Box<B>& b) { + trace::entering("mln::geom::min_row"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return exact(b).pmin().row(); + mln_deduce(B, point, coord) minrow = exact(b).pmin().row(); + + trace::exiting("mln::geom::min_row"); + return minrow; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/min_sli.hh b/milena/mln/geom/min_sli.hh index 9d186fe..182fe15 100644 --- a/milena/mln/geom/min_sli.hh +++ b/milena/mln/geom/min_sli.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -53,8 +53,13 @@ namespace mln inline mln_deduce(I, site, coord) min_sli(const Image<I>& ima) { + trace::entering("mln::geom::min_sli"); + mln_precondition(exact(ima).is_valid()); - return exact(ima).bbox().pmin().sli(); + mln_deduce(I, site, coord) minsli = exact(ima).bbox().pmin().sli(); + + trace::exiting("mln::geom::min_sli"); + return minsli; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/ncols.hh b/milena/mln/geom/ncols.hh index 76c2d5a..6aa3742 100644 --- a/milena/mln/geom/ncols.hh +++ b/milena/mln/geom/ncols.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,10 +28,9 @@ #ifndef MLN_GEOM_NCOLS_HH # define MLN_GEOM_NCOLS_HH -/*! \file mln/geom/ncols.hh - * - * \brief Give the number of columns of an image. - */ +/// \file mln/geom/ncols.hh +/// +/// Give the number of columns of an image. # include <mln/geom/min_col.hh> # include <mln/geom/max_col.hh> @@ -58,16 +57,26 @@ namespace mln inline unsigned ncols(const Image<I>& ima) { + trace::entering("mln::geom::ncols"); + mln_precondition(exact(ima).is_valid()); - return geom::max_col(ima) - geom::min_col(ima) + 1; + unsigned ncols = geom::max_col(ima) - geom::min_col(ima) + 1; + + trace::exiting("mln::geom::ncols"); + return ncols; } template <typename B> unsigned ncols(const Box<B>& b) { + trace::entering("mln::geom::ncols"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return geom::max_col(b) - geom::min_col(b) + 1; + unsigned ncols = geom::max_col(b) - geom::min_col(b) + 1; + + trace::exiting("mln::geom::ncols"); + return ncols; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/ninds.hh b/milena/mln/geom/ninds.hh index a331748..47026ed 100644 --- a/milena/mln/geom/ninds.hh +++ b/milena/mln/geom/ninds.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development Laboratory // (LRDE) // // This file is part of the Olena Library. This library is free @@ -54,8 +54,13 @@ namespace mln inline unsigned ninds(const Image<I>& ima) { + trace::entering("mln::geom::ninds"); + mln_precondition(exact(ima).is_valid()); - return geom::max_ind(ima) - geom::min_ind(ima) + 1; + unsigned ninds = geom::max_ind(ima) - geom::min_ind(ima) + 1; + + trace::exiting("mln::geom::ninds"); + return ninds; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/nrows.hh b/milena/mln/geom/nrows.hh index c7f3e9a..01e9969 100644 --- a/milena/mln/geom/nrows.hh +++ b/milena/mln/geom/nrows.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,10 +28,9 @@ #ifndef MLN_GEOM_NROWS_HH # define MLN_GEOM_NROWS_HH -/*! \file mln/geom/nrows.hh - * - * \brief Give the number of rows of an image. - */ +/// \file mln/geom/nrows.hh +/// +/// Give the number of rows of an image. # include <mln/geom/min_row.hh> # include <mln/geom/max_row.hh> @@ -58,15 +57,25 @@ namespace mln inline unsigned nrows(const Image<I>& ima) { + trace::entering("mln::geom::nrows"); + mln_precondition(exact(ima).is_valid()); - return geom::max_row(ima) - geom::min_row(ima) + 1; + unsigned nrows = geom::max_row(ima) - geom::min_row(ima) + 1; + + trace::exiting("mln::geom::nrows"); + return nrows; } template <typename B> unsigned nrows(const Box<B>& b) { + trace::entering("mln::geom::nrows"); + metal::not_<metal::equal<metal::int_<B::dim>, metal::int_<1> > >::check(); - return geom::max_row(b) - geom::min_row(b) + 1; + unsigned nrows = geom::max_row(b) - geom::min_row(b) + 1; + + trace::exiting("mln::geom::nrows"); + return nrows; } # endif // ! MLN_INCLUDE_ONLY diff --git a/milena/mln/geom/nslis.hh b/milena/mln/geom/nslis.hh index 3e6aa77..5ce4e6b 100644 --- a/milena/mln/geom/nslis.hh +++ b/milena/mln/geom/nslis.hh @@ -1,4 +1,4 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -28,10 +28,9 @@ #ifndef MLN_GEOM_NSLIS_HH # define MLN_GEOM_NSLIS_HH -/*! \file mln/geom/nslis.hh - * - * \brief Give the number of slices of an image. - */ +/// \file mln/geom/nslis.hh +/// +/// Give the number of slices of an image. # include <mln/geom/min_sli.hh> # include <mln/geom/max_sli.hh> @@ -54,8 +53,13 @@ namespace mln inline unsigned nslis(const Image<I>& ima) { + trace::entering("mln::geom::nslis"); + mln_precondition(exact(ima).is_valid()); - return geom::max_sli(ima) - geom::min_sli(ima) + 1; + unsigned nslis = geom::max_sli(ima) - geom::min_sli(ima) + 1; + + trace::exiting("mln::geom::nslis"); + return nslis; } # endif // ! MLN_INCLUDE_ONLY -- 1.5.6.5
participants (1)
-
Guillaume Lazzara