3160: Rename histo::data as histo::array.

* mln/histo/data.hh: rename file as... * mln/histo/array.hh: ... this. * mln/accu/histo.hh, * mln/convert/to_image.hh, * mln/histo/all.hh, * mln/histo/compute.hh, * mln/histo/compute.spe.hh, * mln/level/sort_psites.hh: update use of histo::array. --- milena/ChangeLog | 14 ++++++++++ milena/mln/accu/histo.hh | 6 ++-- milena/mln/convert/to_image.hh | 10 +++--- milena/mln/histo/all.hh | 12 ++++---- milena/mln/histo/{data.hh => array.hh} | 45 +++++++++++++++---------------- milena/mln/histo/compute.hh | 24 ++++++++-------- milena/mln/histo/compute.spe.hh | 8 +++--- milena/mln/level/sort_psites.hh | 4 +- 8 files changed, 68 insertions(+), 55 deletions(-) rename milena/mln/histo/{data.hh => array.hh} (80%) diff --git a/milena/ChangeLog b/milena/ChangeLog index 5ebfb83..0166541 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -1,3 +1,17 @@ +2009-01-16 Guillaume Lazzara <z@lrde.epita.fr> + + Rename histo::data as histo::array. + + * mln/histo/data.hh: rename file as... + * mln/histo/array.hh: ... this. + + * mln/accu/histo.hh, + * mln/convert/to_image.hh, + * mln/histo/all.hh, + * mln/histo/compute.hh, + * mln/histo/compute.spe.hh, + * mln/level/sort_psites.hh: update use of histo::array. + 2009-01-14 Alexandre Abraham <abraham@lrde.epita.fr> Fix for two ways functions. diff --git a/milena/mln/accu/histo.hh b/milena/mln/accu/histo.hh index 2bf9bdf..b66ed52 100644 --- a/milena/mln/accu/histo.hh +++ b/milena/mln/accu/histo.hh @@ -33,7 +33,7 @@ /// /// Define a generic histogram accumulator class. /// -/// \todo Use histo::data instead of std::vector! +/// \todo Use histo::array instead of std::vector! # include <vector> # include <algorithm> @@ -42,7 +42,7 @@ # include <mln/core/concept/meta_accumulator.hh> # include <mln/accu/internal/base.hh> # include <mln/value/set.hh> -# include <mln/histo/data.hh> +# include <mln/histo/array.hh> namespace mln @@ -91,7 +91,7 @@ namespace mln protected: - mln::histo::data<V> h_; + mln::histo::array<V> h_; unsigned sum_; }; diff --git a/milena/mln/convert/to_image.hh b/milena/mln/convert/to_image.hh index 809bb14..e71aeda 100644 --- a/milena/mln/convert/to_image.hh +++ b/milena/mln/convert/to_image.hh @@ -1,5 +1,5 @@ -// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory -// (LRDE) +// Copyright (C) 2007, 2008, 2009 EPITA Research and Development +// Laboratory (LRDE) // // This file is part of the Olena Library. This library is free // software; you can redistribute it and/or modify it under the terms @@ -42,7 +42,7 @@ # include <mln/geom/bbox.hh> # include <mln/data/fill.hh> -# include <mln/histo/data.hh> +# include <mln/histo/array.hh> # include <mln/core/image/image1d.hh> # include <mln/core/image/image2d.hh> @@ -81,7 +81,7 @@ namespace mln /// Convert an histo \p h into an image1d<unsigned>. template <typename T> image1d<unsigned> - to_image(const histo::data<T>& h); + to_image(const histo::array<T>& h); @@ -138,7 +138,7 @@ namespace mln template <typename T> inline image1d<unsigned> - to_image(const histo::data<T>& h) + to_image(const histo::array<T>& h) { def::coord n = static_cast<def::coord>(h.vset().nvalues()), diff --git a/milena/mln/histo/all.hh b/milena/mln/histo/all.hh index 746df6b..225a9b5 100644 --- a/milena/mln/histo/all.hh +++ b/milena/mln/histo/all.hh @@ -1,4 +1,5 @@ -// Copyright (C) 2007 EPITA Research and Development Laboratory +// Copyright (C) 2007, 2009 EPITA Research and Development Laboratory +// (LRDE) // // 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 +29,9 @@ #ifndef MLN_HISTO_ALL_HH # define MLN_HISTO_ALL_HH -/*! \file mln/histo/all.hh - * - * \brief File that includes histogram files. - */ +/// \file mln/histo/all.hh +/// +/// File that includes histogram files. namespace mln @@ -53,6 +53,6 @@ namespace mln } # include <mln/histo/compute.hh> -# include <mln/histo/data.hh> +# include <mln/histo/array.hh> #endif // ! MLN_HISTO_ALL_HH diff --git a/milena/mln/histo/data.hh b/milena/mln/histo/array.hh similarity index 80% rename from milena/mln/histo/data.hh rename to milena/mln/histo/array.hh index 000c727..ad58e1a 100644 --- a/milena/mln/histo/data.hh +++ b/milena/mln/histo/array.hh @@ -1,4 +1,5 @@ -// 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 // software; you can redistribute it and/or modify it under the terms @@ -25,13 +26,12 @@ // reasons why the executable file might be covered by the GNU General // Public License. -#ifndef MLN_HISTO_DATA_HH -# define MLN_HISTO_DATA_HH +#ifndef MLN_HISTO_ARRAY_HH +# define MLN_HISTO_ARRAY_HH -/*! \file mln/histo/data.hh - * - * \brief Define a generic histogram class. - */ +/// \file mln/histo/array.hh +/// +/// Define a generic histogram class. # include <vector> # include <algorithm> @@ -46,14 +46,13 @@ namespace mln { - /*! Generic histogram class over a value set with type \c T. - */ + /// Generic histogram class over a value set with type \c T. template <typename T> - struct data + struct array { typedef T value; - data(); + array(); void clear(); @@ -75,7 +74,7 @@ namespace mln template <typename T> - std::ostream& operator<<(std::ostream& ostr, const data<T>& h); + std::ostream& operator<<(std::ostream& ostr, const array<T>& h); @@ -83,7 +82,7 @@ namespace mln template <typename T> inline - data<T>::data() + array<T>::array() : s_(mln::value::set<T>::the()), h_(s_.nvalues(), 0) { @@ -93,7 +92,7 @@ namespace mln template <typename T> inline void - data<T>::clear() + array<T>::clear() { std::fill(h_.begin(), h_.end(), 0); } @@ -101,7 +100,7 @@ namespace mln template <typename T> inline unsigned - data<T>::operator()(const T& v) const + array<T>::operator()(const T& v) const { return h_[s_.index_of(v)]; } @@ -109,7 +108,7 @@ namespace mln template <typename T> inline unsigned& - data<T>::operator()(const T& v) + array<T>::operator()(const T& v) { return h_[s_.index_of(v)]; } @@ -117,7 +116,7 @@ namespace mln template <typename T> inline const mln::value::set<T>& - data<T>::vset() const + array<T>::vset() const { return s_; } @@ -125,7 +124,7 @@ namespace mln template <typename T> inline unsigned - data<T>::operator[](unsigned i) const + array<T>::operator[](unsigned i) const { mln_precondition(i < s_.nvalues()); return h_[i]; @@ -134,7 +133,7 @@ namespace mln template <typename T> inline unsigned& - data<T>::operator[](unsigned i) + array<T>::operator[](unsigned i) { mln_precondition(i < s_.nvalues()); return h_[i]; @@ -143,21 +142,21 @@ namespace mln template <typename T> inline const std::vector<unsigned>& - data<T>::vect() const + array<T>::vect() const { return h_; } template <typename T> inline - unsigned data<T>::nvalues() const + unsigned array<T>::nvalues() const { return h_.size(); } template <typename T> inline - std::ostream& operator<<(std::ostream& ostr, const data<T>& h) + std::ostream& operator<<(std::ostream& ostr, const array<T>& h) { mln_viter(mln::value::set<T>) v(h.vset()); for_all(v) @@ -173,4 +172,4 @@ namespace mln } // end of namespace mln -#endif // ! MLN_HISTO_DATA_HH +#endif // ! MLN_HISTO_ARRAY_HH diff --git a/milena/mln/histo/compute.hh b/milena/mln/histo/compute.hh index 14bf3a3..99379c9 100644 --- a/milena/mln/histo/compute.hh +++ b/milena/mln/histo/compute.hh @@ -1,4 +1,5 @@ -// 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 // software; you can redistribute it and/or modify it under the terms @@ -28,13 +29,12 @@ #ifndef MLN_HISTO_COMPUTE_HH # define MLN_HISTO_COMPUTE_HH -/*! \file mln/histo/compute.hh - * - * \brief Routine to compute an histogram. - */ +/// \file mln/histo/compute.hh +/// +/// Routine to compute an histogram. # include <mln/core/concept/image.hh> -# include <mln/histo/data.hh> +# include <mln/histo/array.hh> // Specializations are in: @@ -49,7 +49,7 @@ namespace mln /// Compute the histogram of image \p input. template <typename I> - data<mln_value(I)> compute(const Image<I>& input); + array<mln_value(I)> compute(const Image<I>& input); # ifndef MLN_INCLUDE_ONLY @@ -62,9 +62,9 @@ namespace mln template <typename I> inline - data<mln_value(I)> compute_(const I& input) + array<mln_value(I)> compute_(const I& input) { - data<mln_value(I)> h; + array<mln_value(I)> h; mln_piter(I) p(input.domain()); for_all(p) ++h(input(p)); @@ -78,14 +78,14 @@ namespace mln template <typename I> inline - data<mln_value(I)> compute(const Image<I>& input) + array<mln_value(I)> compute(const Image<I>& input) { trace::entering("histo::compute"); mlc_equal(mln_trait_image_quant(I), mln::trait::image::quant::low)::check(); mln_precondition(exact(input).is_valid()); - data<mln_value(I)> h = impl::compute_(mln_trait_image_speed(I)(), - exact(input)); + array<mln_value(I)> h = impl::compute_(mln_trait_image_speed(I)(), + exact(input)); trace::exiting("histo::compute"); return h; diff --git a/milena/mln/histo/compute.spe.hh b/milena/mln/histo/compute.spe.hh index 616804d..9b149b9 100644 --- a/milena/mln/histo/compute.spe.hh +++ b/milena/mln/histo/compute.spe.hh @@ -52,12 +52,12 @@ namespace mln namespace generic { template <typename I> - data<mln_value(I)> compute_(const I& input); + array<mln_value(I)> compute_(const I& input); } template <typename I> inline - data<mln_value(I)> + array<mln_value(I)> compute_(trait::image::speed::any, const I& input) { return generic::compute_(input); @@ -65,10 +65,10 @@ namespace mln template <typename I> inline - data<mln_value(I)> + array<mln_value(I)> compute_(trait::image::speed::fastest, const I& input) { - data<mln_value(I)> h; + array<mln_value(I)> h; mln_pixter(const I) p(input); for_all(p) ++h(p.val()); diff --git a/milena/mln/level/sort_psites.hh b/milena/mln/level/sort_psites.hh index ef920cd..a7bc8ba 100644 --- a/milena/mln/level/sort_psites.hh +++ b/milena/mln/level/sort_psites.hh @@ -147,7 +147,7 @@ namespace mln const unsigned n = vset.nvalues(); // h - histo::data<mln_value(I)> h = histo::compute(input); + histo::array<mln_value(I)> h = histo::compute(input); // preparing output data std::vector<unsigned> loc(vset.nvalues()); @@ -191,7 +191,7 @@ namespace mln const unsigned n = vset.nvalues(); // h - histo::data<mln_value(I)> h = histo::compute(input); + histo::array<mln_value(I)> h = histo::compute(input); // preparing output data std::vector<unsigned> loc(vset.nvalues()); -- 1.5.6.5
participants (1)
-
Guillaume Lazzara