* mln/fun/vv2v/sum.hh,
* mln/fun/vvvv2v/sum.hh: New.
---
milena/ChangeLog | 7 +++++++
milena/mln/fun/vv2v/{min.hh => sum.hh} | 20 +++++++++-----------
milena/mln/fun/vvvv2v/{min.hh => sum.hh} | 18 +++++++++---------
3 files changed, 25 insertions(+), 20 deletions(-)
copy milena/mln/fun/vv2v/{min.hh => sum.hh} (78%)
copy milena/mln/fun/vvvv2v/{min.hh => sum.hh} (82%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 574132f..15a9193 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,12 @@
2012-10-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Add sum functions.
+
+ * mln/fun/vv2v/sum.hh,
+ * mln/fun/vvvv2v/sum.hh: New.
+
+2012-10-26 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add kn::border routines working on 2-faces.
* mln/world/kn/border/adjust_duplicate_2_faces.hh,
diff --git a/milena/mln/fun/vv2v/min.hh b/milena/mln/fun/vv2v/sum.hh
similarity index 78%
copy from milena/mln/fun/vv2v/min.hh
copy to milena/mln/fun/vv2v/sum.hh
index d43981f..8279221 100644
--- a/milena/mln/fun/vv2v/min.hh
+++ b/milena/mln/fun/vv2v/sum.hh
@@ -1,5 +1,4 @@
-// Copyright (C) 2008, 2009, 2012 EPITA Research and Development
-// Laboratory (LRDE)
+// Copyright (C) 2012 EPITA Research and Development Laboratory (LRDE)
//
// This file is part of Olena.
//
@@ -24,15 +23,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_FUN_VV2V_MIN_HH
-# define MLN_FUN_VV2V_MIN_HH
+#ifndef MLN_FUN_VV2V_SUM_HH
+# define MLN_FUN_VV2V_SUM_HH
/// \file
///
-/// Functor that computes the minimum of two values.
+/// Functor that computes the sum of two values.
# include <mln/core/concept/function.hh>
-# include <mln/math/min.hh>
namespace mln
@@ -44,9 +42,9 @@ namespace mln
namespace vv2v
{
- /// \brief A functor computing the minimum of two values.
+ /// \brief A functor computing the sum of two values.
template <typename V, typename R = V>
- struct min : public Function_vv2v< min<V,R> >,
+ struct sum : public Function_vv2v< sum<V,R> >,
private mlc_converts_to(R,V)::check_t
{
typedef R result;
@@ -60,9 +58,9 @@ namespace mln
template <typename V, typename R>
inline
R
- min<V,R>::operator()(const V& v1, const V& v2) const
+ sum<V,R>::operator()(const V& v1, const V& v2) const
{
- return R(mln::math::min(v1, v2));
+ return R(v1 + v2);
}
# endif // ! MLN_INCLUDE_ONLY
@@ -74,4 +72,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_FUN_VV2V_MIN_HH
+#endif // ! MLN_FUN_VV2V_SUM_HH
diff --git a/milena/mln/fun/vvvv2v/min.hh b/milena/mln/fun/vvvv2v/sum.hh
similarity index 82%
copy from milena/mln/fun/vvvv2v/min.hh
copy to milena/mln/fun/vvvv2v/sum.hh
index f0c4b63..3455c26 100644
--- a/milena/mln/fun/vvvv2v/min.hh
+++ b/milena/mln/fun/vvvv2v/sum.hh
@@ -23,15 +23,14 @@
// exception does not however invalidate any other reasons why the
// executable file might be covered by the GNU General Public License.
-#ifndef MLN_FUN_VVVV2V_MIN_HH
-# define MLN_FUN_VVVV2V_MIN_HH
+#ifndef MLN_FUN_VVVV2V_SUM_HH
+# define MLN_FUN_VVVV2V_SUM_HH
/// \file
///
-/// Functor that computes the min of two values.
+/// Functor that computes the sum of four values.
# include <mln/core/concept/function.hh>
-# include <mln/math/min.hh>
namespace mln
@@ -45,11 +44,12 @@ namespace mln
// FIXME: Doc.
- /// \brief A functor computing the min of two values.
+ /// \brief A functor computing the sum of two values.
template <typename T, typename R=T>
- struct min : public Function_vvvv2v< min<T> >
+ struct sum : public Function_vvvv2v< sum<T> >
{
typedef R result;
+ typedef T argument;
R operator()(const T& v1, const T& v2, const T& v3, const T& v4) const;
};
@@ -59,9 +59,9 @@ namespace mln
template <typename T, typename R>
inline
R
- min<T,R>::operator()(const T& v1, const T& v2, const T& v3, const
T& v4) const
+ sum<T,R>::operator()(const T& v1, const T& v2, const T& v3, const
T& v4) const
{
- return R(mln::math::min(v1, v2, v3, v4));
+ return R(v1 + v2 + v3 + v4);
}
# endif // ! MLN_INCLUDE_ONLY
@@ -73,4 +73,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_FUN_VVVV2V_MIN_HH
+#endif // ! MLN_FUN_VVVV2V_SUM_HH
--
1.7.2.5