Commit 3cdadcb3 authored by Guillaume Lazzara's avatar Guillaume Lazzara
Browse files

Various small fixes.

	* mln/accu/all.hh,
	* mln/accu/bbox.hh,
	* mln/accu/compute.hh,
	* mln/accu/convolve.hh,
	* mln/accu/count.hh,
	* mln/accu/count_adjacent_vertices.hh,
	* mln/accu/essential.hh,
	* mln/accu/height.hh,
	* mln/accu/histo.hh,
	* mln/accu/internal/base.hh,
	* mln/accu/land.hh,
	* mln/accu/line.hh,
	* mln/accu/maj_h.hh,
	* mln/accu/max.hh,
	* mln/accu/max_h.hh,
	* mln/accu/mean.hh,
	* mln/accu/median_alt.hh,
	* mln/accu/median_h.hh,
	* mln/accu/min.hh,
	* mln/accu/min_h.hh,
	* mln/accu/min_max.hh,
	* mln/accu/nil.hh,
	* mln/accu/p.hh,
	* mln/accu/pair.hh,
	* mln/accu/rank.hh,
	* mln/accu/rank_bool.hh,
	* mln/accu/rank_high_quant.hh,
	* mln/accu/snake_2d.hh,
	* mln/accu/sum.hh,
	* mln/accu/take.hh,
	* mln/accu/transform.hh,
	* mln/accu/tuple.hh,
	* mln/accu/v.hh,
	* mln/accu/volume.hh: Update comments and add missing unmeta.

	* mln/morpho/elementary/like_ero_fun.hh,
	* mln/algebra/quat.hh: Fix warnings.

	* mln/geom/essential.hh,
	* mln/value/essential.hh: Fix includes.

	* tests/accu/rank.cc: Use a new constructor for accu::meta::rank.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008@2861 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 254e1571
2008-11-12 Guillaume Lazzara <z@lrde.epita.fr>
Various small fixes.
* mln/accu/all.hh,
* mln/accu/bbox.hh,
* mln/accu/compute.hh,
* mln/accu/convolve.hh,
* mln/accu/count.hh,
* mln/accu/count_adjacent_vertices.hh,
* mln/accu/essential.hh,
* mln/accu/height.hh,
* mln/accu/histo.hh,
* mln/accu/internal/base.hh,
* mln/accu/land.hh,
* mln/accu/line.hh,
* mln/accu/maj_h.hh,
* mln/accu/max.hh,
* mln/accu/max_h.hh,
* mln/accu/mean.hh,
* mln/accu/median_alt.hh,
* mln/accu/median_h.hh,
* mln/accu/min.hh,
* mln/accu/min_h.hh,
* mln/accu/min_max.hh,
* mln/accu/nil.hh,
* mln/accu/p.hh,
* mln/accu/pair.hh,
* mln/accu/rank.hh,
* mln/accu/rank_bool.hh,
* mln/accu/rank_high_quant.hh,
* mln/accu/snake_2d.hh,
* mln/accu/sum.hh,
* mln/accu/take.hh,
* mln/accu/transform.hh,
* mln/accu/tuple.hh,
* mln/accu/v.hh,
* mln/accu/volume.hh: Update comments and add missing unmeta.
* mln/morpho/elementary/like_ero_fun.hh,
* mln/algebra/quat.hh: Fix warnings.
* mln/geom/essential.hh,
* mln/value/essential.hh: Fix includes.
* tests/accu/rank.cc: Use a new constructor for accu::meta::rank.
2008-11-12 Guillaume Lazzara <z@lrde.epita.fr>
 
Update tutorial.
......
......@@ -29,16 +29,15 @@
#ifndef MLN_ACCU_ALL_HH
# define MLN_ACCU_ALL_HH
/*! \file mln/accu/all.hh
*
* \brief File that includes all accumulator types.
*
* \todo Update accumulators s.a. count so that they are like min_/min.
*
* \todo Propagate those updates to mln/estim/.
*
* \todo Update the include list...
*/
/// \file mln/accu/all.hh
///
/// File that includes all accumulator types.
///
/// \todo Update accumulators s.a. count so that they are like min_/min.
///
/// \todo Propagate those updates to mln/estim/.
///
/// \todo Update the include list...
namespace mln
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,9 @@
#ifndef MLN_ACCU_BBOX_HH
# define MLN_ACCU_BBOX_HH
/*! \file mln/accu/bbox.hh
*
* \brief Define an accumulator that computes a bbox.
*/
/// \file mln/accu/bbox.hh
///
/// Define an accumulator that computes a bbox.
# include <mln/core/site_set/box.hh>
# include <mln/core/concept/meta_accumulator.hh>
......@@ -45,8 +44,8 @@ namespace mln
{
/*! \brief Generic bbox accumulator class.
*
/// Generic bbox accumulator class.
/*!
* The parameter \c P is the type of points.
*/
template <typename P>
......
......@@ -47,8 +47,8 @@ namespace mln
namespace accu
{
/*! \brief Make an accumulator compute the pixels of the image \p input.
*
/// Make an accumulator compute the pixels of the image \p input.
/*!
* \param[in] input The input image.
*
* This routine runs: \n
......@@ -62,8 +62,8 @@ namespace mln
compute(const Accumulator<A>& a, const Image<I>& input);
/*! \brief Make an accumulator compute the pixels of the image \p input.
*
/// Make an accumulator compute the pixels of the image \p input.
/*!
* \param[in] input The input image.
*
* This routine runs: \n
......
......@@ -28,10 +28,9 @@
#ifndef MLN_ACCU_CONVOLVE_HH
# define MLN_ACCU_CONVOLVE_HH
/*! \file mln/accu/convolve.hh
*
* \brief Define an accumulator that computes a convolution.
*/
/// \file mln/accu/convolve.hh
///
/// Define an accumulator that computes a convolution.
# include <mln/accu/internal/base.hh>
# include <mln/value/ops.hh>
......@@ -45,11 +44,11 @@ namespace mln
{
/*! \brief Generic convolution accumulator class.
*
* Parameters \c T1 and \c T2 are the type of values to be
* convolved. Parameter \c R is the result type.
*/
/// Generic convolution accumulator class.
///
/// Parameters \c T1 and \c T2 are the type of values to be
/// convolved. Parameter \c R is the result type.
///
template <typename T1, typename T2,
typename R = mln_sum_x(T1, T2)>
struct convolve : public mln::accu::internal::base< R, convolve<T1,T2,R> >,
......
......@@ -31,7 +31,7 @@
/// \file mln/accu/count.hh
///
/// \brief Define an accumulator that counts.
/// Define an accumulator that counts.
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
......@@ -43,7 +43,7 @@ namespace mln
namespace accu
{
/// \brief Generic counter accumulator class.
/// Generic counter accumulator class.
/// The parameter \a T is the type to be count.
template <typename T>
struct count : public mln::accu::internal::base< unsigned , count<T> >
......@@ -81,7 +81,7 @@ namespace mln
namespace meta
{
/// \brief Meta accumulator for count.
/// Meta accumulator for count.
struct count : public Meta_Accumulator< count >
{
template <typename T>
......
......@@ -30,7 +30,7 @@
# define MLN_ACCU_COUNT_ADJACENT_VERTICES_HH
/// \file mln/accu/count_adjacent_vertices.hh
/// \brief Define an accumulator that counts the vertices adjacent to a
/// Define an accumulator that counts the vertices adjacent to a
/// set of line graph psite.
# include <mln/accu/internal/base.hh>
......@@ -44,7 +44,7 @@ namespace mln
namespace accu
{
/// \brief Accumulator class counting the number of vertices
/// Accumulator class counting the number of vertices
/// adjacent to a set of mln::line_graph_psite (i.e., a set of
/// edges).
///
......@@ -90,7 +90,7 @@ namespace mln
namespace meta
{
/// \brief Meta accumulator for count_adjacent_vertices.
/// Meta accumulator for count_adjacent_vertices.
struct count_adjacent_vertices
: public Meta_Accumulator< count_adjacent_vertices >
{
......
// Copyright (C) 2008 EPITA Research and Development Laboratory
// Copyright (C) 2008 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,11 +28,9 @@
#ifndef MLN_ACCU_ESSENTIAL_HH_
# define MLN_ACCU_ESSENTIAL_HH_
/*! \file mln/accu/essential.hh
*
* \brief File that includes the most useful accumulator types.
*
*/
/// \file mln/accu/essential.hh
///
/// File that includes the most useful accumulator types.
# include <mln/accu/bbox.hh>
# include <mln/accu/count.hh>
......
......@@ -29,17 +29,18 @@
#ifndef MLN_ACCU_HEIGHT_HH
# define MLN_ACCU_HEIGHT_HH
/** \file mln/accu/height.hh
\brief Define an accumulator that computes the height of a
component through one of its pixels.
/// \file mln/accu/height.hh
/// Define an accumulator that computes the height of a
/// component through one of its pixels.
/*
This accumulator uses an mln::util::pix (pixel) to update the
height information of the component.
The class mln/accu/height is not a general-purpose accumulator;
it is used to implement height-based connected filters.
\see mln::morpho::closing_height
\see mln::morpho::opening_height */
\see mln::morpho::opening_height
*/
# include <mln/accu/internal/base.hh>
# include <mln/core/concept/meta_accumulator.hh>
......@@ -54,7 +55,7 @@ namespace mln
namespace accu
{
/// \brief Height accumulator class.
/// Height accumulator class.
///
/// The parameter \p I is the image type on which the accumulator
/// of pixels is built.
......@@ -62,7 +63,7 @@ namespace mln
struct height
: public mln::accu::internal::base< unsigned , height<I> >
{
/// \brief The accumulated data type.
/// The accumulated data type.
///
/// The height of component is represented by the height of its
/// root pixel. See mln::morpho::closing_height and
......@@ -104,7 +105,7 @@ namespace mln
namespace meta
{
/// \brief Meta accumulator for height.
/// Meta accumulator for height.
struct height : public Meta_Accumulator< height >
{
template <typename I>
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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,12 +28,12 @@
#ifndef MLN_ACCU_HISTO_HH
# define MLN_ACCU_HISTO_HH
/*! \file mln/accu/histo.hh
*
* \brief Define a generic histogram accumulator class.
*
* \todo Use histo::data instead of std::vector!
*/
/// \file mln/accu/histo.hh
///
/// Define a generic histogram accumulator class.
///
/// \todo Use histo::data instead of std::vector!
# include <vector>
# include <algorithm>
......@@ -51,9 +51,9 @@ namespace mln
{
/*!
* \brief Generic histogram class over a value set with type \c V.
*/
///
/// Generic histogram class over a value set with type \c V.
///
template <typename V>
struct histo :
public mln::accu::internal::base<const std::vector<unsigned>& ,
......
// Copyright (C) 2007, 2008 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,11 +29,10 @@
#ifndef MLN_ACCU_INTERNAL_BASE_HH
# define MLN_ACCU_INTERNAL_BASE_HH
/*! \file mln/accu/internal/base.hh
*
* \brief Define a base class for implementation of accumulator
* classes.
*/
/// \file mln/accu/internal/base.hh
///
/// Define a base class for implementation of accumulator
/// classes.
# include <mln/core/concept/accumulator.hh>
......@@ -46,9 +46,8 @@ namespace mln
namespace internal
{
/*! Generic min accumulator class.
* Base class for implementation of accumulator classes.
*/
/// Generic min accumulator class.
/// Base class for implementation of accumulator classes.
template <typename R, typename E>
class base : public Accumulator<E>,
public mln::internal::proxy_impl< R, E >
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,10 @@
#ifndef MLN_ACCU_LAND_HH
# define MLN_ACCU_LAND_HH
/*! \file mln/accu/land.hh
*
* \brief Define a 'logical-and' accumulator.
*/
/// \file mln/accu/land.hh
///
/// Define a 'logical-and' accumulator.
///
# include <mln/accu/internal/base.hh>
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,10 @@
#ifndef MLN_ACCU_MAJ_H_HH
# define MLN_ACCU_MAJ_H_HH
/*! \file mln/accu/maj_h.hh
*
* \brief Define an accumulator that computes a maj_h.
*/
/// \file mln/accu/maj_h.hh
///
/// Define an accumulator that computes a maj_h.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......@@ -48,8 +48,8 @@ namespace mln
{
/*! \brief Generic maj_h accumulator class.
*
/// Generic maj_h accumulator class.
/*!
* The parameter \c T is the type of values.
*/
template <typename T>
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,9 @@
#ifndef MLN_ACCU_MAX_HH
# define MLN_ACCU_MAX_HH
/*! \file mln/accu/max.hh
*
* \brief Define an accumulator that computes a max.
*/
/// \file mln/accu/max.hh
///
/// Define an accumulator that computes a max.
# include <mln/core/concept/meta_accumulator.hh>
# include <mln/accu/internal/base.hh>
......@@ -46,10 +45,9 @@ namespace mln
{
/*! \brief Generic max accumulator class.
*
* The parameter \c T is the type of values.
*/
/// Generic max accumulator class.
///
/// The parameter \c T is the type of values.
template <typename T>
struct max : public mln::accu::internal::base< const T& , max<T> >
{
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,9 @@
#ifndef MLN_ACCU_MAX_H_HH
# define MLN_ACCU_MAX_H_HH
/*! \file mln/accu/max_h.hh
*
* \brief Define a generic max accumulator class based on histogram.
*/
/// \file mln/accu/max_h.hh
///
/// Define a generic max accumulator class based on histogram.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
......@@ -45,9 +44,8 @@ namespace mln
{
/*! \brief Generic max function based on histogram over a value set with
* type \c V.
*/
/// Generic max function based on histogram over a value set with
/// type \c V.
template <typename V>
struct max_h : public mln::accu::internal::base< const V&, max_h<V> >
{
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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,12 +28,11 @@
#ifndef MLN_ACCU_MEAN_HH
# define MLN_ACCU_MEAN_HH
/*! \file mln/accu/mean.hh
*
* \brief Define an accumulator that computes a mean.
*
* \todo Use accu::pair just like in accu::min_max.
*/
/// \file mln/accu/mean.hh
///
/// Define an accumulator that computes a mean.
///
/// \todo Use accu::pair just like in accu::min_max.
# include <mln/accu/internal/base.hh>
# include <mln/accu/count.hh>
......@@ -47,8 +46,8 @@ namespace mln
{
/*! \brief Generic mean accumulator class.
*
/// Generic mean accumulator class.
/*!
* Parameter \c T is the type of values that we sum. Parameter \c
* S is the type to store the sum of values; the default type of
* \c S is the summation type (property) of \c T. Parameter \c M
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_ALT_HH
# define MLN_ACCU_MEDIAN_ALT_HH
/*! \file mln/accu/median_alt.hh
*
* \brief Define alternative generic median accumulator class.
*/
/// \file mln/accu/median_alt.hh
///
/// Define alternative generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
......@@ -44,9 +43,8 @@ namespace mln
{
/*! \brief Generic median_alt function based on histogram over a
* value set with type \c S.
*/
/// Generic median_alt function based on histogram over a
/// value set with type \c S.
template <typename S>
struct median_alt : public mln::accu::internal::base< const mln_value(S)&, median_alt<S> >
{
......@@ -103,16 +101,28 @@ namespace mln
struct median_alt : public Meta_Accumulator< median_alt >
{
median_alt(const Value_Set<S>& s_) : s(s_) {}
template <typename V>
struct with
{
typedef accu::median_alt<V> ret;
};
Value_Set<S> s;
};
} // end of namespace mln::accu::meta
template <typename T>
median_alt<T> unmeta(const meta::median_alt& m, T)
{
median_alt<T> a(m.s);
return a;
}
template <typename T>
struct median_alt_on : public median_alt< value::set<T> >
{
......
// Copyright (C) 2007, 2008 EPITA Research and Development Laboratory
// Copyright (C) 2007, 2008 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 +28,9 @@
#ifndef MLN_ACCU_MEDIAN_H_HH
# define MLN_ACCU_MEDIAN_H_HH
/*! \file mln/accu/median_h.hh
*
* \brief Define a generic median accumulator class.
*/
/// \file mln/accu/median_h.hh
///
/// Define a generic median accumulator class.
# include <mln/accu/internal/base.hh>
# include <mln/accu/histo.hh>
......@@ -45,9 +44,8 @@ namespace mln
{
/*! \brief Generic median function based on histogram over a value
* set with type \c V.
*/
/// Generic median function based on histogram over a value
/// set with type \c V.
template <typename V>
struct median_h : public mln::accu::internal::base< const V&, median_h<V> >
{
......@@ -77,13 +75,13 @@ namespace mln
protected:
mutable accu::histo<V> h_;
const value::set<V>& s_; // derived from h_
const value::set<V>& s_; // derived from h_
mutable unsigned sum_minus_, sum_plus_;
mutable bool valid_;
mutable unsigned i_; // the median_h index
mutable argument t_; // the median_h value
mutable unsigned i_; // the median_h index
mutable argument t_; // the median_h value
// Auxiliary methods
void update_() const;
......
......@@ -46,8 +46,8 @@ namespace mln
{
/*! \brief Generic min accumulator class.
*
/// Generic min accumulator class.
/*!
* The parameter \c T is the type of values.
*/
template <typename T>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment