Olena-patches
Threads by month
- ----- 2025 -----
- November
- October
- September
- 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
- 9625 discussions
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-09 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Fix coding style.
* mln/accu/stat/all.hh,
* mln/accu/stat/max.hh,
* mln/accu/stat/max_h.hh,
* mln/accu/stat/mean.hh,
* mln/accu/stat/median_h.hh,
* mln/accu/stat/min.hh,
* mln/accu/stat/min_h.hh,
* mln/accu/stat/min_max.hh,
* mln/morpho/tree/all.hh,
* mln/morpho/tree/compute_attribute_image.hh,
* mln/morpho/tree/compute_parent.hh,
* mln/morpho/tree/filter/all.hh,
* mln/morpho/tree/filter/direct.hh,
* mln/morpho/tree/filter/filter.hh,
* mln/morpho/tree/filter/max.hh,
* mln/morpho/tree/filter/min.hh,
* mln/morpho/tree/filter/subtractive.hh,
* mln/morpho/tree/propagate_if.hh,
* mln/morpho/tree/propagate_node.hh,
* mln/morpho/tree/propagate_representative.hh:
Fix coding style.
---
accu/stat/all.hh | 11 +++++-
accu/stat/max.hh | 11 +++++-
accu/stat/max_h.hh | 17 +++++-----
accu/stat/mean.hh | 12 ++++++-
accu/stat/median_h.hh | 12 ++++++-
accu/stat/min.hh | 9 +++++
accu/stat/min_h.hh | 11 +++++-
accu/stat/min_max.hh | 31 +++++++++----------
morpho/tree/all.hh | 8 ++---
morpho/tree/compute_attribute_image.hh | 6 +--
morpho/tree/filter/all.hh | 26 +++++++++-------
morpho/tree/filter/direct.hh | 36 ++++++++++++++--------
morpho/tree/filter/filter.hh | 34 +++++++++++++--------
morpho/tree/filter/max.hh | 36 ++++++++++++++--------
morpho/tree/filter/min.hh | 36 ++++++++++++++--------
morpho/tree/filter/subtractive.hh | 33 ++++++++++++--------
morpho/tree/propagate_if.hh | 45 ++++++++++++++++------------
morpho/tree/propagate_node.hh | 52 ++++++++++++++++++---------------
18 files changed, 268 insertions(+), 158 deletions(-)
Index: trunk/milena/mln/accu/stat/min.hh
===================================================================
--- trunk/milena/mln/accu/stat/min.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/min.hh (revision 4041)
@@ -47,13 +47,16 @@
namespace stat
{
+
// Forward declaration.
template <typename T>
struct min;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
/// Meta accumulator for min.
@@ -66,12 +69,15 @@
typedef accu::stat::min<T> ret;
};
};
+
} // end of namespace mln::accu::meta::stat
+
} // end of namespace mln::accu::meta
namespace stat
{
+
/// \brief Generic min accumulator class.
/*!
* The parameter \c T is the type of values.
@@ -169,6 +175,7 @@
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::accu::stat
+
} // end of namespace mln::accu
} // end of namespace mln
Index: trunk/milena/mln/accu/stat/median_h.hh
===================================================================
--- trunk/milena/mln/accu/stat/median_h.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/median_h.hh (revision 4041)
@@ -40,19 +40,25 @@
namespace mln
{
+
namespace accu
{
+
namespace stat
{
+
// Forward declaration.
template <typename V>
struct median_h;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
+
/// Meta accumulator for median_h.
struct median_h : public Meta_Accumulator< median_h >
{
@@ -62,7 +68,9 @@
typedef accu::stat::median_h<V> ret;
};
};
+
} // end of namespace mln::accu::meta::stat
+
} // end of namespace mln::accu::meta
namespace stat
@@ -282,7 +290,9 @@
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::accu::stat
+
} // end of namespace mln::accu
+
} // end of namespace mln
#endif // ! MLN_ACCU_STAT_MEDIAN_H_HH
Index: trunk/milena/mln/accu/stat/max.hh
===================================================================
--- trunk/milena/mln/accu/stat/max.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/max.hh (revision 4041)
@@ -41,22 +41,27 @@
namespace mln
{
+
namespace accu
{
+
namespace stat
{
+
// Forward declaration.
template <typename T>
struct max;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
- /// Meta accumulator for max.
+ /// Meta accumulator for max.
struct max : public Meta_Accumulator< max >
{
template <typename T>
@@ -67,6 +72,7 @@
};
} // end of namespace mln::accu::meta::stat
+
} // end of namespace mln::accu::meta
@@ -168,6 +174,7 @@
}
# endif // ! MLN_INCLUDE_ONLY
+
} // end of namespace mln::accu::stat
} // end of namespace mln::accu
Index: trunk/milena/mln/accu/stat/all.hh
===================================================================
--- trunk/milena/mln/accu/stat/all.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/all.hh (revision 4041)
@@ -35,19 +35,24 @@
namespace mln
{
+
namespace accu
{
+
namespace meta
{
+
/// Namespace of statistical meta-accumulators.
namespace stat {}
- }
+
+ } // end of namespace mln::accu::meta
/// Namespace of statistical accumulators.
namespace stat {}
- }
-}
+ } // end of namespace mln::accu
+
+} // end of namespace mln
# include <mln/accu/stat/deviation.hh>
Index: trunk/milena/mln/accu/stat/min_max.hh
===================================================================
--- trunk/milena/mln/accu/stat/min_max.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/min_max.hh (revision 4041)
@@ -46,24 +46,9 @@
namespace mln
{
- namespace accu
- {
- namespace stat
- {
- // Forward declaration.
- template <typename V>
- struct min_max;
- }
- namespace meta
- {
- namespace stat
+ namespace accu
{
- // FIXME: Doc!
- typedef meta::pair<meta::stat::min,meta::stat::max> min_max;
-
- } // end of namespace mln::accu::meta::stat
- } // end of namespace mln::accu::meta
namespace stat
{
@@ -82,6 +67,20 @@
template <typename I> struct min_max< util::pix<I> >;
} // end of namespace mln::accu::stat
+
+
+ namespace meta
+ {
+
+ namespace stat
+ {
+ // FIXME: Doc!
+ typedef meta::pair<meta::stat::min,meta::stat::max> min_max;
+
+ } // end of namespace mln::accu::meta::stat
+
+ } // end of namespace mln::accu::meta
+
} // end of namespace mln::accu
} // end of namespace mln
Index: trunk/milena/mln/accu/stat/min_h.hh
===================================================================
--- trunk/milena/mln/accu/stat/min_h.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/min_h.hh (revision 4041)
@@ -41,18 +41,22 @@
namespace mln
{
+
namespace accu
{
namespace stat
{
+
// Forward declaration.
template <typename V>
struct min_h;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
@@ -67,11 +71,13 @@
};
} // end of namespace mln::meta::stat
+
} // end of namespace mln::meta
namespace stat
{
+
/// \brief Generic min function based on histogram over a value
/// set with type \c V.
///
@@ -305,8 +311,9 @@
} // end of namespace mln::accu::stat
+
} // end of namespace mln::accu
-} // end of namespace mln
+} // end of namespace mln
#endif // ! MLN_ACCU_STAT_MIN_H_HH
Index: trunk/milena/mln/accu/stat/max_h.hh
===================================================================
--- trunk/milena/mln/accu/stat/max_h.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/max_h.hh (revision 4041)
@@ -47,13 +47,16 @@
namespace stat
{
+
// Forward declaration.
template <typename V>
struct max_h;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
@@ -67,8 +70,9 @@
};
};
- } // end of namespace mln::meta::stat
- } // end of namespace mln::meta
+ } // end of namespace mln::accu::meta::stat
+
+ } // end of namespace mln::accu::meta
namespace stat
@@ -125,13 +129,8 @@
};
-
template <typename I> struct max_h< util::pix<I> >;
-
-
-
-
# ifndef MLN_INCLUDE_ONLY
template <typename V>
@@ -308,7 +307,9 @@
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::accu::stat
+
} // end of namespace mln::accu
+
} // end of namespace mln
Index: trunk/milena/mln/accu/stat/mean.hh
===================================================================
--- trunk/milena/mln/accu/stat/mean.hh (revision 4040)
+++ trunk/milena/mln/accu/stat/mean.hh (revision 4041)
@@ -42,19 +42,25 @@
namespace mln
{
+
namespace accu
{
+
namespace stat
{
+
// Forward declaration.
template <typename T, typename S, typename M>
struct mean;
- }
+
+ } // end of namespace mln::accu::stat
namespace meta
{
+
namespace stat
{
+
/// Meta accumulator for mean.
struct mean : public Meta_Accumulator< mean >
{
@@ -66,7 +72,9 @@
typedef accu::stat::mean<T,S,M> ret;
};
};
+
} // end of namespace mln::accu::meta::stat
+
} // end of namespace mln::accu::meta
namespace stat
@@ -183,7 +191,9 @@
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::accu::stat
+
} // end of namespace mln::accu
+
} // end of namespace mln
#endif // ! MLN_ACCU_STAT_MEAN_HH
Index: trunk/milena/mln/morpho/tree/compute_attribute_image.hh
===================================================================
--- trunk/milena/mln/morpho/tree/compute_attribute_image.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/compute_attribute_image.hh (revision 4041)
@@ -72,9 +72,9 @@
** - p is root iff parent(p) == p \n
** - p is a node iff either p is root or f(parent(p)) != f(p).
**
- ** @param[in] a Attribute.
- ** @param[in] t Component tree.
- ** @param[out] accu_image Optional argument used to store image
+ ** \param[in] a Attribute.
+ ** \param[in] t Component tree.
+ ** \param[out] accu_image Optional argument used to store image
** of attribute accumulator.
**
** @return The attribute image.
Index: trunk/milena/mln/morpho/tree/propagate_representative.hh
===================================================================
Index: trunk/milena/mln/morpho/tree/compute_parent.hh
===================================================================
Index: trunk/milena/mln/morpho/tree/filter/min.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/min.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/min.hh (revision 4041)
@@ -26,34 +26,41 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_MIN_HH_
-# define MLN_MORPHO_TREE_FILTER_MIN_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_MIN_HH
+# define MLN_MORPHO_TREE_FILTER_MIN_HH
# include <mln/core/concept/function.hh>
# include <mln/morpho/tree/data.hh>
/**
-** @file mln/morpho/tree/filter/min.hh
+** \file mln/morpho/tree/filter/min.hh
**
-** @brief Filtering with min strategy.
+** \brief Filtering with min strategy.
**
**
*/
-namespace mln {
- namespace morpho {
- namespace tree {
- namespace filter {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace filter
+ {
/**
** Min pruning strategy. A node is removed iif its parent is
** removed or if it does not verify the predicate \p pred_.
**
- ** @param[in] tree Component tree.
- ** @param[out] f_ Image to filter.
- ** @param[in] pred_ Filtering criterion.
+ ** \param[in] tree Component tree.
+ ** \param[out] f_ Image to filter.
+ ** \param[in] pred_ Filtering criterion.
*/
template <typename T, typename F, typename P>
inline
@@ -90,11 +97,14 @@
trace::exiting("mln::morpho::tree::filter::min");
}
-# endif /* !MLN_INCLUDE_ONLY */
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree::filter
+
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_FILTER_MIN_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_MIN_HH
Index: trunk/milena/mln/morpho/tree/filter/filter.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/filter.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/filter.hh (revision 4041)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_FILTER_HH_
-# define MLN_MORPHO_TREE_FILTER_FILTER_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_FILTER_HH
+# define MLN_MORPHO_TREE_FILTER_FILTER_HH
/**
** \file mln/morpho/tree/filter/filter.hh
@@ -39,10 +39,17 @@
# include <mln/morpho/tree/data.hh>
# include <mln/morpho/tree/propagate_if.hh>
-namespace mln {
- namespace morpho {
- namespace tree {
- namespace filter {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace filter
+ {
/**
@@ -50,10 +57,10 @@
** sub-components of nodes that does not match the predicate
** \p pred_ are filled with the given value \p v.
**
- ** @param tree Component tree.
- ** @param f_ Image function.
- ** @param pred_ Predicate.
- ** @param v Value to propagate.
+ ** \param tree Component tree.
+ ** \param f_ Image function.
+ ** \param pred_ Predicate.
+ ** \param v Value to propagate.
*/
template <typename T, typename F, typename P>
inline
@@ -88,12 +95,15 @@
trace::exiting("mln::morpho::tree::filter::filter");
}
-# endif /* !MLN_INCLUDE_ONLY */
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree::filter
+
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_FILTER_FILTER_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_FILTER_HH
Index: trunk/milena/mln/morpho/tree/filter/max.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/max.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/max.hh (revision 4041)
@@ -26,33 +26,40 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_MAX_HH_
-# define MLN_MORPHO_TREE_FILTER_MAX_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_MAX_HH
+# define MLN_MORPHO_TREE_FILTER_MAX_HH
# include <mln/core/concept/function.hh>
# include <mln/morpho/tree/data.hh>
/**
-** @file mln/morpho/tree/filter/max.hh
+** \file mln/morpho/tree/filter/max.hh
**
-** @brief Filtering with max strategy.
+** \brief Filtering with max strategy.
**
**
*/
-namespace mln {
- namespace morpho {
- namespace tree {
- namespace filter {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace filter
+ {
/**
** Max pruning strategy. A node is removed iif all of its
** children are removed or if it does not verify the predicate
** \p pred_.
**
- ** @param[in] tree Component tree.
- ** @param[out] f_ Image to filter.
- ** @param[in] pred_ Filtering criterion.
+ ** \param[in] tree Component tree.
+ ** \param[out] f_ Image to filter.
+ ** \param[in] pred_ Filtering criterion.
*/
template <typename T, typename F, typename P>
inline
@@ -100,11 +107,14 @@
trace::exiting("mln::morpho::tree::filter::max");
}
-# endif /* !MLN_INCLUDE_ONLY */
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree::filter
+
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_FILTER_MAX_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_MAX_HH
Index: trunk/milena/mln/morpho/tree/filter/all.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/all.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/all.hh (revision 4041)
@@ -26,11 +26,11 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_ALL_HH_
-# define MLN_MORPHO_TREE_FILTER_ALL_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_ALL_HH
+# define MLN_MORPHO_TREE_FILTER_ALL_HH
/**
-** @file mln/morpho/tree/filter.hh
+** \file mln/morpho/tree/filter.hh
**
** Methods to handle component tree filtering strategies with
** non-increasing attribute. Nevertheless, it works on increasing
@@ -40,16 +40,22 @@
** the min filter that minimizes calls to predicate function.
*/
-namespace mln {
- namespace morpho {
- namespace tree {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
/// Namespace for attribute filtering.
- namespace filter {
+ namespace filter {}
- } // end of namespace mln::morpho::tree::filter
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
@@ -61,6 +67,4 @@
# include <mln/morpho/tree/filter/direct.hh>
# include <mln/morpho/tree/filter/subtractive.hh>
-
-
-#endif /* !MLN_MORPHO_TREE_FILTER_ALL_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_ALL_HH
Index: trunk/milena/mln/morpho/tree/filter/direct.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/direct.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/direct.hh (revision 4041)
@@ -26,32 +26,39 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_DIRECT_HH_
-# define MLN_MORPHO_TREE_FILTER_DIRECT_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_DIRECT_HH
+# define MLN_MORPHO_TREE_FILTER_DIRECT_HH
# include <mln/core/concept/function.hh>
# include <mln/morpho/tree/data.hh>
/**
-** @file mln/morpho/tree/filter/direct.hh
+** \file mln/morpho/tree/filter/direct.hh
**
-** @brief Filtering with direct strategy.
+** \brief Filtering with direct strategy.
**
**
*/
-namespace mln {
- namespace morpho {
- namespace tree {
- namespace filter {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace filter
+ {
/**
** Direct non-pruning strategy. A node is removed if it does
** not verify the predicate. The sub-components remain intact.
**
- ** @param[in] tree Component tree.
- ** @param[out] f_ Image to filter.
- ** @param[in] pred_ Filtering criterion.
+ ** \param[in] tree Component tree.
+ ** \param[out] f_ Image to filter.
+ ** \param[in] pred_ Filtering criterion.
*/
template <typename T, typename F, typename P>
inline
@@ -81,11 +88,14 @@
trace::exiting("mln::morpho::tree::filter::direct");
}
-# endif /* !MLN_INCLUDE_ONLY */
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree::filter
+
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_FILTER_DIRECT_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_DIRECT_HH
Index: trunk/milena/mln/morpho/tree/filter/subtractive.hh
===================================================================
--- trunk/milena/mln/morpho/tree/filter/subtractive.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/filter/subtractive.hh (revision 4041)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH_
-# define MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH_
+#ifndef MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH
+# define MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH
# include <mln/core/concept/function.hh>
# include <mln/fun/ops.hh>
@@ -36,26 +36,33 @@
# include <mln/morpho/tree/propagate_if.hh>
/**
-** @file mln/morpho/tree/filter/subtractive.hh
+** \file mln/morpho/tree/filter/subtractive.hh
**
-** @brief Filtering with subtractive strategy.
+** \brief Filtering with subtractive strategy.
**
**
*/
-namespace mln {
- namespace morpho {
- namespace tree {
- namespace filter {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
+
+ namespace filter
+ {
/**
** Subtractive pruning strategy. The node is removed if it
** does not verify the predicate. The sub-components values
** are set to the value of the removed component.
**
- ** @param[in] tree Component tree.
- ** @param[out] f_ Image to filter.
- ** @param[in] pred_ Filtering criterion.
+ ** \param[in] tree Component tree.
+ ** \param[out] f_ Image to filter.
+ ** \param[in] pred_ Filtering criterion.
*/
template <typename T, typename F, typename P>
inline
@@ -87,11 +94,11 @@
trace::exiting("mln::morpho::tree::filter::subtractive");
}
-# endif /* !MLN_INCLUDE_ONLY */
+# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree::filter
} // end of namespace mln::morpho::tree
} // end of namespace mln::morpho
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH_ */
+#endif // ! MLN_MORPHO_TREE_FILTER_SUBTRACTIVE_HH
Index: trunk/milena/mln/morpho/tree/propagate_node.hh
===================================================================
--- trunk/milena/mln/morpho/tree/propagate_node.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/propagate_node.hh (revision 4041)
@@ -26,8 +26,8 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_PROPAGATE_NODE_HH_
-# define MLN_MORPHO_TREE_PROPAGATE_NODE_HH_
+#ifndef MLN_MORPHO_TREE_PROPAGATE_NODE_HH
+# define MLN_MORPHO_TREE_PROPAGATE_NODE_HH
# include <mln/core/concept/image.hh>
# include <mln/core/macros.hh>
@@ -37,18 +37,23 @@
///
/// Functions to propagate node in the tree.
-namespace mln {
- namespace morpho {
- namespace tree {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
/**
** Propagate a value \p v from a node \p n to its descendants.
**
- ** @param n[in] Node to propagate.
- ** @param t[in] Component tree used for propagation.
- ** @param a_[in] Attribute image where values are propagated.
- ** @param v[in] Value to propagate.
- ** @param nb_leaves[out] Optional. Store the number of leaves in
+ ** \param n[in] Node to propagate.
+ ** \param t[in] Component tree used for propagation.
+ ** \param a_[in] Attribute image where values are propagated.
+ ** \param v[in] Value to propagate.
+ ** \param nb_leaves[out] Optional. Store the number of leaves in
** the component.
*/
template <typename T, typename A>
@@ -62,10 +67,10 @@
/**
** Propagate the node's value to its descendants.
**
- ** @param n[in] Node to propagate.
- ** @param t[in] Component tree used for propagation.
- ** @param a_[in] Attribute image where values are propagated.
- ** @param nb_leaves[out] Optional. Store the number of leaves in
+ ** \param n[in] Node to propagate.
+ ** \param t[in] Component tree used for propagation.
+ ** \param a_[in] Attribute image where values are propagated.
+ ** \param nb_leaves[out] Optional. Store the number of leaves in
** the component.
*/
template <typename T, typename A>
@@ -80,10 +85,10 @@
/**
** Propagate a value \p v from a node \p n to its ancestors.
**
- ** @param n Node to propagate.
- ** @param t Component tree used for propagation.
- ** @param a_ Attribute image where values are propagated.
- ** @param v Value to propagate.
+ ** \param n Node to propagate.
+ ** \param t Component tree used for propagation.
+ ** \param a_ Attribute image where values are propagated.
+ ** \param v Value to propagate.
*/
template <typename T, typename A>
void
@@ -95,9 +100,9 @@
/**
** Propagate the node's value to its ancestors.
**
- ** @param n Node to propagate.
- ** @param t Component tree used for propagation.
- ** @param a_ Attribute image where values are propagated.
+ ** \param n Node to propagate.
+ ** \param t Component tree used for propagation.
+ ** \param a_ Attribute image where values are propagated.
*/
template <typename T, typename A>
inline
@@ -111,7 +116,6 @@
/* Descendants propagation */
-
template <typename T, typename A>
inline
void
@@ -203,7 +207,9 @@
# endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_PROPAGATE_NODE_HH_ */
+#endif // ! MLN_MORPHO_TREE_PROPAGATE_NODE_HH
Index: trunk/milena/mln/morpho/tree/all.hh
===================================================================
--- trunk/milena/mln/morpho/tree/all.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/all.hh (revision 4041)
@@ -35,6 +35,7 @@
namespace mln
{
+
namespace morpho
{
@@ -42,8 +43,9 @@
namespace tree
{}
- }
-}
+ } // end of namespace mln::morpho
+
+} // end of namespace mln
# include <mln/morpho/tree/compute_attribute_image.hh>
@@ -52,6 +54,4 @@
# include <mln/morpho/tree/max.hh>
# include <mln/morpho/tree/utils.hh>
-
-
#endif // ! MLN_MORPHO_TREE_ALL_HH
Index: trunk/milena/mln/morpho/tree/propagate_if.hh
===================================================================
--- trunk/milena/mln/morpho/tree/propagate_if.hh (revision 4040)
+++ trunk/milena/mln/morpho/tree/propagate_if.hh (revision 4041)
@@ -26,13 +26,13 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_MORPHO_TREE_PROPAGATE_IF_HH_
-# define MLN_MORPHO_TREE_PROPAGATE_IF_HH_
+#ifndef MLN_MORPHO_TREE_PROPAGATE_IF_HH
+# define MLN_MORPHO_TREE_PROPAGATE_IF_HH
/**
-** @file mln/morpho/tree/propagate_if.hh
+** \file mln/morpho/tree/propagate_if.hh
**
-** @brief Routines to handle propagation with predicate.
+** \brief Routines to handle propagation with predicate.
**
*/
@@ -42,9 +42,14 @@
# include <mln/data/fill.hh>
# include <mln/pw/all.hh>
-namespace mln {
- namespace morpho {
- namespace tree {
+namespace mln
+{
+
+ namespace morpho
+ {
+
+ namespace tree
+ {
template <typename W>
struct way_of_propagation : Object< W > { protected: way_of_propagation() {}; };
@@ -55,12 +60,12 @@
** Propagate nodes checking the predicate \p pred in the way
** defined by \p way_of_propagation.
**
- ** @param tree Component tree used for propagation.
- ** @param a_ Attributed image where values are propagated.
- ** @param way_of_propagation Propagate node in acsendant or
+ ** \param tree Component tree used for propagation.
+ ** \param a_ Attributed image where values are propagated.
+ ** \param way_of_propagation Propagate node in acsendant or
** descendant way.
- ** @param pred Predicate that node must check to be propagated.
- ** @param v Value to be propagated. (By default \p v is the value
+ ** \param pred Predicate that node must check to be propagated.
+ ** \param v Value to be propagated. (By default \p v is the value
** at the node being propagated).
*/
template <typename T, typename A, typename P, typename W>
@@ -84,12 +89,12 @@
** Propagate nodes having the value v in the way
** defined by \p way_of_propagation.
**
- ** @param tree Component tree used for propagation.
- ** @param a_ Attributed image where values are propagated.
- ** @param way_of_propagation Propagate node in acsendant or
+ ** \param tree Component tree used for propagation.
+ ** \param a_ Attributed image where values are propagated.
+ ** \param way_of_propagation Propagate node in acsendant or
** descendant way.
- ** @param v Value that node must have to be propagated.
- ** @param v_prop Value to propagate (By default it is the value
+ ** \param v Value that node must have to be propagated.
+ ** \param v_prop Value to propagate (By default it is the value
** at the node being propagated).
*/
template <typename T, typename A, typename W>
@@ -316,11 +321,13 @@
internal::propagate_if(tree, a, prop, pred);
}
-#endif /* !MLN_INCLUDE_ONLY */
+#endif // ! MLN_INCLUDE_ONLY
} // end of namespace mln::morpho::tree
+
} // end of namespace mln::morpho
+
} // end of namespace mln
-#endif /* !MLN_MORPHO_TREE_PROPAGATE_IF_HH_ */
+#endif // ! MLN_MORPHO_TREE_PROPAGATE_IF_HH
1
0
[PATCH 4/4] Rename nfaces(unsigned) as nfaces_of_dim(unsigned) (cont.).
by Roland Levillain 08 Jun '09
by Roland Levillain 08 Jun '09
08 Jun '09
* theo/esiee/laurent/presentation/classif.cc: Here.
---
milena/sandbox/ChangeLog | 6 ++++++
.../theo/esiee/laurent/presentation/classif.cc | 4 ++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index ba73002..c64e27c 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Rename nfaces(unsigned) as nfaces_of_dim(unsigned).
+
+ * theo/esiee/laurent/presentation/classif.cc: Here.
+
2009-06-08 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Minor changes to move_accu script.
diff --git a/milena/sandbox/theo/esiee/laurent/presentation/classif.cc b/milena/sandbox/theo/esiee/laurent/presentation/classif.cc
index 3b2bea2..0b9912d 100644
--- a/milena/sandbox/theo/esiee/laurent/presentation/classif.cc
+++ b/milena/sandbox/theo/esiee/laurent/presentation/classif.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -396,7 +396,7 @@ int main(int argc, char* argv[])
We definitely need a complex_image that can accept a subset of a
complex as domain (or at least a p_face<N, D, P>. */
- std::cout << "nbasins = " << nbasins - c.nfaces(0) << std::endl;
+ std::cout << "nbasins = " << nbasins - c.nfaces_of_dim(0) << std::endl;
image2d<int_u8> canvas_wst(seeds.domain());
--
1.6.1.2
1
0
08 Jun '09
* mln/core/image/complex_image.hh,
* mln/core/site_set/p_complex.hh,
* mln/io/off/load.hh,
* mln/topo/complex.hh,
* mln/topo/face.hh,
* mln/topo/face_iter.hh:
* mln/topo/n_face_iter.hh,
* tests/core/image/complex_image.cc,
* tests/topo/complex.cc:
Here.
---
milena/ChangeLog | 15 +++++++++++++++
milena/mln/core/image/complex_image.hh | 4 ++--
milena/mln/core/site_set/p_complex.hh | 10 +++-------
milena/mln/io/off/load.hh | 7 ++++---
milena/mln/topo/complex.hh | 6 +++---
milena/mln/topo/face.hh | 2 +-
milena/mln/topo/face_iter.hh | 4 ++--
milena/mln/topo/n_face_iter.hh | 8 ++++----
milena/tests/core/image/complex_image.cc | 4 ++--
milena/tests/topo/complex.cc | 9 ++++++---
10 files changed, 42 insertions(+), 27 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 8e2cd90..dbae327 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,20 @@
2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+ Rename nfaces(unsigned) as nfaces_of_dim(unsigned).
+
+ * mln/core/image/complex_image.hh,
+ * mln/core/site_set/p_complex.hh,
+ * mln/io/off/load.hh,
+ * mln/topo/complex.hh,
+ * mln/topo/face.hh,
+ * mln/topo/face_iter.hh:
+ * mln/topo/n_face_iter.hh,
+ * tests/core/image/complex_image.cc,
+ * tests/topo/complex.cc:
+ Here.
+
+2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+
Rename nfaces_with_dim<N>() as nfaces_of_static_dim<N>().
* apps/statues/save_bin_alt.hh,
diff --git a/milena/mln/core/image/complex_image.hh b/milena/mln/core/image/complex_image.hh
index b1c2c7d..fa7d26c 100644
--- a/milena/mln/core/image/complex_image.hh
+++ b/milena/mln/core/image/complex_image.hh
@@ -223,7 +223,7 @@ namespace mln
big blocks of preconditions like this one. */
# ifndef NDEBUG
for (unsigned i = 0; i < D; ++i)
- mln_precondition(pc.cplx().nfaces(i) == values[i].size());
+ mln_precondition(pc.cplx().nfaces_of_dim(i) == values[i].size());
# endif // !NDEBUG
}
@@ -245,7 +245,7 @@ namespace mln
{
metal::vec<D + 1, std::vector<V> > values;
for (unsigned i = 0; i <= D; ++i)
- values[i].resize(pc.cplx().nfaces(i));
+ values[i].resize(pc.cplx().nfaces_of_dim(i));
init_(pc, values);
}
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index c0e432f..235cc5b 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -158,11 +158,7 @@ namespace mln
/// Return the number of faces in the complex.
unsigned nfaces() const;
/// Return the number of \a n-faces in the complex.
- unsigned nfaces(unsigned n) const;
-
- // FIXME: Add nfaces(unsigned) routines? Yes, if this can
- // simplify (and lighten) the implementation of piters, psites,
- // etc.
+ unsigned nfaces_of_dim(unsigned n) const;
// FIXME: This method is probably useless now.
/// Is this site set valid?
@@ -259,9 +255,9 @@ namespace mln
template <unsigned D, typename G>
inline
unsigned
- p_complex<D, G>::nfaces(unsigned n) const
+ p_complex<D, G>::nfaces_of_dim(unsigned n) const
{
- return cplx_.nfaces(n);
+ return cplx_.nfaces_of_dim(n);
}
template <unsigned D, typename G>
diff --git a/milena/mln/io/off/load.hh b/milena/mln/io/off/load.hh
index 0e8001f..792c907 100644
--- a/milena/mln/io/off/load.hh
+++ b/milena/mln/io/off/load.hh
@@ -583,7 +583,7 @@ namespace mln
{
// Default values.
for (unsigned i = 0; i <= D; ++i)
- vs[i].insert(vs[i].begin(), s.cplx().nfaces(i), true);
+ vs[i].insert(vs[i].begin(), s.cplx().nfaces_of_dim(i), true);
}
void
@@ -591,7 +591,7 @@ namespace mln
{
// Default values for n-face with n in [0, D[.
for (unsigned i = 0; i < D; ++i)
- vs[i].insert(vs[i].begin(), s.cplx().nfaces(i), 0.0f);
+ vs[i].insert(vs[i].begin(), s.cplx().nfaces_of_dim(i), 0.0f);
// Values for D-faces.
vs[D] = face_value;
}
@@ -601,7 +601,8 @@ namespace mln
{
// Default values for n-face with n in [0, D[.
for (unsigned i = 0; i < D; ++i)
- vs[i].insert(vs[i].begin(), s.cplx().nfaces(i), literal::black);
+ vs[i].insert(vs[i].begin(), s.cplx().nfaces_of_dim(i),
+ literal::black);
// Values for D-faces.
vs[D] = face_value;
}
diff --git a/milena/mln/topo/complex.hh b/milena/mln/topo/complex.hh
index aa3af72..3a13c25 100644
--- a/milena/mln/topo/complex.hh
+++ b/milena/mln/topo/complex.hh
@@ -143,7 +143,7 @@ namespace mln
/// since each n_faces_set is checked (the present implementation
/// does not provide a direct access to n_faces_set through a
/// dynamic value of the dimension).
- unsigned nfaces(unsigned n) const;
+ unsigned nfaces_of_dim(unsigned n) const;
/// \}
/// Pretty-printing.
@@ -555,7 +555,7 @@ namespace mln
/// add_size : c -> c.size()
/// \endcode
///
- /// \see mln::complex<D>::nfaces (dynamic version).
+ /// \see mln::complex<D>::nfaces_of_dim (dynamic version).
/// \see mln::complex<D>::apply_if_dim_matches_.
struct get_size
{
@@ -600,7 +600,7 @@ namespace mln
template <unsigned D>
inline
unsigned
- complex<D>::nfaces(unsigned n) const
+ complex<D>::nfaces_of_dim(unsigned n) const
{
// Ensure N is compatible with D.
mln_precondition(n <= D);
diff --git a/milena/mln/topo/face.hh b/milena/mln/topo/face.hh
index 80eff90..e6f5cd2 100644
--- a/milena/mln/topo/face.hh
+++ b/milena/mln/topo/face.hh
@@ -208,7 +208,7 @@ namespace mln
bool
face<D>::is_valid() const
{
- return n_ <= D && face_id_ < cplx_.nfaces(n_);
+ return n_ <= D && face_id_ < cplx_.nfaces_of_dim(n_);
}
template <unsigned D>
diff --git a/milena/mln/topo/face_iter.hh b/milena/mln/topo/face_iter.hh
index a1c5514..ee3a189 100644
--- a/milena/mln/topo/face_iter.hh
+++ b/milena/mln/topo/face_iter.hh
@@ -185,7 +185,7 @@ namespace mln
{
if (is_valid())
{
- if (f_.face_id() + 1 < f_.cplx().nfaces(f_.n()))
+ if (f_.face_id() + 1 < f_.cplx().nfaces_of_dim(f_.n()))
f_.inc_face_id();
else
// Start to iterate on the faces of the next dimension if
@@ -245,7 +245,7 @@ namespace mln
if (f_.n() > 0)
{
f_.dec_n();
- f_.set_face_id(f_.cplx().nfaces(f_.n()) - 1);
+ f_.set_face_id(f_.cplx().nfaces_of_dim(f_.n()) - 1);
}
else
invalidate();
diff --git a/milena/mln/topo/n_face_iter.hh b/milena/mln/topo/n_face_iter.hh
index 93981a6..a1ead8d 100644
--- a/milena/mln/topo/n_face_iter.hh
+++ b/milena/mln/topo/n_face_iter.hh
@@ -214,7 +214,7 @@ namespace mln
{
if (is_valid())
{
- if (f_.face_id() + 1 < f_.cplx().nfaces(n()))
+ if (f_.face_id() + 1 < f_.cplx().nfaces_of_dim(n()))
f_.inc_face_id();
else
/* Don't invalidate the whole face if we have reached the
@@ -229,7 +229,7 @@ namespace mln
void
n_face_fwd_iter<D>::invalidate_face_id_()
{
- f_.set_face_id(f_.cplx().nfaces(n()));
+ f_.set_face_id(f_.cplx().nfaces_of_dim(n()));
}
template <unsigned D>
@@ -277,7 +277,7 @@ namespace mln
void
n_face_bkd_iter<D>::start()
{
- f_.set_face_id(f_.cplx().nfaces(n()) - 1);
+ f_.set_face_id(f_.cplx().nfaces_of_dim(n()) - 1);
}
template <unsigned D>
@@ -302,7 +302,7 @@ namespace mln
void
n_face_bkd_iter<D>::invalidate_face_id_()
{
- f_.set_face_id(f_.cplx().nfaces(n()));
+ f_.set_face_id(f_.cplx().nfaces_of_dim(n()));
}
template <unsigned D>
diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc
index 56346d3..08aee4e 100644
--- a/milena/tests/core/image/complex_image.cc
+++ b/milena/tests/core/image/complex_image.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -160,7 +160,7 @@ int main()
metal::vec<D + 1, std::vector< int_u8 > > values;
// Assign 0 to 0-faces, 1 to 1-faces and 2 to 2-faces.
for (unsigned d = 0; d <= D; ++d)
- for (unsigned n = 0; n < pc.cplx().nfaces(d); ++n)
+ for (unsigned n = 0; n < pc.cplx().nfaces_of_dim(d); ++n)
values[d].push_back(d);
// Create and init an image based on PC.
diff --git a/milena/tests/topo/complex.cc b/milena/tests/topo/complex.cc
index fa6832d..ba7a471 100644
--- a/milena/tests/topo/complex.cc
+++ b/milena/tests/topo/complex.cc
@@ -112,9 +112,12 @@ int main()
std::cout
<< "Using ``dynamic'' manipulators." << std::endl
- << " number of 0-faces: c.nfaces(0) = " << c.nfaces(0) << std::endl
- << " number of 1-faces: c.nfaces(1) = " << c.nfaces(1) << std::endl
- << " number of 2-faces: c.nfaces(2) = " << c.nfaces(2) << std::endl
+ << " number of 0-faces: c.nfaces_of_dim(0) = "
+ << c.nfaces_of_dim(0) << std::endl
+ << " number of 1-faces: c.nfaces_of_dim(1) = "
+ << c.nfaces_of_dim(1) << std::endl
+ << " number of 2-faces: c.nfaces_of_dim(2) = "
+ << c.nfaces_of_dim(2) << std::endl
<< std::endl;
/*-------------------.
--
1.6.1.2
1
0
[PATCH 2/4] Rename nfaces_with_dim<N>() as nfaces_of_static_dim<N>().
by Roland Levillain 08 Jun '09
by Roland Levillain 08 Jun '09
08 Jun '09
* apps/statues/save_bin_alt.hh,
* mln/core/site_set/p_faces.hh,
* mln/io/off/save.hh,
* mln/topo/attic/faces_iter.hh,
* mln/topo/complex.hh,
* mln/topo/face_iter.hh,
* mln/topo/n_face.hh,
* mln/topo/static_n_face_iter.hh,
* tests/morpho/complex_image_wst.cc,
* tests/topo/complex.cc:
Here.
---
milena/ChangeLog | 16 ++++++++++++++++
milena/apps/statues/save_bin_alt.hh | 9 +++++----
milena/mln/core/site_set/p_faces.hh | 8 ++------
milena/mln/io/off/save.hh | 13 +++++++------
milena/mln/topo/attic/faces_iter.hh | 6 +++---
milena/mln/topo/complex.hh | 10 +++++-----
milena/mln/topo/face_iter.hh | 2 +-
milena/mln/topo/n_face.hh | 4 ++--
milena/mln/topo/static_n_face_iter.hh | 4 ++--
milena/tests/morpho/complex_image_wst.cc | 2 +-
milena/tests/topo/complex.cc | 9 ++++++---
11 files changed, 50 insertions(+), 33 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 915d95a..8e2cd90 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,21 @@
2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+ Rename nfaces_with_dim<N>() as nfaces_of_static_dim<N>().
+
+ * apps/statues/save_bin_alt.hh,
+ * mln/core/site_set/p_faces.hh,
+ * mln/io/off/save.hh,
+ * mln/topo/attic/faces_iter.hh,
+ * mln/topo/complex.hh,
+ * mln/topo/face_iter.hh,
+ * mln/topo/n_face.hh,
+ * mln/topo/static_n_face_iter.hh,
+ * tests/morpho/complex_image_wst.cc,
+ * tests/topo/complex.cc:
+ Here.
+
+2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+
Typo in the documentation of mln::topo::complex.
* mln/topo/complex.hh: Here.
diff --git a/milena/apps/statues/save_bin_alt.hh b/milena/apps/statues/save_bin_alt.hh
index 08b38e6..e422578 100644
--- a/milena/apps/statues/save_bin_alt.hh
+++ b/milena/apps/statues/save_bin_alt.hh
@@ -107,15 +107,16 @@ namespace mln
be safely ignored.'' */
/* FIXME: This is too long. We shall be able to write
- ima.domain().template nfaces_with_dim<0>()
+ ima.domain().template nfaces_of_static_dim<0>()
or even
- ima.template nfaces_with_dim<0>().
+ ima.template nfaces_of_static_dim<0>().
*/
- ostr << ima.domain().cplx().template nfaces_with_dim<0>() << ' '
+ ostr << ima.domain().cplx().template nfaces_of_static_dim<0>() << ' '
<< n2faces << ' '
- << ima.domain().cplx().template nfaces_with_dim<1>() << std::endl;
+ << ima.domain().cplx().template nfaces_of_static_dim<1>()
+ << std::endl;
/*-------.
| Data. |
diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh
index f9081d3..8e83f5c 100644
--- a/milena/mln/core/site_set/p_faces.hh
+++ b/milena/mln/core/site_set/p_faces.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008,2009 EPITA Research and Development Laboratory
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory
// (LRDE)
//
// This file is part of the Milena Library. This library is free
@@ -127,10 +127,6 @@ namespace mln
/// Return The number of faces in the complex.
unsigned nfaces() const;
- // FIXME: Add nfaces(unsigned) routines? Yes, if this can
- // simplify (and lighten) the implementation of piters, psites,
- // etc.
-
// FIXME: This method is probably useless now.
/// Is this site set valid?
bool is_valid() const;
@@ -225,7 +221,7 @@ namespace mln
unsigned
p_faces<N, D, P>::nfaces() const
{
- return cplx_.template nfaces_with_dim<N>();
+ return cplx_.template nfaces_of_static_dim<N>();
}
template <unsigned N, unsigned D, typename P>
diff --git a/milena/mln/io/off/save.hh b/milena/mln/io/off/save.hh
index bd771db..a2f1d5d 100644
--- a/milena/mln/io/off/save.hh
+++ b/milena/mln/io/off/save.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -258,15 +258,16 @@ namespace mln
be safely ignored.'' */
/* FIXME: This is too long. We shall be able to write
- ima.domain().template nfaces_with_dim<0>()
+ ima.domain().template nfaces_of_static_dim<0>()
or even
- ima.template nfaces_with_dim<0>().
+ ima.template nfaces_of_static_dim<0>().
*/
- ostr << ima.domain().cplx().template nfaces_with_dim<0>() << ' '
- << ima.domain().cplx().template nfaces_with_dim<2>() << ' '
- << ima.domain().cplx().template nfaces_with_dim<1>() << std::endl;
+ ostr << ima.domain().cplx().template nfaces_of_static_dim<0>() << ' '
+ << ima.domain().cplx().template nfaces_of_static_dim<2>() << ' '
+ << ima.domain().cplx().template nfaces_of_static_dim<1>()
+ << std::endl;
/*-------.
| Data. |
diff --git a/milena/mln/topo/attic/faces_iter.hh b/milena/mln/topo/attic/faces_iter.hh
index d46b7ff..18905c9 100644
--- a/milena/mln/topo/attic/faces_iter.hh
+++ b/milena/mln/topo/attic/faces_iter.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -178,7 +178,7 @@ namespace mln
if (is_valid())
{
unsigned face_id = face_.face_id();
- if (face_id + 1 < face_.cplx().template nfaces_with_dim<N>())
+ if (face_id + 1 < face_.cplx().template nfaces_of_static_dim<N>())
/* FIXME: Provide accessor n_face::n() returning
a mutable reference? This way, we could just write
@@ -221,7 +221,7 @@ namespace mln
void
faces_bkd_iter_<N, D>::start()
{
- face_.set_face_id(face_.cplx().template nfaces_with_dim<N>() - 1);
+ face_.set_face_id(face_.cplx().template nfaces_of_static_dim<N>() - 1);
}
template <unsigned N, unsigned D>
diff --git a/milena/mln/topo/complex.hh b/milena/mln/topo/complex.hh
index 3a3e1f0..aa3af72 100644
--- a/milena/mln/topo/complex.hh
+++ b/milena/mln/topo/complex.hh
@@ -130,7 +130,7 @@ namespace mln
/// Return the number of \p N-faces.
template <unsigned N>
- unsigned nfaces_with_dim() const;
+ unsigned nfaces_of_static_dim() const;
/// \}
/// Dynamic manipulators.
@@ -484,7 +484,7 @@ namespace mln
/* FIXME: This is not thread-proof (these two lines should
form an atomic section). */
data_->internal::faces_set_mixin<0u, D>::faces_.push_back(face_data<0u, D>());
- unsigned id = nfaces_with_dim<0u>() - 1;
+ unsigned id = nfaces_of_static_dim<0u>() - 1;
return n_face<0u, D>(*this, id);
}
@@ -510,7 +510,7 @@ namespace mln
/* FIXME: This is not thread-proof (these two lines should
form an atomic section). */
data_->internal::faces_set_mixin<N + 1, D>::faces_.push_back(f);
- unsigned id = nfaces_with_dim<N + 1>() - 1;
+ unsigned id = nfaces_of_static_dim<N + 1>() - 1;
n_face<N + 1, D> fh(*this, id);
// Connect F and its ADJACENT_FACES.
@@ -538,7 +538,7 @@ namespace mln
/// add_size : x, c -> x + c.size()
/// \endcode
///
- /// \see mln::complex<D>::nfaces (static version).
+ /// \see mln::complex<D>::nfaces_of_static_dim<N> (static version).
/// \see mln::complex<D>::fold_left_.
struct add_size
{
@@ -587,7 +587,7 @@ namespace mln
template <unsigned N>
inline
unsigned
- complex<D>::nfaces_with_dim() const
+ complex<D>::nfaces_of_static_dim() const
{
return data_->internal::faces_set_mixin<N, D>::faces_.size();
}
diff --git a/milena/mln/topo/face_iter.hh b/milena/mln/topo/face_iter.hh
index 6a61f75..a1c5514 100644
--- a/milena/mln/topo/face_iter.hh
+++ b/milena/mln/topo/face_iter.hh
@@ -227,7 +227,7 @@ namespace mln
face_bkd_iter<D>::start()
{
f_.set_n(D);
- f_.set_face_id(f_.cplx().template nfaces_with_dim<D>() - 1);
+ f_.set_face_id(f_.cplx().template nfaces_of_static_dim<D>() - 1);
}
template <unsigned D>
diff --git a/milena/mln/topo/n_face.hh b/milena/mln/topo/n_face.hh
index f92e91a..587f92a 100644
--- a/milena/mln/topo/n_face.hh
+++ b/milena/mln/topo/n_face.hh
@@ -1,4 +1,4 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+// Copyright (C) 2008, 2009 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -180,7 +180,7 @@ namespace mln
bool
n_face<N, D>::is_valid() const
{
- return face_id_ < cplx_.template nfaces_with_dim<N>();
+ return face_id_ < cplx_.template nfaces_of_static_dim<N>();
}
template <unsigned N, unsigned D>
diff --git a/milena/mln/topo/static_n_face_iter.hh b/milena/mln/topo/static_n_face_iter.hh
index b8df78d..03dc04c 100644
--- a/milena/mln/topo/static_n_face_iter.hh
+++ b/milena/mln/topo/static_n_face_iter.hh
@@ -180,7 +180,7 @@ namespace mln
{
if (is_valid())
{
- if (f_.face_id() + 1 < f_.cplx().template nfaces_with_dim<N>())
+ if (f_.face_id() + 1 < f_.cplx().template nfaces_of_static_dim<N>())
f_.inc_face_id();
else
invalidate();
@@ -219,7 +219,7 @@ namespace mln
void
static_n_face_bkd_iter<N, D>::start()
{
- f_.set_face_id(f_.cplx().template nfaces_with_dim<N>() - 1);
+ f_.set_face_id(f_.cplx().template nfaces_of_static_dim<N>() - 1);
}
template <unsigned N, unsigned D>
diff --git a/milena/tests/morpho/complex_image_wst.cc b/milena/tests/morpho/complex_image_wst.cc
index c9ebd33..c175001 100644
--- a/milena/tests/morpho/complex_image_wst.cc
+++ b/milena/tests/morpho/complex_image_wst.cc
@@ -236,7 +236,7 @@ int main()
We definitely need a complex_image that can accept a subset of a
complex as domain (or at least a p_face<N, D, P>. */
- wst_val_t actual_nbasins = nbasins - c.nfaces_with_dim<0>();
+ wst_val_t actual_nbasins = nbasins - c.nfaces_of_static_dim<0>();
std::cout << "nbasins = " << actual_nbasins << std::endl;
diff --git a/milena/tests/topo/complex.cc b/milena/tests/topo/complex.cc
index 65a9a71..fa6832d 100644
--- a/milena/tests/topo/complex.cc
+++ b/milena/tests/topo/complex.cc
@@ -101,9 +101,12 @@ int main()
std::cout
<< "Using ``static'' manipulators." << std::endl
- << " number of 0-faces: c.nfaces_with_dim<0>() = " << c.nfaces_with_dim<0>() << std::endl
- << " number of 1-faces: c.nfaces_with_dim<1>() = " << c.nfaces_with_dim<1>() << std::endl
- << " number of 2-faces: c.nfaces_with_dim<2>() = " << c.nfaces_with_dim<2>() << std::endl
+ << " number of 0-faces: c.nfaces_of_static_dim<0>() = "
+ << c.nfaces_of_static_dim<0>() << std::endl
+ << " number of 1-faces: c.nfaces_of_static_dim<1>() = "
+ << c.nfaces_of_static_dim<1>() << std::endl
+ << " number of 2-faces: c.nfaces_of_static_dim<2>() = "
+ << c.nfaces_of_static_dim<2>() << std::endl
<< " total number of faces: c.nfaces() = " << c.nfaces() << std::endl
<< std::endl;
--
1.6.1.2
1
0
08 Jun '09
* mln/topo/complex.hh: Here.
Reported by Thierry Géraud <thierry.geraud(a)lrde.epita.fr>.
---
milena/ChangeLog | 7 +++++++
milena/mln/topo/complex.hh | 8 +-------
2 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index c1687cb..915d95a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,3 +1,10 @@
+2009-06-05 Roland Levillain <roland(a)lrde.epita.fr>
+
+ Typo in the documentation of mln::topo::complex.
+
+ * mln/topo/complex.hh: Here.
+ Reported by Thierry Géraud <thierry.geraud(a)lrde.epita.fr>.
+
2009-06-08 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix some g++-3.3 compilation warnings and errors.
diff --git a/milena/mln/topo/complex.hh b/milena/mln/topo/complex.hh
index a7abf9a..3a3e1f0 100644
--- a/milena/mln/topo/complex.hh
+++ b/milena/mln/topo/complex.hh
@@ -35,12 +35,6 @@
///
/// A complex defines a topological space which can be used as a
/// support for an image (i.e., as site sets).
-///
-/// \todo Roland: Check that the top of the inheritance diagram
-/// is correct; you wrote:
-/// faces_set_mixin<0, D> ---> lower_dim_faces_set_mixin<D, D>
-/// I (theo) think it's:
-/// faces_set_mixin<0, D> ---> lower_dim_faces_set_mixin<0, D>
# include <cstddef>
@@ -246,7 +240,7 @@ namespace mln
\verbatim
- ,-----------> lower_dim_faces_set_mixin<D, D>
+ ,-----------> higher_dim_faces_set_mixin<0, D>
|
faces_set_mixin<0, D>
^
--
1.6.1.2
1
0
08 Jun '09
---
ChangeLog | 4 ++++
configure.ac | 5 -----
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 1ffb7d5..69de0bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-06-09 Roland Levillain <roland(a)lrde.epita.fr>
+
+ * configure.ac (HAVE_SWIG_1_3_39): Remove conditional.
+
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
Improve bootstrap.
diff --git a/configure.ac b/configure.ac
index 50b612b..a72aa27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -169,11 +169,6 @@ AC_CONFIG_SUBDIRS([external/trimesh])
OLN_WITH_SWILENA([enable_swilena=yes], [])
AM_CONDITIONAL([ENABLE_SWILENA], [test x$enable_swilena = xyes])
-AS_VERSION_COMPARE([$swig_version], [1.3.39],
- [have_swig_1_3_39=false],
- [have_swig_1_3_39=true],
- [have_swig_1_3_39=true])
-AM_CONDITIONAL([HAVE_SWIG_1_3_39], [$have_swig_1_3_39])
AC_CONFIG_FILES([swilena/Makefile
swilena/python/Makefile])
--
1.6.1.2
1
0
* python/image2d-misc.py: Always get the domain of an image by
calling it domain() method.
* python/Makefile.am (TESTS): Remove conditional HAVE_SWIG_1_3_39
and always exercise dynamic-image2d-misc.py.
---
swilena/ChangeLog | 9 +++++++++
swilena/python/Makefile.am | 7 +------
swilena/python/image2d-misc.py | 13 +------------
3 files changed, 11 insertions(+), 18 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index c52ff12..95369a7 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,3 +1,12 @@
+2009-06-09 Roland Levillain <roland(a)lrde.epita.fr>
+
+ No longer handle SWIG < 1.3.39 specifically.
+
+ * python/image2d-misc.py: Always get the domain of an image by
+ calling it domain() method.
+ * python/Makefile.am (TESTS): Remove conditional HAVE_SWIG_1_3_39
+ and always exercise dynamic-image2d-misc.py.
+
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
Fix a bug in Swilena's wrapper of box2d.
diff --git a/swilena/python/Makefile.am b/swilena/python/Makefile.am
index 1525d5d..0658ec1 100644
--- a/swilena/python/Makefile.am
+++ b/swilena/python/Makefile.am
@@ -212,11 +212,6 @@ $(srcdir)/run.stamp: $(RUN_IN)
# as `--python' to `run'.
TESTS = \
box2d-misc.py \
- image2d-misc.py morpho-fun.py morpho-segm.py
-
-# Do no exercise tests known to fail with old versions of SWIG.
-if HAVE_SWIG_1_3_39
-TESTS += dynamic-image2d-misc.py
-endif HAVE_SWIG_1_3_39
+ image2d-misc.py morpho-fun.py morpho-segm.py dynamic-image2d-misc.py
EXTRA_DIST += $(TESTS)
diff --git a/swilena/python/image2d-misc.py b/swilena/python/image2d-misc.py
index a7933d1..737b39b 100644
--- a/swilena/python/image2d-misc.py
+++ b/swilena/python/image2d-misc.py
@@ -22,24 +22,13 @@ from swilena import *
ima = image2d_int.image2d_int(3, 3)
image2d_int.fill(ima, 42)
-# FIXME: Help version of SWIG older than 1.3.39. For instance, SWIG
-# 1.3.36 does not generate code smart enough to detect that the output
-# of `ima.domain()' should be a wrapped `box2d'. Help it.
-#
-# We should get rid of this when SWIG 1.3.39 (or greater) is
-# widespread.
-if config.have_swig(0x010339):
- domain = ima.domain()
-else:
- domain = box2d(3, 3)
-
# FIXME: Eventually we'd like to be able to write this:
#
# for p in ima.domain():
# print "ima(" + str(p) + ") = " + ima(p)
#
# as it is generic and way closer to what we do in C++.
-for p in domain:
+for p in ima.domain():
# FIXME: Handling POD types (like int) as value types is not
# transparent: ima(p) returns a pointer to int wrapped in a SWIG
# object, and cannot be easily converted to a Python integer
--
1.6.1.2
1
0
* box2d.i: Include box.ixx earlier than mln/core/alias/box2d.hh to
generate working headers.
---
swilena/ChangeLog | 7 +++++++
swilena/box2d.i | 4 ++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/swilena/ChangeLog b/swilena/ChangeLog
index 1d9abbc..c52ff12 100644
--- a/swilena/ChangeLog
+++ b/swilena/ChangeLog
@@ -1,5 +1,12 @@
2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix a bug in Swilena's wrapper of box2d.
+
+ * box2d.i: Include box.ixx earlier than mln/core/alias/box2d.hh to
+ generate working headers.
+
+2009-06-08 Roland Levillain <roland(a)lrde.epita.fr>
+
Disable test python/dynamic-image2d-misc.py with SWIG < 1.3.39.
* python/Makefile.am (TESTS) [!HAVE_SWIG_1_3_39]: Remove
diff --git a/swilena/box2d.i b/swilena/box2d.i
index f491be1..93b2b51 100644
--- a/swilena/box2d.i
+++ b/swilena/box2d.i
@@ -21,6 +21,8 @@
%module box2d
+%include "box.ixx"
+
%import box2d_piter.i
%{
@@ -29,8 +31,6 @@
%include "mln/core/alias/box2d.hh"
-%include "box.ixx"
-
%extend mln::box< mln::point<mln::grid::square, mln::def::coord> >
{
// Provide a ctor creating an `mln::box2d' from two `int's.
--
1.6.1.2
1
1
https://svn.lrde.epita.fr/svn/oln/trunk/milena
Index: ChangeLog
from Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Fix some g++-3.3 compilation warnings and errors.
* mln/debug/histo.hh (h): Disambiguate type.
* mln/data/sort_psites.hh (to_p_array): Qualify to disambiguate.
* mln/value/shell.hh (operator): Remove inherited cast operator.
* mln/value/glf.hh: Upgrade doc style.
* mln/make/win_chamfer.hh (sqrt): Remove useless cast.
* tests/data/fill_with_image.cc,
* tests/data/transform.cc,
* tests/data/paste.cc (iota): Fix ambiguity; declare then use.
* tests/data/transform.cc: Avoid sqrt.
* tests/data/replace.cc: Layout.
* tests/value/graylevel.cc (test_conversion): Fix ambiguity.
* tests/morpho/graph_image_wst.cc,
* tests/morpho/graph_image_morpho.cc,
* tests/labeling/foreground.cc (mln_VAR): Get rid of it.
* tests/norm/l2.cc (sqrt): Remove useless return cast.
Disambiguate argument.
mln/data/sort_psites.hh | 9 +++++----
mln/debug/histo.hh | 6 +++---
mln/make/win_chamfer.hh | 8 ++++----
mln/value/glf.hh | 10 +++++-----
mln/value/shell.hh | 15 ++++-----------
tests/data/fill_with_image.cc | 11 ++++++-----
tests/data/paste.cc | 6 +++---
tests/data/replace.cc | 1 -
tests/data/transform.cc | 22 +++++++++++-----------
tests/labeling/foreground.cc | 2 +-
tests/morpho/graph_image_morpho.cc | 7 +++----
tests/morpho/graph_image_wst.cc | 4 ++--
tests/norm/l2.cc | 6 +++---
tests/value/graylevel.cc | 23 ++++++++++++-----------
14 files changed, 62 insertions(+), 68 deletions(-)
Index: mln/debug/histo.hh
--- mln/debug/histo.hh (revision 4032)
+++ mln/debug/histo.hh (working copy)
@@ -31,7 +31,7 @@
/// \file mln/debug/histo.hh
///
-/// Save a histogram to a plot data file.
+/// \brief Save a histogram to a plot data file.
///
/// \todo Move to io::histo::save.
@@ -53,7 +53,7 @@
template <typename T>
void
- histo(const histo::array<T>& h, const std::string& filename);
+ histo(const mln::histo::array<T>& h, const std::string& filename);
@@ -61,7 +61,7 @@
template <typename T>
void
- histo(const histo::array<T>& h, const std::string& filename)
+ histo(const mln::histo::array<T>& h, const std::string& filename)
{
std::ofstream file(filename.c_str());
if (! file)
Index: mln/data/sort_psites.hh
--- mln/data/sort_psites.hh (revision 4032)
+++ mln/data/sort_psites.hh (working copy)
@@ -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 Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -30,6 +30,7 @@
# define MLN_LEVEL_SORT_PSITES_HH
/// \file mln/data/sort_psites.hh
+///
/// \brief Sort_Psites the contents of an image into another one.
///
/// \todo Factor code + optimize.
@@ -130,7 +131,7 @@
sort_psites_increasing_(trait::image::quant::any, // general case
const I& input)
{
- p_array<mln_psite(I)> v = convert::to_p_array(input.domain());
+ p_array<mln_psite(I)> v = mln::convert::to_p_array(input.domain());
std::sort(v.hook_std_vector_().begin(), v.hook_std_vector_().end(),
value_psite_less_<I>(input));
return v;
@@ -174,7 +175,7 @@
sort_psites_decreasing_(trait::image::quant::any, // general case
const I& input)
{
- p_array<mln_psite(I)> v = convert::to_p_array(input.domain());
+ p_array<mln_psite(I)> v = mln::convert::to_p_array(input.domain());
std::sort(v.hook_std_vector_().begin(), v.hook_std_vector_().end(),
value_psite_greater_<I>(input));
return v;
Index: mln/value/shell.hh
--- mln/value/shell.hh (revision 4032)
+++ mln/value/shell.hh (working copy)
@@ -29,6 +29,10 @@
#ifndef MLN_CORE_VALUE_SHELL_HH
# define MLN_CORE_VALUE_SHELL_HH
+/// \file mln/core/value/shell.hh
+///
+/// \brief Define a shell type that encloses a value.
+
# include <mln/core/concept/proxy.hh>
# include <mln/core/concept/function.hh>
# include <mln/core/concept/image.hh>
@@ -73,9 +77,6 @@
// Ctor
shell(Image<I> &ima, const mln_site(I) &s);
- // Read
- operator value () const;
-
// Write
value operator=(value);
@@ -113,14 +114,6 @@
{
}
-
- // Read for everyone
- template <typename F, typename I>
- shell<F,I>::operator value() const
- {
- return v_;
- }
-
// Write for everyone
template <typename F, typename I>
typename F::result
Index: mln/value/glf.hh
--- mln/value/glf.hh (revision 4032)
+++ mln/value/glf.hh (working copy)
@@ -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 Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -28,10 +29,9 @@
#ifndef MLN_VALUE_GLF_HH
# define MLN_VALUE_GLF_HH
-/*! \file mln/value/glf.hh
- *
- * \brief Define the alias value::glf.
- */
+/// \file mln/value/glf.hh
+///
+/// \brief Define the alias value::glf.
# include <mln/value/graylevel_f.hh>
Index: mln/make/win_chamfer.hh
--- mln/make/win_chamfer.hh (revision 4032)
+++ mln/make/win_chamfer.hh (working copy)
@@ -1,5 +1,5 @@
-// Copyright (C) 2006, 2008 EPITA Research and Development Laboratory
-// (LRDE)
+// Copyright (C) 2006, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
//
// This file is part of the Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -31,7 +31,7 @@
/// \file mln/make/win_chamfer.hh
///
-/// Routine to create chamfer mln::w_window2d_int.
+/// \brief Routine to create chamfer mln::w_window2d_int.
///
/// \todo Revamp!
@@ -121,7 +121,7 @@
mln::w_window2d_float
mk_chamfer_exact()
{
- float r2 = static_cast<float>(std::sqrt(2.0f));
+ float r2 = std::sqrt(2.0f);
float ws[] = { r2, 1, r2,
1, 0, 0,
0, 0, 0 };
Index: tests/data/fill_with_image.cc
--- tests/data/fill_with_image.cc (revision 4032)
+++ tests/data/fill_with_image.cc (working copy)
@@ -26,9 +26,9 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-/// \file tests/data/fill_with_value.cc
+/// \file tests/data/fill_with_image.cc
///
-/// Tests on mln::data::fill_with_value
+/// \brief Tests on mln::data::fill_with_image.
#include <mln/data/fill_with_value.hh>
#include <mln/data/fill_with_image.hh>
@@ -145,8 +145,8 @@
// pw image test
{
- const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
- make::box2d(-2,-2, 15,15));
+ fun::p2v::iota f;
+ const pw::image<fun::p2v::iota, mln::box2d> ima(f, make::box2d(-2,-2, 15,15));
image2d<short unsigned int> out(8, 8);
data::fill(out, (short unsigned int)0);
@@ -155,7 +155,7 @@
// flat image test
{
- flat_image<short, box2d> ima(5, make::box2d(size, size));
+ flat_image<short, box2d> ima(5, mln::make::box2d(size, size));
image2d<unsigned short> out(size, size);
data::fill_with_value(ima, 51);
@@ -233,4 +233,5 @@
mln_assertion(out == extend_ima);
}
+
}
Index: tests/data/transform.cc
--- tests/data/transform.cc (revision 4032)
+++ tests/data/transform.cc (working copy)
@@ -28,7 +28,7 @@
/// \file tests/data/transform.cc
///
-/// Tests on mln::data::transform.
+/// \brief Tests on mln::data::transform.
#include <cmath>
@@ -83,7 +83,7 @@
box_fwd_piter_<point1d> p(out.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p));
+ mln_assertion(ima(p) == out(p) * out(p));
}
@@ -97,7 +97,7 @@
box_fwd_piter_<point2d> p(out.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p));
+ mln_assertion(ima(p) == out(p) * out(p));
}
/// Another image2d test
@@ -119,13 +119,13 @@
box_fwd_piter_<point3d> p(out.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p));
+ mln_assertion(ima(p) == out(p) * out(p));
}
/// pw image test
{
- const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
- make::box2d(2,2, 5,5));
+ fun::p2v::iota f;
+ const pw::image<fun::p2v::iota, box2d> ima(f, make::box2d(2,2, 5,5));
image2d<unsigned short> out(8, 8);
data::fill(out, (short unsigned int)0);
@@ -142,7 +142,7 @@
box2d::piter p(out.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(ima(p)) == out(p));
+ mln_assertion(ima(p) == out(p) * out(p));
}
// image if test
@@ -159,7 +159,7 @@
II::piter p(ima_if.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(ima_if(p)) == out(p));
+ mln_assertion(ima_if(p) == out(p) * out(p));
}
// cast image test
@@ -179,7 +179,7 @@
II::piter p(cast.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(cast(p)) == out(p));
+ mln_assertion(cast(p) == out(p) * out(p));
}
// sub_image test
@@ -196,7 +196,7 @@
II::piter p(sub_ima.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(sub_ima(p)) == out(p));
+ mln_assertion(sub_ima(p) == out(p) * out(p));
}
// extended image test
@@ -213,6 +213,6 @@
II::piter p(extend_ima.domain());
for_all(p)
- mln_assertion((unsigned short)std::sqrt(extend_ima(p)) == out(p));
+ mln_assertion(extend_ima(p) == out(p) * out(p));
}
}
Index: tests/data/replace.cc
--- tests/data/replace.cc (revision 4032)
+++ tests/data/replace.cc (working copy)
@@ -59,5 +59,4 @@
};
mln_assertion(make::image(vs_ref) == rhs);
-
}
Index: tests/data/paste.cc
--- tests/data/paste.cc (revision 4032)
+++ tests/data/paste.cc (working copy)
@@ -28,7 +28,7 @@
/// \file tests/data/paste.cc
///
-/// Tests on mln::data::paste.
+/// \brief Tests on mln::data::paste.
#include <mln/core/image/image1d.hh>
#include <mln/core/image/image2d.hh>
@@ -109,8 +109,8 @@
/// pw image test
{
- const pw::image<fun::p2v::iota, box2d> ima(fun::p2v::iota(),
- make::box2d(2,2, 5,5));
+ fun::p2v::iota f;
+ const pw::image<fun::p2v::iota, box2d> ima(f, make::box2d(2,2, 5,5));
image2d<short unsigned int> out(8, 8);
data::fill(out, (short unsigned int)0);
Index: tests/value/graylevel.cc
--- tests/value/graylevel.cc (revision 4032)
+++ tests/value/graylevel.cc (working copy)
@@ -28,8 +28,7 @@
/// \file tests/value/graylevel.cc
///
-/// \brief Tests on mln::value::graylevel. Tests operations between
-/// graylevel of different encodings.
+/// \brief Tests on mln::value::graylevel.
#include <mln/value/gl8.hh>
#include <mln/value/gl16.hh>
@@ -58,9 +57,9 @@
#define test_conversion(T1, T2, VAL) \
{ \
- T1(T2(VAL)); \
- T1 test = T2(VAL); \
- test = T2(VAL); \
+ (T1)(T2)(VAL); \
+ T1 test = (T2)(VAL); \
+ test = (T2)(VAL); \
}
int main()
@@ -146,20 +145,22 @@
{
// Conversions.
- test_conversion(gl8, gray_<8>, 255);
+ typedef mln::value::internal::gray_<8> i_gray_8;
+ test_conversion(gl8, i_gray_8, 255);
+
test_conversion(gl8, gray_f, 0.4);
test_conversion(gl8, glf, 0.4);
- test_conversion(glf, gray_<8>, 255);
+ test_conversion(glf, i_gray_8, 255);
test_conversion(glf, gray_f, 0.4);
test_conversion(glf, gl8, 142);
- test_conversion(gray_f, gray_<8>, 4);
+ test_conversion(gray_f, i_gray_8, 4);
test_conversion(glf, gray_f, 0.4);
}
- {
- // FIXME: comparison with literals doesn't work
+// {
+// // FIXME: comparison with literals doesn't work
// c = a;
// mln_assertion(c == white);
@@ -167,7 +168,7 @@
// mln_assertion(c == white);
// c = c / 6;
- }
+// }
// {
// gl8 c = white;
Index: tests/morpho/graph_image_wst.cc
--- tests/morpho/graph_image_wst.cc (revision 4032)
+++ tests/morpho/graph_image_wst.cc (working copy)
@@ -107,11 +107,11 @@
nbh_t nbh;
unsigned nbasins;
- mln_const_VAR(wshed, morpho::meyer_wst(ima, nbh, nbasins));
+ ima_t wshed = morpho::meyer_wst(ima, nbh, nbasins);
std::cout << "nbasins = " << nbasins << std::endl;
// Manual iteration over the domain of WSHED.
- mln_piter_(wshed_t) pw(wshed.domain());
+ mln_piter_(ima_t) pw(wshed.domain());
for_all (pw)
std::cout << "wshed (" << pw << ") = " << wshed(pw) << std::endl;
}
Index: tests/morpho/graph_image_morpho.cc
--- tests/morpho/graph_image_morpho.cc (revision 4032)
+++ tests/morpho/graph_image_morpho.cc (working copy)
@@ -28,7 +28,7 @@
/// \file tests/morpho/graph_image_morpho.cc
///
-/// Tests on mln::graph_image with morphological filters.
+/// \brief Tests on mln::graph_image with morphological filters.
#include <mln/accu/bbox.hh>
#include <mln/core/alias/box2d.hh>
@@ -39,7 +39,6 @@
/// Required for graph images.
#include <mln/core/image/vertex_image.hh>
-#include <mln/core/var.hh>
#include <mln/fun/i2v/array.hh>
#include <mln/util/graph.hh>
#include <mln/make/vertex_image.hh>
@@ -144,11 +143,11 @@
ima_t::win_t win;
- mln_const_VAR(ima_dil, morpho::dilation(ima, win));
+ ima_t ima_dil = morpho::dilation(ima, win);
debug::draw_graph(ima_rep, ima_dil.domain(), pw::cst(9), pw::cst(2));
debug::println(ima_rep);
- mln_const_VAR(ima_ero, morpho::erosion(ima, win));
+ ima_t ima_ero = morpho::erosion(ima, win);
debug::draw_graph(ima_rep, ima_ero.domain(), pw::cst(9), pw::cst(2));
debug::println(ima_rep);
}
Index: tests/norm/l2.cc
--- tests/norm/l2.cc (revision 4032)
+++ tests/norm/l2.cc (working copy)
@@ -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 Milena Library. This library is free
// software; you can redistribute it and/or modify it under the terms
@@ -65,7 +65,7 @@
typedef mln::algebra::vec<3, int> vec_t;
// Reference value.
- float d = float(std::sqrt((4 - 2) * (4 - 2) +
+ float d = std::sqrt(float((4 - 2) * (4 - 2) +
(1 + 2) * (1 + 2) +
(0 - 3) * (0 - 3)));
Index: tests/labeling/foreground.cc
--- tests/labeling/foreground.cc (revision 4032)
+++ tests/labeling/foreground.cc (working copy)
@@ -45,7 +45,7 @@
using namespace mln;
typedef image2d<bool> I;
- mln_VAR(nbh, c4());
+ neighb2d nbh = c4();
I pic = io::pbm::load(MLN_IMG_DIR "/picasso.pbm");
image2d<unsigned> out, ref;
1
0
08 Jun '09
URL: https://svn.lrde.epita.fr/svn/oln/trunk/milena
ChangeLog:
2009-06-08 Edwin Carlinet <carlinet(a)lrde.epita.fr>
Move logical accumulators to their own directory.
* mln/accu/all.hh,
* mln/accu/logic/all.hh:
Update all.hh with respect to new logical accus directory.
* mln/accu/land.hh,
* mln/accu/land_basic.hh,
* mln/accu/lor.hh,
* mln/accu/lor_basic.hh: Move to...
* mln/accu/logic,
* mln/accu/logic/land.hh,
* mln/accu/logic/land_basic.hh
* mln/accu/logic/lor.hh,
* mln/accu/logic/lor_basic.hh:
Move land, land_basic, lor, lor_basic accumulators to logic directory.
* mln/morpho/dilation.hh,
* mln/morpho/erosion.hh,
* sandbox/abraham/mln/morpho/vector_median.hh,
* sandbox/abraham/mln/morpho/vmt.hh,
Replace accu::accu_name by accu::logic::accu_name,
accu::meta::accu_name by accu::meta::logic::accu_name,
accu/accu_name.hh by accu/logic/accu_name.hh,
and update mln_morpho_select_accu call maccro.
---
mln/accu/all.hh | 5
mln/accu/logic/all.hh | 58 +++++++++
mln/accu/logic/land.hh | 179 ++++++++++++++++++++++++++++
mln/accu/logic/land_basic.hh | 177 +++++++++++++++++++++++++++
mln/accu/logic/lor.hh | 179 ++++++++++++++++++++++++++++
mln/accu/logic/lor_basic.hh | 176 +++++++++++++++++++++++++++
mln/morpho/dilation.hh | 14 +-
mln/morpho/erosion.hh | 14 +-
sandbox/abraham/mln/morpho/vector_median.hh | 4
sandbox/abraham/mln/morpho/vmt.hh | 4
10 files changed, 788 insertions(+), 22 deletions(-)
Index: trunk/milena/mln/accu/lor.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/land_basic.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/lor_basic.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/land.hh (deleted)
===================================================================
Index: trunk/milena/mln/accu/logic/all.hh
===================================================================
--- trunk/milena/mln/accu/logic/all.hh (revision 0)
+++ trunk/milena/mln/accu/logic/all.hh (revision 4032)
@@ -0,0 +1,58 @@
+// Copyright (C) 2009 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_ACCU_LOGIC_ALL_HH
+# define MLN_ACCU_LOGIC_ALL_HH
+
+/// \file mln/accu/logic/all.hh
+///
+/// File that includes all logical accumulator types.
+
+
+namespace mln
+{
+ namespace accu
+ {
+ namespace meta
+ {
+ /// Namespace of logical meta-accumulators.
+ namespace logic {}
+ }
+
+ /// Namespace of logical accumulators.
+ namespace logic {}
+
+ }
+}
+
+# include <mln/accu/logic/lor.hh>
+# include <mln/accu/logic/lor_basic.hh>
+# include <mln/accu/logic/land.hh>
+# include <mln/accu/logic/land_basic.hh>
+
+#endif // ! MLN_ACCU_LOGIC_ALL_HH
+
Property changes on: trunk/milena/mln/accu/logic/all.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/logic/lor.hh
===================================================================
--- trunk/milena/mln/accu/logic/lor.hh (revision 0)
+++ trunk/milena/mln/accu/logic/lor.hh (revision 4032)
@@ -0,0 +1,179 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_ACCU_LOGIC_LOR_HH
+# define MLN_ACCU_LOGIC_LOR_HH
+
+/// \file mln/accu/logic/lor.hh
+///
+/// Define a 'logical-or' accumulator.
+///
+/// \todo Have lor be parameterized.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace logic
+ {
+ // Forward declaration.
+ struct lor;
+ }
+
+ namespace meta
+ {
+
+ namespace logic
+ {
+ /// Meta accumulator for lor.
+ struct lor : public Meta_Accumulator< lor >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::logic::lor ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::logic
+ } // end of namespace mln::accu::meta
+
+ namespace logic
+ {
+
+ /// \brief "Logical-or" accumulator.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ struct lor : public mln::accu::internal::base< bool, lor >
+ {
+ typedef bool argument;
+
+ lor();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+
+ void take(const argument& t);
+ void take(const lor& other);
+
+ void untake(const argument& t);
+ void untake(const lor& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ bool to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+ unsigned ntrue_;
+ };
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ lor::lor()
+ {
+ init();
+ }
+
+ inline
+ void
+ lor::init()
+ {
+ ntrue_ = 0;
+ }
+
+ inline
+ void lor::take_as_init_(const argument& t)
+ {
+ ntrue_ = t ? 1 : 0;
+ }
+
+ inline
+ void lor::take(const argument& t)
+ {
+ if (t == true)
+ ++ntrue_;
+ }
+
+ inline
+ void
+ lor::take(const lor& other)
+ {
+ ntrue_ += other.ntrue_;
+ }
+
+ inline
+ void lor::untake(const argument& t)
+ {
+ if (t == true)
+ --ntrue_;
+ }
+
+ inline
+ void
+ lor::untake(const lor& other)
+ {
+ mln_precondition(other.ntrue_ <= ntrue_);
+ ntrue_ -= other.ntrue_;
+ }
+
+ inline
+ bool
+ lor::to_result() const
+ {
+ return ntrue_ != 0;
+ }
+
+ inline
+ bool
+ lor::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::logic
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_LOGIC_LOR_HH
Property changes on: trunk/milena/mln/accu/logic/lor.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/logic/lor_basic.hh
===================================================================
--- trunk/milena/mln/accu/logic/lor_basic.hh (revision 0)
+++ trunk/milena/mln/accu/logic/lor_basic.hh (revision 4032)
@@ -0,0 +1,176 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_ACCU_LOGIC_LOR_BASIC_HH
+# define MLN_ACCU_LOGIC_LOR_BASIC_HH
+
+/// \file mln/accu/logic/lor_basic.hh
+///
+/// Define a basic 'logical-or' accumulator.
+///
+/// \todo Have lor_basic be parameterized.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace logic
+ {
+ // Forward declaration.
+ struct lor_basic;
+ }
+
+ namespace meta
+ {
+
+ namespace logic
+ {
+ /// Meta accumulator for lor_basic.
+ struct lor_basic : public Meta_Accumulator< lor_basic >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::logic::lor_basic ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::logic
+ } // end of namespace mln::accu::meta
+
+
+ namespace logic
+ {
+
+ /// \brief "Logical-or" accumulator class.
+ /// Conversely to accu::logic::lor, this version does not have the 'untake'
+ /// method but features the 'can_stop' method.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ struct lor_basic : public mln::accu::internal::base< bool, lor_basic >
+ {
+ typedef bool argument;
+
+ lor_basic();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+
+ void take(const argument& t);
+ void take(const lor_basic& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ bool to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ /// Test if it is worth for this accumulator to take extra data.
+ /// If the result is already 'true' (because this accumulator
+ /// has already taken a 'true' value), can_stop returns true.
+ bool can_stop() const;
+
+ protected:
+ bool res_;
+ };
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ lor_basic::lor_basic()
+ {
+ init();
+ }
+
+ inline
+ void
+ lor_basic::init()
+ {
+ res_ = false;
+ }
+
+ inline
+ void lor_basic::take_as_init_(const argument& t)
+ {
+ res_ = t;
+ }
+
+ inline
+ void lor_basic::take(const argument& t)
+ {
+ if (res_ == false && t == true)
+ res_ = true;
+ }
+
+ inline
+ void
+ lor_basic::take(const lor_basic& other)
+ {
+ res_ = res_ || other.res_;
+ }
+
+ inline
+ bool
+ lor_basic::to_result() const
+ {
+ return res_;
+ }
+
+ inline
+ bool
+ lor_basic::is_valid() const
+ {
+ return true;
+ }
+
+ inline
+ bool
+ lor_basic::can_stop() const
+ {
+ return res_ == true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::logic
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_LOGIC_LOR_BASIC_HH
Property changes on: trunk/milena/mln/accu/logic/lor_basic.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/logic/land.hh
===================================================================
--- trunk/milena/mln/accu/logic/land.hh (revision 0)
+++ trunk/milena/mln/accu/logic/land.hh (revision 4032)
@@ -0,0 +1,179 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_ACCU_LOGIC_LAND_HH
+# define MLN_ACCU_LOGIC_LAND_HH
+
+/// \file mln/accu/logic/land.hh
+///
+/// Define a 'logical-and' accumulator.
+///
+/// \todo Have land be parameterized.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace logic
+ {
+ // Forward declaration.
+ struct land;
+ }
+
+ namespace meta
+ {
+ namespace logic
+ {
+
+ /// Meta accumulator for land.
+ struct land : public Meta_Accumulator< land >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::logic::land ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::logic
+ } // end of namespace mln::accu::meta
+
+ namespace logic
+ {
+
+ /// \brief "Logical-and" accumulator.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ struct land : public mln::accu::internal::base< bool, land >
+ {
+ typedef bool argument;
+
+ land();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+
+ void take(const argument& t);
+ void take(const land& other);
+
+ void untake(const argument& t);
+ void untake(const land& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ bool to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ protected:
+ unsigned nfalse_;
+ };
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ land::land()
+ {
+ init();
+ }
+
+ inline
+ void
+ land::init()
+ {
+ nfalse_ = 0;
+ }
+
+ inline
+ void land::take_as_init_(const argument& t)
+ {
+ nfalse_ = t ? 0 : 1;
+ }
+
+ inline
+ void land::take(const argument& t)
+ {
+ if (t == false)
+ ++nfalse_;
+ }
+
+ inline
+ void
+ land::take(const land& other)
+ {
+ nfalse_ += other.nfalse_;
+ }
+
+ inline
+ void land::untake(const argument& t)
+ {
+ if (t == false)
+ --nfalse_;
+ }
+
+ inline
+ void
+ land::untake(const land& other)
+ {
+ mln_precondition(other.nfalse_ <= nfalse_);
+ nfalse_ -= other.nfalse_;
+ }
+
+ inline
+ bool
+ land::to_result() const
+ {
+ return nfalse_ == 0;
+ }
+
+ inline
+ bool
+ land::is_valid() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::logic
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+#endif // ! MLN_ACCU_LOGIC_LAND_HH
Property changes on: trunk/milena/mln/accu/logic/land.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/logic/land_basic.hh
===================================================================
--- trunk/milena/mln/accu/logic/land_basic.hh (revision 0)
+++ trunk/milena/mln/accu/logic/land_basic.hh (revision 4032)
@@ -0,0 +1,177 @@
+// Copyright (C) 2007, 2008, 2009 EPITA Research and Development
+// Laboratory (LRDE)
+//
+// This file is part of the Milena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// of the GNU General Public License version 2 as published by the
+// Free Software Foundation.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this library; see the file COPYING. If not, write to
+// the Free Software Foundation, 51 Franklin Street, Fifth Floor,
+// Boston, MA 02111-1307, USA.
+//
+// As a special exception, you may use this file as part of a free
+// software library without restriction. Specifically, if other files
+// instantiate templates or use macros or inline functions from this
+// file, or you compile this file and link it with other files to
+// produce an executable, this file does not by itself cause the
+// resulting executable to be covered by the GNU General Public
+// License. This exception does not however invalidate any other
+// reasons why the executable file might be covered by the GNU General
+// Public License.
+
+#ifndef MLN_ACCU_LOGIC_LAND_BASIC_HH
+# define MLN_ACCU_LOGIC_LAND_BASIC_HH
+
+/// \file mln/accu/logic/land_basic.hh
+///
+/// Define a basic 'logical-and' accumulator.
+///
+/// \todo Have land_basic be parameterized.
+
+# include <mln/core/concept/meta_accumulator.hh>
+# include <mln/accu/internal/base.hh>
+
+
+namespace mln
+{
+
+ namespace accu
+ {
+
+ namespace logic
+ {
+ // Forward declaration.
+ struct land_basic;
+ }
+
+ namespace meta
+ {
+
+ namespace logic
+ {
+
+ /// Meta accumulator for land_basic.
+ struct land_basic : public Meta_Accumulator< land_basic >
+ {
+ template <typename T>
+ struct with
+ {
+ typedef accu::logic::land_basic ret;
+ };
+ };
+
+ } // end of namespace mln::accu::meta::logic
+ } // end of namespace mln::accu::meta
+
+
+ namespace logic
+ {
+
+ /// \brief "Logical-and" accumulator.
+ /// Conversely to accu::logic::land, this version does not have the 'untake'
+ /// method but features the 'can_stop' method.
+ ///
+ /// \ingroup modaccuvalues
+ //
+ struct land_basic : public mln::accu::internal::base< bool, land_basic >
+ {
+ typedef bool argument;
+
+ land_basic();
+
+ /// Manipulators.
+ /// \{
+ void init();
+ void take_as_init_(const argument& t);
+
+ void take(const argument& t);
+ void take(const land_basic& other);
+ /// \}
+
+ /// Get the value of the accumulator.
+ bool to_result() const;
+
+ /// Check whether this accu is able to return a result.
+ /// Always true here.
+ bool is_valid() const;
+
+ /// Test if it is worth for this accumulator to take extra data.
+ /// If the result is already 'false' (because this accumulator
+ /// has already taken a 'false' value), can_stop returns true.
+ bool can_stop() const;
+
+ protected:
+ bool res_;
+ };
+
+# ifndef MLN_INCLUDE_ONLY
+
+ inline
+ land_basic::land_basic()
+ {
+ init();
+ }
+
+ inline
+ void
+ land_basic::init()
+ {
+ res_ = true;
+ }
+
+ inline
+ void land_basic::take_as_init_(const argument& t)
+ {
+ res_ = t;
+ }
+
+ inline
+ void land_basic::take(const argument& t)
+ {
+ if (res_ == true && t == false)
+ res_ = false;
+ }
+
+ inline
+ void
+ land_basic::take(const land_basic& other)
+ {
+ res_ = res_ && other.res_;
+ }
+
+ inline
+ bool
+ land_basic::to_result() const
+ {
+ return res_;
+ }
+
+ inline
+ bool
+ land_basic::is_valid() const
+ {
+ return true;
+ }
+
+ inline
+ bool
+ land_basic::can_stop() const
+ {
+ return res_ == false;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::accu::logic
+ } // end of namespace mln::accu
+} // end of namespace mln
+
+
+#endif // ! MLN_ACCU_LOGIC_LAND_BASIC_HH
Property changes on: trunk/milena/mln/accu/logic/land_basic.hh
___________________________________________________________________
Added: svn:mergeinfo
Index: trunk/milena/mln/accu/all.hh
===================================================================
--- trunk/milena/mln/accu/all.hh (revision 4031)
+++ trunk/milena/mln/accu/all.hh (revision 4032)
@@ -64,11 +64,7 @@
# include <mln/accu/height.hh>
# include <mln/accu/histo.hh>
# include <mln/accu/label_used.hh>
-# include <mln/accu/land.hh>
-# include <mln/accu/land_basic.hh>
# include <mln/accu/line.hh>
-# include <mln/accu/lor.hh>
-# include <mln/accu/lor_basic.hh>
# include <mln/accu/nil.hh>
# include <mln/accu/pair.hh>
# include <mln/accu/rank.hh>
@@ -93,6 +89,7 @@
# include <mln/accu/image/all.hh>
# include <mln/accu/site_set/all.hh>
# include <mln/accu/stat/all.hh>
+# include <mln/accu/logic/all.hh>
#endif // ! MLN_ACCU_ALL_HH
Index: trunk/milena/mln/morpho/erosion.hh
===================================================================
--- trunk/milena/mln/morpho/erosion.hh (revision 4031)
+++ trunk/milena/mln/morpho/erosion.hh (revision 4032)
@@ -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 Milena Library. This library is free
@@ -37,8 +37,8 @@
# include <mln/morpho/general.hh>
# include <mln/morpho/includes.hh>
-# include <mln/accu/land.hh>
-# include <mln/accu/land_basic.hh>
+# include <mln/accu/logic/land.hh>
+# include <mln/accu/logic/land_basic.hh>
# include <mln/accu/stat/min.hh>
# include <mln/accu/stat/min_h.hh>
@@ -61,18 +61,18 @@
{
template <typename I>
- mln_morpho_select_accu(I, land_basic, stat::min)
+ mln_morpho_select_accu(I, logic::land_basic, stat::min)
accu(const Image<I>&) const
{
- mln_morpho_select_accu(I, land_basic, stat::min) tmp;
+ mln_morpho_select_accu(I, logic::land_basic, stat::min) tmp;
return tmp;
}
template <typename I>
- mln_morpho_select_accu(I, land, stat::min_h)
+ mln_morpho_select_accu(I, logic::land, stat::min_h)
accu_incr(const Image<I>&) const
{
- mln_morpho_select_accu(I, land, stat::min_h) tmp;
+ mln_morpho_select_accu(I, logic::land, stat::min_h) tmp;
return tmp;
}
Index: trunk/milena/mln/morpho/dilation.hh
===================================================================
--- trunk/milena/mln/morpho/dilation.hh (revision 4031)
+++ trunk/milena/mln/morpho/dilation.hh (revision 4032)
@@ -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 Milena Library. This library is free
@@ -37,8 +37,8 @@
# include <mln/morpho/includes.hh>
# include <mln/morpho/general.hh>
-# include <mln/accu/lor.hh>
-# include <mln/accu/lor_basic.hh>
+# include <mln/accu/logic/lor.hh>
+# include <mln/accu/logic/lor_basic.hh>
# include <mln/accu/stat/max.hh>
# include <mln/accu/stat/max_h.hh>
@@ -62,18 +62,18 @@
{
template <typename I>
- mln_morpho_select_accu(I, lor_basic, stat::max)
+ mln_morpho_select_accu(I, logic::lor_basic, stat::max)
accu(const Image<I>&) const
{
- mln_morpho_select_accu(I, lor_basic, stat::max) tmp;
+ mln_morpho_select_accu(I, logic::lor_basic, stat::max) tmp;
return tmp;
}
template <typename I>
- mln_morpho_select_accu(I, lor, stat::max_h)
+ mln_morpho_select_accu(I, logic::lor, stat::max_h)
accu_incr(const Image<I>&) const
{
- mln_morpho_select_accu(I, lor, stat::max_h) tmp;
+ mln_morpho_select_accu(I, logic::lor, stat::max_h) tmp;
return tmp;
}
Index: trunk/milena/sandbox/abraham/mln/morpho/vmt.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/vmt.hh (revision 4031)
+++ trunk/milena/sandbox/abraham/mln/morpho/vmt.hh (revision 4032)
@@ -37,8 +37,8 @@
# include <mln/morpho/includes.hh>
# include <mln/morpho/general.hh>
-# include <mln/accu/land.hh>
-# include <mln/accu/land_basic.hh>
+# include <mln/accu/logic/land.hh>
+# include <mln/accu/logic/land_basic.hh>
# include <mln/accu/stat/min.hh>
# include <mln/accu/stat/min_h.hh>
# include <mln/norm/l2.hh>
Index: trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh
===================================================================
--- trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh (revision 4031)
+++ trunk/milena/sandbox/abraham/mln/morpho/vector_median.hh (revision 4032)
@@ -37,8 +37,8 @@
# include <mln/morpho/includes.hh>
# include <mln/morpho/general.hh>
-# include <mln/accu/land.hh>
-# include <mln/accu/land_basic.hh>
+# include <mln/accu/logic/land.hh>
+# include <mln/accu/logic/land_basic.hh>
# include <mln/accu/stat/min.hh>
# include <mln/accu/stat/min_h.hh>
# include <mln/norm/l2.hh>
1
0