* mln/world/k1/fill_0_from_1_faces.hh,
* mln/world/kn/fill_0_from_2_faces.hh,
* mln/world/kn/fill_2_from_1_faces.hh: Do not use temporary
variable.
* mln/world/kn/border/duplicate_2_faces.hh: Fix a precondition.
---
milena/ChangeLog | 11 +++++++++++
milena/mln/world/k1/fill_0_from_1_faces.hh | 6 ++----
milena/mln/world/kn/border/duplicate_2_faces.hh | 2 +-
milena/mln/world/kn/fill_0_from_2_faces.hh | 7 +++----
milena/mln/world/kn/fill_2_from_1_faces.hh | 7 +++----
5 files changed, 20 insertions(+), 13 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 31adb4c..9393cd2 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Cleanup code.
+
+ * mln/world/k1/fill_0_from_1_faces.hh,
+ * mln/world/kn/fill_0_from_2_faces.hh,
+ * mln/world/kn/fill_2_from_1_faces.hh: Do not use temporary
+ variable.
+
+ * mln/world/kn/border/duplicate_2_faces.hh: Fix a precondition.
+
+2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add kn::border::compute_1_faces.
* mln/world/kn/border/compute_1_faces.hh: New.
diff --git a/milena/mln/world/k1/fill_0_from_1_faces.hh
b/milena/mln/world/k1/fill_0_from_1_faces.hh
index 0568220..c906461 100644
--- a/milena/mln/world/k1/fill_0_from_1_faces.hh
+++ b/milena/mln/world/k1/fill_0_from_1_faces.hh
@@ -35,7 +35,6 @@
# include <mln/world/kn/is_1_face_vertical.hh>
# include <mln/world/kn/is_1_face_horizontal.hh>
-
namespace mln
{
@@ -45,7 +44,7 @@ namespace mln
namespace k1
{
- /*! \brief Fill 1 faces in a K1 2D image using its 2 faces.
+ /*! \brief Fill 0 faces in a K1 2D image using its 1 faces.
\param[in,out] inout A 2D image immersed in K1.
\param[in,out] f A functor computing a result from two values.
@@ -109,8 +108,7 @@ namespace mln
A accu(exact(accu_));
- mln_box(I) b = inout.domain();
- mln_piter(I) p(b);
+ mln_piter(I) p(inout.domain());
for_all(p)
if (kn::is_0_face(p))
{
diff --git a/milena/mln/world/kn/border/duplicate_2_faces.hh
b/milena/mln/world/kn/border/duplicate_2_faces.hh
index 2d1c89f..b8ff7d3 100644
--- a/milena/mln/world/kn/border/duplicate_2_faces.hh
+++ b/milena/mln/world/kn/border/duplicate_2_faces.hh
@@ -69,7 +69,7 @@ namespace mln
trace::entering("mln::world::kn::duplicate_2_faces");
mln_precondition(exact(inout_).is_valid());
- mln_precondition(exact(inout_).border() > 0);
+ mln_precondition(exact(inout_).border() >= 1);
I& inout = exact(inout_);
def::coord
diff --git a/milena/mln/world/kn/fill_0_from_2_faces.hh
b/milena/mln/world/kn/fill_0_from_2_faces.hh
index 798bed3..6e6ee82 100644
--- a/milena/mln/world/kn/fill_0_from_2_faces.hh
+++ b/milena/mln/world/kn/fill_0_from_2_faces.hh
@@ -33,7 +33,6 @@
# include <mln/core/alias/point2d.hh>
# include <mln/world/kn/is_0_face.hh>
-
namespace mln
{
@@ -84,7 +83,8 @@ namespace mln
mln_piter(I) p(inout.domain());
for_all(p)
if (kn::is_0_face(p))
- inout(p) = f(inout(p + up_left), inout(p + up_right), inout(p + down_left), inout(p
+ down_right));
+ inout(p) = f(inout(p + up_left), inout(p + up_right),
+ inout(p + down_left), inout(p + down_right));
trace::exiting("mln::world::kn::fill_0_from_2_faces");
}
@@ -100,8 +100,7 @@ namespace mln
(void) accu_;
A accu = A();
- mln_box(I) b = inout.domain();
- mln_piter(I) p(b);
+ mln_piter(I) p(inout.domain());
for_all(p)
if (kn::is_0_face(p))
{
diff --git a/milena/mln/world/kn/fill_2_from_1_faces.hh
b/milena/mln/world/kn/fill_2_from_1_faces.hh
index f3c7c7e..097e50f 100644
--- a/milena/mln/world/kn/fill_2_from_1_faces.hh
+++ b/milena/mln/world/kn/fill_2_from_1_faces.hh
@@ -33,7 +33,6 @@
# include <mln/core/alias/point2d.hh>
# include <mln/world/kn/is_2_face.hh>
-
namespace mln
{
@@ -84,7 +83,8 @@ namespace mln
mln_piter(I) p(inout.domain());
for_all(p)
if (kn::is_2_face(p))
- inout(p) = f(inout(p + up), inout(p + left), inout(p + right), inout(p + down));
+ inout(p) = f(inout(p + up), inout(p + left),
+ inout(p + right), inout(p + down));
trace::exiting("mln::world::kn::fill_2_from_1_faces");
}
@@ -100,8 +100,7 @@ namespace mln
(void) accu_;
A accu = A();
- mln_box(I) b = inout.domain();
- mln_piter(I) p(b);
+ mln_piter(I) p(inout.domain());
for_all(p)
if (kn::is_2_face(p))
{
--
1.7.2.5
Show replies by date