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
---
ChangeLog | 16 +
milena/mln/core/concept/graph.hh | 2 +-
milena/mln/util/graph.hh | 304 ++++++++++++++++++-
milena/mln/util/internal/graph_base.hh | 326 +++-----------------
milena/mln/util/internal/graph_edge.hh | 50 ++--
milena/mln/util/internal/graph_edge_iter.hh | 10 +-
.../mln/util/internal/graph_edge_nbh_edge_iter.hh | 4 +-
milena/mln/util/internal/graph_vertex.hh | 86 ++++--
milena/mln/util/internal/graph_vertex_iter.hh | 20 +-
.../util/internal/graph_vertex_nbh_edge_iter.hh | 4 +-
.../util/internal/graph_vertex_nbh_vertex_iter.hh | 4 +-
11 files changed, 463 insertions(+), 363 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 5e7c1a2..a01d9c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,21 @@
2008-17-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Use track_ptr in graph.
+ * milena/mln/core/concept/graph.hh,
+ * milena/util/graph.hh,
+ * milena/util/internal/graph_base.hh,
+ * milena/util/internal/graph_edge.hh,
+ * milena/util/internal/graph_edge_iter.hh,
+ * milena/util/internal/graph_edge_nbh_edge_iter.hh,
+ * milena/util/internal/graph_vertex.hh,
+ * milena/util/internal/graph_vertex_iter.hh,
+ * milena/util/internal/graph_vertex_nbh_edge_iter.hh,
+ * milena/util/internal/graph_vertex_nbh_vertex_iter.hh:
+ Share data between graphs.
+ Refactor some parts of the code.
+
+2008-17-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add sample code for the tutorial.
* milena/mln/doc/tutorial/samples/borderthickness-output.tex,
* milena/mln/doc/tutorial/samples/borderthickness.tex,
diff --git a/milena/mln/core/concept/graph.hh b/milena/mln/core/concept/graph.hh
index 36d94c9..c98d9e5 100644
--- a/milena/mln/core/concept/graph.hh
+++ b/milena/mln/core/concept/graph.hh
@@ -67,7 +67,7 @@ namespace mln
typedef bkd_piter;
// Misc.
- void *graph_id() const;
+ const E& graph_id() const;
template<typename G2>
bool is_subgraph_of(const G2& gr) const;
diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh
index b94dabc..765c07c 100644
--- a/milena/mln/util/graph.hh
+++ b/milena/mln/util/graph.hh
@@ -37,23 +37,66 @@
# include <mln/util/internal/graph_vertex_nbh_vertex_iter.hh>
# include <mln/util/internal/graph_vertex_nbh_edge_iter.hh>
# include <mln/util/internal/graph_edge_nbh_edge_iter.hh>
+# include <mln/util/ord_pair.hh>
namespace mln
{
namespace util
{
+ /// Fwd declaration.
+ class graph;
+ }
+
+ namespace internal
+ {
+
+ /// Data structure for \c mln::image2d<T>.
+ template <>
+ struct data<util::graph>
+ {
+ typedef util::graph G;
+ typedef std::vector<std::vector<unsigned> > vertices_t;
+ typedef std::vector<util::ord_pair<unsigned> > edges_t;
+ typedef std::set<util::ord_pair<unsigned> > edges_set_t;
+
+ data();
+ ~data();
+
+ /// The vertices.
+ vertices_t vertices_;
+ /// The edges.
+ edges_t edges_;
+ /// An index of the set of edges, for fast-access purpose.
+ edges_set_t edges_set_;
+ };
+
+ } // end of namespace mln::internal
+
+
+ namespace util
+ {
/// \brief Undirected graph.
class graph : public internal::graph_base<graph>
{
- public:
/// The super class.
typedef internal::graph_base<graph> super;
+ using super::vertex_data_t;
+ using super::edge_data_t;
+
+ public:
+ /// The type of the set of vertices.
+ typedef std::vector<vertex_data_t> vertices_t;
+
+ /// The type of the set of edges.
+ typedef std::vector<edge_data_t> edges_t;
+ /// A set to test the presence of a given edge.
+ typedef std::set<edge_data_t> edges_set_t;
+
/// Iterator types
/// \{
-
/// Vertex iterators
/// \{
typedef mln::internal::vertex_fwd_iterator<graph> vertex_fwd_iter;
@@ -88,13 +131,81 @@ namespace mln
typedef mln::internal::edge_nbh_edge_bkd_iterator<graph> edge_nbh_edge_bkd_iter;
typedef edge_nbh_edge_fwd_iter edge_nbh_edge_iter;
/// \}
+ /// \}
+
+ graph();
+ /// Vertex oriented.
+ /// \{
+ /// Shortcuts factoring the insertion of vertices and edges.
+ /// \{
+ /// \brief Add a vertex.
+ ///
+ /// \return The id of the new vertex.
+ unsigned add_vertex();
+
+ /// Return the vertex whose id is \a v.
+ /// \{
+ vertex_t vertex(unsigned id_v) const;
/// \}
+ /// \brief Return the number of vertices in the graph.
+ size_t v_nmax() const;
+
+ /// Check whether a vertex id \p id_v exists in the graph.
+ bool has_v(unsigned id_v) const;
+
+ /// Return the number of adjacent edges of vertex \p id_v.
+ size_t v_nmax_nbh_edges(unsigned id_v) const;
+
+ /// Returns the \p i th edge adjacent to the vertex \p id_v.
+ unsigned v_ith_nbh_edge(unsigned id_v, unsigned i) const;
+
+ /// Return the number of adjacent vertices of vertex \p id_v.
+ size_t v_nmax_nbh_vertices(unsigned id_v) const;
+
+ /// Returns the \p i th vertex adjacent to the vertex \p id_v.
+ unsigned v_ith_nbh_vertex(unsigned id_v, unsigned i) const;
+ /// \}
+
+
+
+
+ /// Edge oriented.
+ /// \{
+ /// \brief Add an edge.
+ ///
+ /// \return The id of the new edge if it does not exist yet;
+ /// otherwise, return <tt>mln_max(unsigned)</tt>.
+ unsigned add_edge(unsigned id_v1, unsigned id_v2);
+
+ /// Return the edge whose id is \a e.
+ edge_t edge(unsigned e) const;
+
+ /// \brief Return the number of edges in the graph.
+ size_t e_nmax() const;
+
+ /// Return whether \p id_e is in the graph.
+ bool has_e(unsigned id_e) const;
+
+ /// Return the first vertex associated to the edge \p id_e.
+ unsigned v1(unsigned id_e) const;
+
+ /// Return the second vertex associated to edge \p id_e
+ unsigned v2(unsigned id_e) const;
+
+ /// Return the number max of adjacent edge, given an edge \p id_e.
+ size_t e_nmax_nbh_edges(unsigned id_e) const;
+
+ /// Return the \p i th edge adjacent to the edge \p id_e.
+ unsigned e_ith_nbh_edge(unsigned id_e, unsigned i) const;
+
/// Return whether this graph is a subgraph
/// Return always false here.
template <typename G2>
bool is_subgraph_of(const G2& g) const;
+ /// \}
+
};
} // end of namespace mln::util
@@ -107,9 +218,198 @@ namespace mln
namespace mln
{
+ namespace internal
+ {
+
+ inline
+ data<util::graph>::data()
+ {
+ }
+
+ inline
+ data<util::graph>::~data()
+ {
+ }
+
+ } // end of namespace mln::internal
+
namespace util
{
+ inline
+ graph::graph()
+ {
+ this->data_ = new mln::internal::data<util::graph>();
+ }
+
+ /*---------------.
+ | Vertex related |
+ `---------------*/
+
+ inline
+ unsigned
+ graph::add_vertex()
+ {
+ /* FIXME: This is not thread-proof (these two lines should
+ form an atomic section). */
+ data_->vertices_.resize(data_->vertices_.size() + 1);
+
+ return v_nmax() - 1;
+ }
+
+ inline
+ graph::vertex_t
+ graph::vertex(unsigned id_v) const
+ {
+ mln_assertion(has_v(id_v));
+ return vertex_t(*this, id_v);
+ }
+
+
+ inline
+ size_t
+ graph::v_nmax() const
+ {
+ return data_->vertices_.size();
+ }
+
+ inline
+ bool
+ graph::has_v(unsigned id_v) const
+ {
+ return id_v < data_->vertices_.size();
+ }
+
+ inline
+ size_t
+ graph::v_nmax_nbh_edges(unsigned id_v) const
+ {
+ mln_precondition(has_v(id_v));
+ return data_->vertices_[id_v].size();
+ }
+
+ inline
+ unsigned
+ graph::v_ith_nbh_edge(unsigned id_v, unsigned i) const
+ {
+ mln_precondition(has_v(id_v));
+ if (i >= v_nmax_nbh_edges(id_v))
+ return v_nmax();
+ return data_->vertices_[id_v][i];
+ }
+
+ inline
+ size_t
+ graph::v_nmax_nbh_vertices(unsigned id_v) const
+ {
+ mln_precondition(has_v(id_v));
+ return v_nmax_nbh_edges(id_v);
+ }
+
+ inline
+ unsigned
+ graph::v_ith_nbh_vertex(unsigned id_v, unsigned i) const
+ {
+ mln_precondition(has_v(id_v));
+
+ unsigned id_e = v_ith_nbh_edge(id_v, i);
+ return v_other(id_e, id_v);
+ }
+
+
+ /*--------------.
+ | Edges related |
+ `---------------*/
+
+ inline
+ unsigned
+ graph::add_edge(unsigned id_v1, unsigned id_v2)
+ {
+ // Does this edge already exist in the graph?
+ edge_data_t edge(id_v1, id_v2);
+ if (data_->edges_set_.find(edge) != data_->edges_set_.end ())
+ {
+ // Return the erroneous value.
+ return mln_max(unsigned);
+ }
+ else
+ {
+ // Otherwise insert it into the graph.
+ /* FIXME: This is not thread-proof (these two lines should
+ form an atomic section). */
+ data_->edges_.push_back(edge);
+ unsigned id = data_->edges_.size() - 1;
+
+ // Update the set of edges.
+ data_->edges_set_.insert(edge);
+ data_->vertices_[edge.first()].push_back(id);
+ data_->vertices_[edge.second()].push_back(id);
+
+ return id;
+ }
+ }
+
+ inline
+ graph::edge_t
+ graph::edge(unsigned e) const
+ {
+ mln_assertion(e < e_nmax());
+ return edge_t(*this, e);
+ }
+
+ inline
+ size_t
+ graph::e_nmax() const
+ {
+ return data_->edges_.size();
+ }
+
+ inline
+ bool
+ graph::has_e(unsigned id_e) const
+ {
+ return id_e < data_->edges_.size();
+ }
+
+ inline
+ unsigned
+ graph::v1(unsigned id_e) const
+ {
+ mln_precondition(has_e(id_e));
+ return data_->edges_[id_e].first();
+ }
+
+ inline
+ unsigned
+ graph::v2(unsigned id_e) const
+ {
+ mln_precondition(has_e(id_e));
+ return data_->edges_[id_e].second();
+ }
+
+ inline
+ size_t
+ graph::e_nmax_nbh_edges(unsigned id_e) const
+ {
+ mln_precondition(has_e(id_e));
+ return v_nmax_nbh_edges(v1(id_e)) + v_nmax_nbh_edges(v2(id_e));
+ }
+
+ inline
+ unsigned
+ graph::e_ith_nbh_edge(unsigned id_e, unsigned i) const
+ {
+ mln_precondition(has_e(id_e));
+ if (i >= e_nmax_nbh_edges(id_e))
+ return e_nmax();
+
+ unsigned v1_nmax = v_nmax_nbh_edges(v1(id_e));
+ if (i < v1_nmax)
+ return v_ith_nbh_edge(v1(id_e), i);
+ return v_ith_nbh_edge(v2(id_e), i - v1_nmax);
+ }
+
+
template <typename G2>
inline
bool
diff --git a/milena/mln/util/internal/graph_base.hh b/milena/mln/util/internal/graph_base.hh
index 9f2e6e2..d98c6ff 100644
--- a/milena/mln/util/internal/graph_base.hh
+++ b/milena/mln/util/internal/graph_base.hh
@@ -42,12 +42,13 @@
# include <mln/core/concept/object.hh>
# include <mln/core/concept/graph.hh>
# include <mln/core/concept/proxy.hh>
-
-# include <mln/util/ord_pair.hh>
-# include <mln/value/builtin/integers.hh>
+# include <mln/core/internal/data.hh>
# include <mln/util/internal/graph_edge.hh>
# include <mln/util/internal/graph_vertex.hh>
+# include <mln/util/ord_pair.hh>
+# include <mln/util/tracked_ptr.hh>
+
namespace mln
{
@@ -65,21 +66,17 @@ namespace mln
template<typename E>
class graph_base : public Graph<E>
{
+
+ protected:
/// The type of a vertex.
typedef util::vertex<E> vertex_t;
/// Internal vertex data type
typedef std::vector<unsigned> vertex_data_t;
- /// The type of the set of vertices.
- typedef std::vector<vertex_data_t> vertices_t;
/// The type of an edge.
typedef util::edge<E> edge_t;
/// Internal edge data type.
typedef ord_pair<unsigned> edge_data_t;
- /// The type of the set of edges.
- typedef std::vector<edge_data_t> edges_t;
- /// A set to test the presence of a given edge.
- typedef std::set<edge_data_t> edges_set_t;
public:
/// Misc. methods
@@ -88,87 +85,24 @@ namespace mln
const void * const graph_id() const;
/// \}
- /// Vertex and edge oriented methods.
- /// \{
- /// Returns the other adjacent vertex id of a given edge id \p id_e.
- unsigned v_other(unsigned id_e, unsigned id_v) const;
- /// \}
-
-
- /// Vertex oriented.
- /// \{
-
- /// Shortcuts factoring the insertion of vertices and edges.
+ /// Vertex oriented methods
/// \{
- /// \brief Add a vertex.
- ///
- /// \return The id of the new vertex.
- unsigned add_vertex();
-
- /// Return the vertex whose id is \a v.
- /// \{
- vertex_t vertex(unsigned id_v) const;
- /// \}
-
- /// \brief Return the number of vertices in the graph.
- size_t v_nmax() const;
-
/// Check whether a vertex \p v exists in the graph.
bool has(const util::vertex<E>& v) const;
- /// Check whether a vertex id \p id_v exists in the graph.
- bool has_v(unsigned id_v) const;
-
- /// Return the number of adjacent edges of vertex \p id_v.
- size_t v_nmax_nbh_edges(unsigned id_v) const;
-
- /// Returns the \p i th edge adjacent to the vertex \p id_v.
- unsigned v_ith_nbh_edge(unsigned id_v, unsigned i) const;
-
- /// Return the number of adjacent vertices of vertex \p id_v.
- size_t v_nmax_nbh_vertices(unsigned id_v) const;
-
- /// Returns the \p i th vertex adjacent to the vertex \p id_v.
- unsigned v_ith_nbh_vertex(unsigned id_v, unsigned i) const;
-
- /// \}
-
-
- /// Edge oriented.
- /// \{
- /// \brief Add an edge.
- ///
- /// \return The id of the new edge if it does not exist yet;
- /// otherwise, return <tt>mln_max(unsigned)</tt>.
- unsigned add_edge(unsigned id_v1, unsigned id_v2);
/// \}
- /// Return the edge whose id is \a e.
+ /// Edge oriented methods
/// \{
- const edge_t& edge(unsigned e) const;
- /// \}
-
- /// \brief Return the number of edges in the graph.
- size_t e_nmax() const;
-
/// Check whether an edge \p e exists in the graph.
bool has(const util::edge<E>& e) const;
+ /// \}
- /// Return whether \p id_e is in the graph.
- bool has_e(unsigned id_e) const;
-
- /// Return the first vertex associated to the edge \p id_e.
- unsigned v1(unsigned id_e) const;
-
- /// Return the second vertex associated to edge \p id_e
- unsigned v2(unsigned id_e) const;
-
- /// Return the number max of adjacent edge, given an edge \p id_e.
- size_t e_nmax_nbh_edges(unsigned id_e) const;
-
- /// Return the \p i th edge adjacent to the edge \p id_e.
- unsigned e_ith_nbh_edge(unsigned id_e, unsigned i) const;
+ /// Vertex and edge oriented methods.
+ /// \{
+ /// Returns the other adjacent vertex id of a given edge id \p id_e.
+ unsigned v_other(unsigned id_e, unsigned id_v) const;
/// \}
// FIXME: We might want to externalize this in routine of
@@ -182,20 +116,11 @@ namespace mln
protected:
- /// The vertices.
- vertices_t vertices_;
- /// The edges.
- edges_t edges_;
- /// An index of the set of edges, for fast-access purpose.
- edges_set_t edges_set_;
+ /// Internal data, sharable by several graphs.
+ util::tracked_ptr< mln::internal::data<E> > data_;
- /// Construction, assignments and destruction.
- /// \{
+ /// Constructor
graph_base<E>();
- //graph_base<E>(const self_t& rhs);
- //self_t& operator=(const self_t& rhs);
- //~graph_base<E>();
- /// \}
};
@@ -217,7 +142,6 @@ namespace mln
template<typename E>
inline
graph_base<E>::graph_base()
- : vertices_(), edges_(), edges_set_()
{
}
@@ -230,7 +154,7 @@ namespace mln
const void * const
graph_base<E>::graph_id() const
{
- return this;
+ return static_cast<const void * const>(data_.ptr_);
}
/*-------------------------.
@@ -242,15 +166,15 @@ namespace mln
unsigned
graph_base<E>::v_other(unsigned id_e, unsigned id_v) const
{
- mln_precondition(has_e(id_e));
- mln_precondition(has_v(id_v));
- mln_precondition(edges_[id_e].first() == id_v
- || edges_[id_e].second() == id_v);
-
- const edge_data_t& e = edges_[id_e];
- if (e.first() == id_v)
- return e.second();
- return e.first();
+ const E *g = exact(this);
+ mln_precondition(g->has_e(id_e));
+ mln_precondition(g->has_v(id_v));
+ mln_precondition(g->v1(id_e) == id_v
+ || g->v2(id_e) == id_v);
+
+ if (g->v1(id_e) == id_v)
+ return g->v2(id_e);
+ return g->v1(id_e);
}
/*---------------.
@@ -259,201 +183,24 @@ namespace mln
template<typename E>
inline
- unsigned
- graph_base<E>::add_vertex()
- {
- /* FIXME: This is not thread-proof (these two lines should
- form an atomic section). */
- vertices_.resize(vertices_.size() + 1);
-
- return vertices_.size() - 1;
- }
-
- template<typename E>
- inline
- typename graph_base<E>::vertex_t
- graph_base<E>::vertex(unsigned id_v) const
- {
- mln_assertion(has_v(id_v));
-
- return vertex_t(this, id_v);
- }
-
- template<typename E>
- inline
- size_t
- graph_base<E>::v_nmax() const
- {
- return vertices_.size();
- }
-
- template<typename E>
- inline
bool
graph_base<E>::has(const util::vertex<E>& v) const
{
return has_v(v.id());
}
- template<typename E>
- inline
- bool
- graph_base<E>::has_v(unsigned id_v) const
- {
- return id_v < vertices_.size();
- }
-
- template<typename E>
- inline
- size_t
- graph_base<E>::v_nmax_nbh_edges(unsigned id_v) const
- {
- mln_precondition(has_v(id_v));
-
- return vertices_[id_v].size();
- }
-
- template<typename E>
- inline
- unsigned
- graph_base<E>::v_ith_nbh_edge(unsigned id_v, unsigned i) const
- {
- mln_precondition(has_v(id_v));
- if (i >= v_nmax_nbh_edges(id_v))
- return v_nmax();
-
- return vertices_[id_v][i];
- }
-
- template<typename E>
- inline
- size_t
- graph_base<E>::v_nmax_nbh_vertices(unsigned id_v) const
- {
- mln_precondition(has_v(id_v));
- return v_nmax_nbh_edges(id_v);
- }
-
- template<typename E>
- inline
- unsigned
- graph_base<E>::v_ith_nbh_vertex(unsigned id_v, unsigned i) const
- {
- mln_precondition(has_v(id_v));
-
- unsigned id_e = v_ith_nbh_edge(id_v, i);
- return v_other(id_e, id_v);
- }
-
-
/*--------------.
| Edges related |
`---------------*/
template<typename E>
inline
- unsigned
- graph_base<E>::add_edge(unsigned id_v1, unsigned id_v2)
- {
- // Does this edge already exist in the graph?
- edge_data_t edge(id_v1, id_v2);
- if (edges_set_.find(edge) != edges_set_.end ())
- {
- // Return the erroneous value.
- return mln_max(unsigned);
- }
- else
- {
- // Otherwise insert it into the graph.
- /* FIXME: This is not thread-proof (these two lines should
- form an atomic section). */
- edges_.push_back(edge);
- unsigned id = edges_.size() - 1;
-
- // Update the set of edges.
- edges_set_.insert(edge);
- vertices_[edge.first()].push_back(id);
- vertices_[edge.second()].push_back(id);
-
- return id;
- }
- }
-
- template<typename E>
- inline
- const typename graph_base<E>::edge_t&
- graph_base<E>::edge(unsigned e) const
- {
- mln_assertion(e < this->nedges());
- return edge_t(this, edges_[e].first(), edges_[e].second());
- }
-
- template<typename E>
- inline
- size_t
- graph_base<E>::e_nmax() const
- {
- return edges_.size();
- }
-
- template<typename E>
- inline
bool
graph_base<E>::has(const util::edge<E>& e) const
{
return has_e(e.id());
}
- template<typename E>
- inline
- bool
- graph_base<E>::has_e(unsigned id_e) const
- {
- return id_e < edges_.size();
- }
-
- template<typename E>
- inline
- unsigned
- graph_base<E>::v1(unsigned id_e) const
- {
- mln_precondition(has_e(id_e));
- return edges_[id_e].first();
- }
-
- template<typename E>
- inline
- unsigned
- graph_base<E>::v2(unsigned id_e) const
- {
- mln_precondition(has_e(id_e));
- return edges_[id_e].second();
- }
-
- template<typename E>
- inline
- size_t
- graph_base<E>::e_nmax_nbh_edges(unsigned id_e) const
- {
- mln_precondition(has_e(id_e));
- return v_nmax_nbh_edges(v1(id_e)) + v_nmax_nbh_edges(v2(id_e));
- }
-
- template<typename E>
- inline
- unsigned
- graph_base<E>::e_ith_nbh_edge(unsigned id_e, unsigned i) const
- {
- mln_precondition(has_e(id_e));
- if (i >= e_nmax_nbh_edges(id_e))
- return e_nmax();
-
- unsigned v1_nmax = v_nmax_nbh_edges(v1(id_e));
- if (i < v1_nmax)
- return v_ith_nbh_edge(v1(id_e), i);
- return v_ith_nbh_edge(v2(id_e), i - v1_nmax);
- }
-
/*--------.
| Debug. |
`--------*/
@@ -463,26 +210,25 @@ namespace mln
void
graph_base<E>::print_debug (std::ostream& ostr) const
{
+ const E *g = exact(this);
+
ostr << "graph: " << std::endl;
- for (unsigned v = 0; v < vertices_.size(); ++v)
+ for (unsigned v = 0; v < g->v_nmax(); ++v)
{
ostr << "vertex: " << v << std::endl << " -- adjacent vertices: ";
- for (vertex_data_t::const_iterator e =
- vertices_[v].begin(); e != vertices_[v].end();
- ++e)
- if (v == edges_[*e].first())
- ostr << edges_[*e].second() << " ";
- else
- ostr << edges_[*e].first() << " ";
+ for (int n = 0; n < g->v_nmax_nbh_vertices(v); ++n)
+ ostr << g->v_ith_nbh_vertex(v, n) << " ";
ostr << std::endl;
}
ostr << std::endl;
ostr << "edges:" << std::endl;
unsigned ei = 0;
- for (edges_t::const_iterator e = edges_.begin(); e != edges_.end();
- ++e, ++ei)
- ostr << "edge " << ei << ": (" << e->first() << ", " << e->second() << " )" << std::endl;
+ for (int i = 0; i < g->e_nmax(); ++i)
+ ostr << "edge " << i << ": ("
+ << g->v1(i) << ", "
+ << g->v2(i) << " )"
+ << std::endl;
}
} // end of namespace mln::util::internal
diff --git a/milena/mln/util/internal/graph_edge.hh b/milena/mln/util/internal/graph_edge.hh
index d878685..dcbf6ac 100644
--- a/milena/mln/util/internal/graph_edge.hh
+++ b/milena/mln/util/internal/graph_edge.hh
@@ -48,14 +48,14 @@ namespace mln
template <typename G>
class edge : public internal::edge_impl_<G>
{
- typedef mlc_const(G) graph_t;
+ typedef mlc_unconst(G) graph_t;
public:
/// Constructors
/// \{
edge();
- explicit edge(graph_t *g);
- edge(graph_t *g, unsigned id);
+ explicit edge(const graph_t& g);
+ edge(const graph_t& g, unsigned id);
/// \}
@@ -68,8 +68,8 @@ namespace mln
/// Set id_ with \p id;
void update_id(unsigned id);
- /// Return pointer of the graph holding this edge.
- const graph_t * g() const;
+ /// Return a reference to the graph holding this edge.
+ const graph_t& g() const;
/// Set g_ with \p g;
void change_graph(const graph_t& g);
@@ -102,7 +102,7 @@ namespace mln
/// \}
private:
- graph_t * g_;
+ graph_t g_;
unsigned id_;
};
@@ -126,7 +126,7 @@ namespace mln
struct subject_impl< const util::edge<G>, E >
{
unsigned id() const;
- const mlc_const(G) * g() const;
+ const mlc_const(G)& g() const;
unsigned v_other(unsigned id_v) const;
bool is_valid() const;
unsigned v1() const;
@@ -172,17 +172,17 @@ namespace mln
template <typename G>
inline
- edge<G>::edge(graph_t *g)
- : g_(g), id_(g->e_nmax())
+ edge<G>::edge(const graph_t& g)
+ : g_(g), id_(g.e_nmax())
{
}
template <typename G>
inline
- edge<G>::edge(graph_t *g, unsigned id)
+ edge<G>::edge(const graph_t& g, unsigned id)
: g_(g), id_(id)
{
- mln_precondition(g->has_e(id));
+ mln_precondition(g.has_e(id));
}
template <typename G>
@@ -203,7 +203,7 @@ namespace mln
template <typename G>
inline
- const typename edge<G>::graph_t *
+ const typename edge<G>::graph_t&
edge<G>::g() const
{
return g_;
@@ -214,7 +214,7 @@ namespace mln
void
edge<G>::change_graph(const graph_t& g)
{
- g_ = & g;
+ g_ = g;
}
template <typename G>
@@ -223,7 +223,7 @@ namespace mln
edge<G>::v_other(unsigned id_v) const
{
mln_precondition(v1() == id_v || v2() == id_v);
- return g_->v_other(id_, id_v);
+ return g_.v_other(id_, id_v);
}
template <typename G>
@@ -231,7 +231,7 @@ namespace mln
bool
edge<G>::is_valid() const
{
- return g_ != 0 && g_->has_e(id_);
+ return g_.has_e(id_);
}
template <typename G>
@@ -239,8 +239,8 @@ namespace mln
unsigned
edge<G>::v1() const
{
- mln_precondition(g_->has_e(id_));
- return g_->v1(id_);
+ mln_precondition(g_.has_e(id_));
+ return g_.v1(id_);
}
template <typename G>
@@ -248,8 +248,8 @@ namespace mln
unsigned
edge<G>::v2() const
{
- mln_precondition(g_->has_e(id_));
- return g_->v2(id_);
+ mln_precondition(g_.has_e(id_));
+ return g_.v2(id_);
}
template <typename G>
@@ -257,8 +257,8 @@ namespace mln
size_t
edge<G>::nmax_nbh_edges() const
{
- mln_precondition(g_->has_e(id_));
- return g_->e_nmax_nbh_edges(id_);
+ mln_precondition(g_.has_e(id_));
+ return g_.e_nmax_nbh_edges(id_);
}
template <typename G>
@@ -266,8 +266,8 @@ namespace mln
unsigned
edge<G>::ith_nbh_edge(unsigned i) const
{
- mln_precondition(g_->has_e(id_));
- return g_->e_ith_nbh_edge(id_, i);
+ mln_precondition(g_.has_e(id_));
+ return g_.e_ith_nbh_edge(id_, i);
}
@@ -315,7 +315,7 @@ namespace mln
template <typename G, typename E>
inline
- const mlc_const(G) *
+ const mlc_const(G)&
subject_impl< const util::edge<G>, E >::g() const
{
return exact_().get_subject().g();
@@ -387,7 +387,7 @@ namespace mln
void
subject_impl< util::edge<G>, E >::change_graph(const mlc_const(G)& g)
{
- return exact_().get_subject().change_graph(&g);
+ return exact_().get_subject().change_graph(g);
}
} // End of namespace mln::internal
diff --git a/milena/mln/util/internal/graph_edge_iter.hh b/milena/mln/util/internal/graph_edge_iter.hh
index 9bcf9ff..b3d83de 100644
--- a/milena/mln/util/internal/graph_edge_iter.hh
+++ b/milena/mln/util/internal/graph_edge_iter.hh
@@ -142,7 +142,7 @@ namespace mln
template <typename G>
inline
edge_fwd_iterator<G>::edge_fwd_iterator(const G& g)
- : e_(util::edge<G>(&g))
+ : e_(util::edge<G>(g))
{
invalidate();
}
@@ -160,7 +160,7 @@ namespace mln
void
edge_fwd_iterator<G>::invalidate()
{
- e_.update_id(e_.g()->e_nmax());
+ e_.update_id(e_.g().e_nmax());
}
template <typename G>
@@ -210,7 +210,7 @@ namespace mln
template <typename G>
inline
edge_bkd_iterator<G>::edge_bkd_iterator(const G& g)
- : e_(util::edge<G>(&g))
+ : e_(util::edge<G>(g))
{
invalidate();
}
@@ -228,7 +228,7 @@ namespace mln
void
edge_bkd_iterator<G>::invalidate()
{
- e_.update_id(e_.g()->e_nmax());
+ e_.update_id(e_.g().e_nmax());
}
template <typename G>
@@ -236,7 +236,7 @@ namespace mln
void
edge_bkd_iterator<G>::start()
{
- e_.update_id(e_.g()->e_nmax() - 1);
+ e_.update_id(e_.g().e_nmax() - 1);
}
template <typename G>
diff --git a/milena/mln/util/internal/graph_edge_nbh_edge_iter.hh b/milena/mln/util/internal/graph_edge_nbh_edge_iter.hh
index 084ad23..3ba8d0e 100644
--- a/milena/mln/util/internal/graph_edge_nbh_edge_iter.hh
+++ b/milena/mln/util/internal/graph_edge_nbh_edge_iter.hh
@@ -158,7 +158,7 @@ namespace mln
void
edge_nbh_edge_fwd_iterator<G>::invalidate()
{
- i_ = e_.g()->e_nmax();
+ i_ = e_.g().e_nmax();
}
template <typename G>
@@ -256,7 +256,7 @@ namespace mln
void
edge_nbh_edge_bkd_iterator<G>::invalidate()
{
- i_ = e_.g()->e_nmax();
+ i_ = e_.g().e_nmax();
}
template <typename G>
diff --git a/milena/mln/util/internal/graph_vertex.hh b/milena/mln/util/internal/graph_vertex.hh
index 8d35282..61b589f 100644
--- a/milena/mln/util/internal/graph_vertex.hh
+++ b/milena/mln/util/internal/graph_vertex.hh
@@ -43,15 +43,15 @@ namespace mln
template<typename G>
class vertex : public internal::vertex_impl_<G>
{
- typedef mlc_const(G) graph_t;
+ typedef mlc_unconst(G) graph_t;
public:
/// Constructors.
/// \{
vertex();
- explicit vertex(graph_t *g);
- vertex(graph_t *g, unsigned id);
+ explicit vertex(const graph_t& g);
+ vertex(const graph_t& g, unsigned id);
/// \}
/// Check whether the vertex is still part of the graph.
@@ -82,16 +82,26 @@ namespace mln
void update_id(unsigned id);
/// Returns the graph pointer this vertex belongs to.
- const graph_t * g() const;
+ const graph_t& g() const;
/// Returns vertex id.
unsigned id() const;
- private:
- graph_t * g_;
+ protected:
+ graph_t g_;
unsigned id_;
};
+ /// Comparison operator. Test whether two vertices have the same id.
+ template<typename G>
+ bool
+ operator==(const util::vertex<G>& v1, const util::vertex<G>& v2);
+
+ /// Inferior operator. Test whether lhs.id() < rhs.id().
+ template<typename G>
+ bool
+ operator<(const util::vertex<G>& lhs, const util::vertex<G>& rhs);
+
} // End of namespace mln::util
@@ -103,7 +113,7 @@ namespace mln
struct subject_impl< const util::vertex<G>, E >
{
bool is_valid() const;
- const mlc_const(G) * g() const;
+ const mlc_const(G)& g() const;
unsigned id() const;
unsigned other(unsigned id_e) const;
@@ -142,26 +152,44 @@ namespace mln
namespace util
{
+ template<typename G>
+ inline
+ bool
+ operator==(const util::vertex<G>& v1, const util::vertex<G>& v2)
+ {
+ return v1.id() == v2.id();
+ }
+
+ template<typename G>
+ inline
+ bool
+ operator<(const util::vertex<G>& lhs, const util::vertex<G>& rhs)
+ {
+ return lhs.id() < rhs.id();
+ }
+
+
+
template <typename G>
inline
vertex<G>::vertex()
- : g_(0), id_(0)
+ : id_(0)
{
}
template <typename G>
inline
- vertex<G>::vertex(graph_t *g)
- : g_(g), id_(g_->v_nmax())
+ vertex<G>::vertex(const graph_t& g)
+ : g_(g), id_(g_.v_nmax())
{
}
template<typename G>
inline
- vertex<G>::vertex(graph_t *g, unsigned id)
+ vertex<G>::vertex(const graph_t& g, unsigned id)
: g_(g), id_(id)
{
- mln_precondition(g_->has_v(id));
+ mln_precondition(g_.has_v(id));
}
template<typename G>
@@ -169,7 +197,7 @@ namespace mln
bool
vertex<G>::is_valid() const
{
- return g_ != 0 && g_->has_v(id_);
+ return g_.has_v(id_);
}
template<typename G>
@@ -177,7 +205,7 @@ namespace mln
void
vertex<G>::invalidate()
{
- id_ = g_->v_nmax();
+ id_ = g_.v_nmax();
}
@@ -186,10 +214,10 @@ namespace mln
unsigned
vertex<G>::other(unsigned id_e) const
{
- mln_precondition(g_->has_v(id_));
- mln_precondition(g_->has_e(id_e));
- mln_precondition(g_->v1(id_e) == id_ || g_->v2(id_e) == id_);
- return g_->v_other(id_e, id_);
+ mln_precondition(g_.has_v(id_));
+ mln_precondition(g_.has_e(id_e));
+ mln_precondition(g_.v1(id_e) == id_ || g_.v2(id_e) == id_);
+ return g_.v_other(id_e, id_);
}
template<typename G>
@@ -197,8 +225,8 @@ namespace mln
unsigned
vertex<G>::ith_nbh_edge(unsigned i) const
{
- mln_precondition(g_->has_v(id_));
- return g_->v_ith_nbh_edge(id_, i);
+ mln_precondition(g_.has_v(id_));
+ return g_.v_ith_nbh_edge(id_, i);
}
template<typename G>
@@ -206,8 +234,8 @@ namespace mln
unsigned
vertex<G>::nmax_nbh_edges() const
{
- mln_precondition(g_->has_v(id_));
- return g_->v_nmax_nbh_edges(id_);
+ mln_precondition(g_.has_v(id_));
+ return g_.v_nmax_nbh_edges(id_);
}
template<typename G>
@@ -215,8 +243,8 @@ namespace mln
unsigned
vertex<G>::ith_nbh_vertex(unsigned i) const
{
- mln_precondition(g_->has_v(id_));
- return g_->v_ith_nbh_vertex(id_, i);
+ mln_precondition(g_.has_v(id_));
+ return g_.v_ith_nbh_vertex(id_, i);
}
template<typename G>
@@ -224,8 +252,8 @@ namespace mln
unsigned
vertex<G>::nmax_nbh_vertices() const
{
- mln_precondition(g_->has_v(id_));
- return g_->v_nmax_nbh_vertices(id_);
+ mln_precondition(g_.has_v(id_));
+ return g_.v_nmax_nbh_vertices(id_);
}
template<typename G>
@@ -233,7 +261,7 @@ namespace mln
void
vertex<G>::change_graph(const G& g)
{
- g_ = &g;
+ g_ = g;
}
template<typename G>
@@ -246,7 +274,7 @@ namespace mln
template<typename G>
inline
- const typename vertex<G>::graph_t *
+ const typename vertex<G>::graph_t&
vertex<G>::g() const
{
return g_;
@@ -283,7 +311,7 @@ namespace mln
template <typename G, typename E>
inline
- const mlc_const(G)*
+ const mlc_const(G)&
subject_impl< const util::vertex<G>, E >::g() const
{
return exact_().get_subject().g();
diff --git a/milena/mln/util/internal/graph_vertex_iter.hh b/milena/mln/util/internal/graph_vertex_iter.hh
index da564e7..d77611f 100644
--- a/milena/mln/util/internal/graph_vertex_iter.hh
+++ b/milena/mln/util/internal/graph_vertex_iter.hh
@@ -108,6 +108,8 @@ namespace mln
/// Go to the next value.
void next();
+ void update_graph(const G& g);
+
/// Return current index
unsigned index() const;
/// \}
@@ -156,7 +158,7 @@ namespace mln
void
vertex_fwd_iterator<G>::invalidate()
{
- v_.update_id(v_.g()->v_nmax());
+ v_.update_id(v_.g().v_nmax());
}
template<typename G>
@@ -180,7 +182,7 @@ namespace mln
void
vertex_fwd_iterator<G>::update_graph(const G& g)
{
- v_ = util::vertex<G>(&g);
+ v_ = util::vertex<G>(g);
}
template<typename G>
@@ -213,8 +215,8 @@ namespace mln
template<typename G>
inline
vertex_bkd_iterator<G>::vertex_bkd_iterator(const G& g)
- : v_(util::vertex<G>(&g))
{
+ update_graph(g);
invalidate();
}
@@ -231,7 +233,7 @@ namespace mln
void
vertex_bkd_iterator<G>::invalidate()
{
- v_.update_id(v_.g()->v_nmax());
+ v_.update_id(v_.g().v_nmax());
}
template<typename G>
@@ -239,7 +241,7 @@ namespace mln
void
vertex_bkd_iterator<G>::start()
{
- v_.update_id(v_.g()->v_nmax() - 1);
+ v_.update_id(v_.g().v_nmax() - 1);
}
template<typename G>
@@ -252,6 +254,14 @@ namespace mln
template<typename G>
inline
+ void
+ vertex_bkd_iterator<G>::update_graph(const G& g)
+ {
+ v_ = util::vertex<G>(g);
+ }
+
+ template<typename G>
+ inline
unsigned
vertex_bkd_iterator<G>::index() const
{
diff --git a/milena/mln/util/internal/graph_vertex_nbh_edge_iter.hh b/milena/mln/util/internal/graph_vertex_nbh_edge_iter.hh
index 4edc652..634dc07 100644
--- a/milena/mln/util/internal/graph_vertex_nbh_edge_iter.hh
+++ b/milena/mln/util/internal/graph_vertex_nbh_edge_iter.hh
@@ -157,7 +157,7 @@ namespace mln
void
vertex_nbh_edge_fwd_iterator<G>::invalidate()
{
- i_ = e_.g()->e_nmax();
+ i_ = e_.g().e_nmax();
}
template <typename G>
@@ -249,7 +249,7 @@ namespace mln
void
vertex_nbh_edge_bkd_iterator<G>::invalidate()
{
- e_.update_id(e_.g()->e_nmax());
+ e_.update_id(e_.g().e_nmax());
}
template <typename G>
diff --git a/milena/mln/util/internal/graph_vertex_nbh_vertex_iter.hh b/milena/mln/util/internal/graph_vertex_nbh_vertex_iter.hh
index d51bc29..0dc87b5 100644
--- a/milena/mln/util/internal/graph_vertex_nbh_vertex_iter.hh
+++ b/milena/mln/util/internal/graph_vertex_nbh_vertex_iter.hh
@@ -158,7 +158,7 @@ namespace mln
void
vertex_nbh_vertex_fwd_iterator<G>::invalidate()
{
- i_ = v_.g()->v_nmax();
+ i_ = v_.g().v_nmax();
}
template <typename G>
@@ -248,7 +248,7 @@ namespace mln
void
vertex_nbh_vertex_bkd_iterator<G>::invalidate()
{
- v_.update_id(v_.g()->e_nmax());
+ v_.update_id(v_.g().e_nmax());
}
template <typename G>
--
1.5.6.5
1
0
---
ChangeLog | 19 +++++++++++++++++++
.../tutorial/samples/borderthickness-output.tex | 13 +++++++++++++
milena/doc/tutorial/samples/borderthickness.tex | 8 ++++++++
milena/doc/tutorial/samples/extension-ignore.tex | 1 +
milena/doc/tutorial/samples/extension-ignore2.tex | 1 +
milena/doc/tutorial/samples/ima-load.tex | 6 ++++++
milena/doc/tutorial/samples/ima-save.tex | 9 +++++++++
milena/doc/tutorial/samples/ima-size-output.tex | 1 +
milena/doc/tutorial/samples/ima-size.tex | 11 +++++++++++
milena/doc/tutorial/samples/ima2d-1-output.tex | 2 ++
milena/doc/tutorial/samples/ima2d-3-output.tex | 6 ++++++
.../doc/tutorial/samples/paste-call-1-output.tex | 3 +++
milena/doc/tutorial/samples/point-1-output.tex | 2 ++
milena/doc/tutorial/tutorial.tex | 1 +
14 files changed, 83 insertions(+), 0 deletions(-)
create mode 100644 milena/doc/tutorial/samples/borderthickness-output.tex
create mode 100644 milena/doc/tutorial/samples/borderthickness.tex
create mode 100644 milena/doc/tutorial/samples/extension-ignore.tex
create mode 100644 milena/doc/tutorial/samples/extension-ignore2.tex
create mode 100644 milena/doc/tutorial/samples/ima-load.tex
create mode 100644 milena/doc/tutorial/samples/ima-save.tex
create mode 100644 milena/doc/tutorial/samples/ima-size-output.tex
create mode 100644 milena/doc/tutorial/samples/ima-size.tex
create mode 100644 milena/doc/tutorial/samples/ima2d-1-output.tex
create mode 100644 milena/doc/tutorial/samples/ima2d-3-output.tex
create mode 100644 milena/doc/tutorial/samples/paste-call-1-output.tex
create mode 100644 milena/doc/tutorial/samples/point-1-output.tex
diff --git a/ChangeLog b/ChangeLog
index a94185c..5e7c1a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2008-17-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Add sample code for the tutorial.
+ * milena/mln/doc/tutorial/samples/borderthickness-output.tex,
+ * milena/mln/doc/tutorial/samples/borderthickness.tex,
+ * milena/mln/doc/tutorial/samples/extension-ignore.tex,
+ * milena/mln/doc/tutorial/samples/extension-ignore2.tex,
+ * milena/mln/doc/tutorial/samples/ima-load.tex,
+ * milena/mln/doc/tutorial/samples/ima-save.tex,
+ * milena/mln/doc/tutorial/samples/ima-size-output.tex,
+ * milena/mln/doc/tutorial/samples/ima-size.tex,
+ * milena/mln/doc/tutorial/samples/ima2d-1-output.tex,
+ * milena/mln/doc/tutorial/samples/ima2d-3-output.tex,
+ * milena/mln/doc/tutorial/samples/paste-call-1-output.tex,
+ * milena/mln/doc/tutorial/samples/point-1-output.tex,
+ * milena/mln/doc/tutorial/tutorial.tex:
+ Add these sample codes for the tutorial.
+
+
2008-10-15 Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac: Configure milena/tests/io/off/Makefile.
diff --git a/milena/doc/tutorial/samples/borderthickness-output.tex b/milena/doc/tutorial/samples/borderthickness-output.tex
new file mode 100644
index 0000000..e1db166
--- /dev/null
+++ b/milena/doc/tutorial/samples/borderthickness-output.tex
@@ -0,0 +1,13 @@
+ima_def - border = 3
+- - - - - - - -
+- - - - - - - -
+- - - - - - - -
+- - - - | - - -
+- - - | - - - -
+- - - - - - - -
+- - - - - - - -
+- - - - - - - -
+
+ima_bt0 - border = 0
+- |
+| -
diff --git a/milena/doc/tutorial/samples/borderthickness.tex b/milena/doc/tutorial/samples/borderthickness.tex
new file mode 100644
index 0000000..d491f16
--- /dev/null
+++ b/milena/doc/tutorial/samples/borderthickness.tex
@@ -0,0 +1,8 @@
+bool vals[2][2] = { {0, 1},
+ {1, 0} };
+image2d<bool> ima_def = make::image2d(vals);
+display::format(ima_def);
+
+border::thickness = 0;
+image2d<bool> ima_bt0 = make::image2d(vals);
+display::format(ima_bt0);
diff --git a/milena/doc/tutorial/samples/extension-ignore.tex b/milena/doc/tutorial/samples/extension-ignore.tex
new file mode 100644
index 0000000..a8d0be5
--- /dev/null
+++ b/milena/doc/tutorial/samples/extension-ignore.tex
@@ -0,0 +1 @@
+my_routine(ima | ima.domain());
diff --git a/milena/doc/tutorial/samples/extension-ignore2.tex b/milena/doc/tutorial/samples/extension-ignore2.tex
new file mode 100644
index 0000000..7e7ef54
--- /dev/null
+++ b/milena/doc/tutorial/samples/extension-ignore2.tex
@@ -0,0 +1 @@
+my_routine(ima.domain());
diff --git a/milena/doc/tutorial/samples/ima-load.tex b/milena/doc/tutorial/samples/ima-load.tex
new file mode 100644
index 0000000..e4a68ee
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima-load.tex
@@ -0,0 +1,6 @@
+# include <mln/core/io/pbm/load.hh>
+int main()
+{
+ mln::image2d<bool> ima;
+ io::pbm::load(ima, "my_image.pbm");
+}
diff --git a/milena/doc/tutorial/samples/ima-save.tex b/milena/doc/tutorial/samples/ima-save.tex
new file mode 100644
index 0000000..47086e2
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima-save.tex
@@ -0,0 +1,9 @@
+# include <mln/core/io/pgm/save.hh>
+int main()
+{
+ mln::image2d<mln::value::int_u8> ima;
+
+ // ...
+
+ io::pgm::save(ima, "my_image.pgm");
+}
diff --git a/milena/doc/tutorial/samples/ima-size-output.tex b/milena/doc/tutorial/samples/ima-size-output.tex
new file mode 100644
index 0000000..6be445f
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima-size-output.tex
@@ -0,0 +1 @@
+nrows = 10 - ncols = 12
diff --git a/milena/doc/tutorial/samples/ima-size.tex b/milena/doc/tutorial/samples/ima-size.tex
new file mode 100644
index 0000000..46d5a08
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima-size.tex
@@ -0,0 +1,11 @@
+#include <core/image/image2d.hh>
+#include <core/site_set/box2d.hh>
+int main()
+{
+ mln::image2d<int> ima(box2d(0,0, 10,12));
+
+ std::cout << "nrows = " << ima.nrows()
+ << " - "
+ << "ncols = " << ima.ncols()
+ << std::endl;
+}
diff --git a/milena/doc/tutorial/samples/ima2d-1-output.tex b/milena/doc/tutorial/samples/ima2d-1-output.tex
new file mode 100644
index 0000000..e689fa5
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-1-output.tex
@@ -0,0 +1,2 @@
+b = [(-2,3)...(3,-5)]
+domain = [(-2,3)...(3,-5)]
diff --git a/milena/doc/tutorial/samples/ima2d-3-output.tex b/milena/doc/tutorial/samples/ima2d-3-output.tex
new file mode 100644
index 0000000..096ef4f
--- /dev/null
+++ b/milena/doc/tutorial/samples/ima2d-3-output.tex
@@ -0,0 +1,6 @@
+ima.at(1,2) = 9
+ima(p) = 9
+---
+ima.at(1,2) = 2
+ima(p) = 2
+
diff --git a/milena/doc/tutorial/samples/paste-call-1-output.tex b/milena/doc/tutorial/samples/paste-call-1-output.tex
new file mode 100644
index 0000000..987bf30
--- /dev/null
+++ b/milena/doc/tutorial/samples/paste-call-1-output.tex
@@ -0,0 +1,3 @@
+b b b b
+b b b b
+b b b b
diff --git a/milena/doc/tutorial/samples/point-1-output.tex b/milena/doc/tutorial/samples/point-1-output.tex
new file mode 100644
index 0000000..d5a3da6
--- /dev/null
+++ b/milena/doc/tutorial/samples/point-1-output.tex
@@ -0,0 +1,2 @@
+has(p1)? true
+has(p2)? false
diff --git a/milena/doc/tutorial/tutorial.tex b/milena/doc/tutorial/tutorial.tex
index f675045..2e7ddfe 100644
--- a/milena/doc/tutorial/tutorial.tex
+++ b/milena/doc/tutorial/tutorial.tex
@@ -80,6 +80,7 @@ showstringspaces=false,linewidth=14cm}
- \backslash subpage winneigh
- \backslash subpage sitesandco
- \backslash subpage iterators
+- \backslash subpage imamemmgmt
- \backslash subpage basicops
- \backslash subpage graphes
\backslash htmlonly
--
1.5.6.5
1
0
From: Maxime van Noppen <yabo(a)lrde.epita.fr>
To: transformers-patches(a)lrde.epita.fr, olena-patches(a)lrde.epita.fr
Subject: scool r121: Add the 'mutable' keyword
URL: https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-10-17 Maxime van Noppen <yabo(a)lrde.epita.fr>
Add the 'mutable' keyword.
* pp-cxx/CxxFun.str: Pretty-print the 'const' keyword when it is
* present.
* cxx-syn/CxxFun.sdf: Add the 'const-method' production.
* scl-syn/Expression.sdf: Use the C++ semantic regarding '=' and
* '=='.
* scoolt/Class.str: Add a dynamic-rule system to scope translations
* of declarations so that it is possible to detect wether the
* translation takes place or not inside a class context.
* scoolt/Declaration.str: Handle function modifiers.
* scoolt/Expression.str: Handle the Assign constructor.
* scoolt/Function.str: Don't add the 'const' keywords when either
* the method is mutable or that it is a function and not a method.
* scoolt/Program.str: Initialize the dynamic rule system for scoped
* translation rules.
---
cxx-syn/CxxFun.sdf | 7 +++++++
pp-cxx/CxxFun.str | 14 ++++++++++----
scl-syn/Expression.sdf | 12 ++++++------
scoolt/Class.str | 15 ++++++++++++++-
scoolt/Declaration.str | 8 ++++++--
scoolt/Expression.str | 6 +++++-
scoolt/Function.str | 19 +++++++++++++++++++
scoolt/Program.str | 5 ++++-
8 files changed, 71 insertions(+), 15 deletions(-)
Index: branches/scool-ng/src/pp-cxx/CxxFun.str
===================================================================
--- branches/scool-ng/src/pp-cxx/CxxFun.str (revision 120)
+++ branches/scool-ng/src/pp-cxx/CxxFun.str (revision 121)
@@ -4,14 +4,20 @@
rules
+ IsConst:
+ Const() -> S(" const")
+
+ IsConst:
+ None() -> S("")
+
CxxTopLevelToAbox:
- CxxFun(params, t, idf, args) ->
+ CxxFun(params, t, idf, const, args) ->
V vs=0
[
~<CxxParamsToAbox> params
H hs=0
[
- H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf ] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")" ";"
+ H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf ] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")" ~<IsConst> const ";"
]
]
@@ -27,12 +33,12 @@
]
CxxTopLevelToAbox:
- CxxFun(params, t, idf, args, body) ->
+ CxxFun(params, t, idf, args, const, body) ->
V vs=0
[
~<CxxParamsToAbox> params
H hs=0 [
- H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")"
+ H hs=1 [ ~<CxxTypeToAbox> t ~<CxxIdToAbox> idf] "(" H hs=1 [ ~*<CxxListToAbox(CxxArgDefToAbox|",")> args ] ")" ~<IsConst> const
]
V vs=0 is=2
[
Index: branches/scool-ng/src/scoolt/Expression.str
===================================================================
--- branches/scool-ng/src/scoolt/Expression.str (revision 120)
+++ branches/scool-ng/src/scoolt/Expression.str (revision 121)
@@ -28,7 +28,6 @@
String(str) -> <un-double-quote> str
ExpressionToCxx:
-// |[ ~exp:e1 + ~exp:e2; ]| -> CxxSum(cxx_e1, cxx_e2)
Sum(e1, e2) -> CxxSum(cxx_e1, cxx_e2)
where
<ExpressionToCxx> e1 => cxx_e1
@@ -41,6 +40,11 @@
; <ParametersToCxx> params => cxx_params
; <ArgumentsToCxx> args => cxx_args
+ ExpressionToCxx:
+ Assign(lvalue, rvalue) -> CxxAssign(cxx_lvalue, cxx_rvalue)
+ where
+ <IdentifierToCxx> lvalue => cxx_lvalue // FIXME: lvalue might not be an identifier
+ ; <ExpressionToCxx> rvalue => cxx_rvalue
StaticExpressionToCxx:
Index: branches/scool-ng/src/scoolt/Class.str
===================================================================
--- branches/scool-ng/src/scoolt/Class.str (revision 120)
+++ branches/scool-ng/src/scoolt/Class.str (revision 121)
@@ -32,8 +32,14 @@
ClassStatementToCxx:
decl -> cxx_decl
where
- <map (DeclarationToCxx)> decl => cxx_decl
+ <map (ClassDeclarationToCxx)> decl => cxx_decl
+ ClassDeclarationToCxx:
+ decl -> cxx_decl
+ where
+ InClass
+ ; <DeclarationToCxx> decl => cxx_decl
+ ; OutClass
// Add the exact type parameter if the class is not final
AddExactType(|cqualif):
@@ -108,3 +114,10 @@
; <IdentifierToCxx> idf => cxx_idf
; <InheritanceToCxx(| cqualif, cxx_idf)> mother => cxx_mother
+strategies
+
+ ClassInit = rules(IsInClass: _ -> 0)
+
+ InClass = rules(IsInClass:- _) ; rules(IsInClass: _ -> 1)
+
+ OutClass = rules(IsInClass: _ -> 0) ; rules(IsInClass:- _)
Index: branches/scool-ng/src/scoolt/Declaration.str
===================================================================
--- branches/scool-ng/src/scoolt/Declaration.str (revision 120)
+++ branches/scool-ng/src/scoolt/Declaration.str (revision 121)
@@ -42,21 +42,25 @@
////////////////////////////////////////////////////////////////////////////////
DeclarationToCxx:
- |[ ~idf : ~ftype:fun_type; ]| -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, cxx_args)
+// |[ ~idf : ~ftype:fun_type; ]| -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, const, cxx_args)
+ FunctionDeclaration(modifier, idf, fun_type) -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, const, cxx_args)
where
<IdentifierToCxx> idf => cxx_idf
; <TypeToCxx> <GetReturnType> fun_type => cxx_ret_type
; <ParametersToCxx> <GetParameters> fun_type => cxx_params
; <ArgumentsToCxx> <GetArguments> fun_type => cxx_args
+ ; <IsMethodConst> modifier => const
DeclarationToCxx:
- |[ ~idf : ~ftype:fun_type = { ~fbody:body } ]| -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, cxx_args, cxx_body)
+// |[ ~idf : ~ftype:fun_type = { ~fbody:body } ]| -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, cxx_args, Const, cxx_body)
+ FunctionDefinition(modifier, idf, fun_type, FunctionBlock(body)) -> CxxFun(cxx_params, cxx_ret_type, cxx_idf, cxx_args, const, cxx_body)
where
<IdentifierToCxx> idf => cxx_idf
; <TypeToCxx> <GetReturnType> fun_type => cxx_ret_type
; <ParametersToCxx> <GetParameters> fun_type => cxx_params
; <ArgumentsToCxx> <GetArguments> fun_type => cxx_args
; <FunctionBodyToCxx> body => cxx_body
+ ; <IsMethodConst> modifier => const
////////////////////////////////////////////////////////////////////////////////
Index: branches/scool-ng/src/scoolt/Function.str
===================================================================
--- branches/scool-ng/src/scoolt/Function.str (revision 120)
+++ branches/scool-ng/src/scoolt/Function.str (revision 121)
@@ -4,6 +4,25 @@
rules
+ // Detect the constness of the method regarding to the modifier
+
+ IsMethodConst:
+ Some("mutable") -> None()
+
+ IsMethodConst:
+ _ -> None()
+ where
+ <eq> (<IsInClass>, 0)
+
+ IsMethodConst:
+ x -> Const()
+ where
+ <not (?Some("mutable"))> x
+ ; <eq> (<IsInClass>, 1)
+
+
+
+
// Extract data from a FunctionType
GetParameters:
Index: branches/scool-ng/src/scoolt/Program.str
===================================================================
--- branches/scool-ng/src/scoolt/Program.str (revision 120)
+++ branches/scool-ng/src/scoolt/Program.str (revision 121)
@@ -6,6 +6,9 @@
rules
ProgramToCxx:
- Program(stm_list) -> CxxProgram(<map (StatementToCxx)> stm_list)
+ Program(stm_list) -> cxx_program
+ where
+ ClassInit
+ ; !CxxProgram(<map (StatementToCxx)> stm_list) => cxx_program
// Program(l) -> CxxProgram(<conc> (<map(DeclToCxx)> l, <map(ImplToCxx <+ CxxEmpty)> l))
Index: branches/scool-ng/src/scl-syn/Expression.sdf
===================================================================
--- branches/scool-ng/src/scl-syn/Expression.sdf (revision 120)
+++ branches/scool-ng/src/scl-syn/Expression.sdf (revision 121)
@@ -26,7 +26,7 @@
Expression "-" Expression -> Expression {cons("Substraction")}
Expression "*" Expression -> Expression {cons("Multiplication")}
Expression "/" Expression -> Expression {cons("Division")}
- Expression "=" Expression -> Expression {cons("Equal")}
+ Expression "==" Expression -> Expression {cons("Equal")}
Expression "!=" Expression -> Expression {cons("Different")}
Expression "<" Expression -> Expression {cons("StrictInferior")}
Expression ">" Expression -> Expression {cons("StrictSuperior")}
@@ -35,7 +35,7 @@
Expression "or" Expression -> Expression {cons("Or")}
Expression "and" Expression -> Expression {cons("And")}
- %%Identifier ":=" Expression -> Expression {cons("Assign")}
+ Identifier "=" Expression -> Expression {cons("Assign")}
%%Expression "." Identifier -> Expression {cons("Field")}
@@ -54,7 +54,7 @@
Expression "-" Expression -> Expression
}
> {left:
- Expression "=" Expression -> Expression
+ Expression "==" Expression -> Expression
}
> {left:
Expression "and" Expression -> Expression
@@ -62,6 +62,6 @@
> {left:
Expression "or" Expression -> Expression
}
-%%> {right:
-%% Identifier ":=" Expression -> Expression
-%% }
+> {right:
+ Identifier "=" Expression -> Expression
+ }
Index: branches/scool-ng/src/cxx-syn/CxxFun.sdf
===================================================================
--- branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 120)
+++ branches/scool-ng/src/cxx-syn/CxxFun.sdf (revision 121)
@@ -15,6 +15,13 @@
-> CxxTopLevel {cons("CxxFun")}
"template" "<" {(CxxType CxxId) ","}* ">"
+ CxxType CxxId "(" {(CxxType CxxId) ","}* ")" Const?
+ "{"
+ CxxStm*
+ "}"
+ -> CxxTopLevel {cons("CxxFun")}
+
+ "template" "<" {(CxxType CxxId) ","}* ">"
CxxType CxxId "(" {(CxxType CxxId) ","}* ")" ";" -> CxxTopLevel {cons("CxxFun")}
"template" "<" {(CxxType CxxId) ","}* ">"
1
0
* mln/util/site_pair.hh (mln::site_pair): Move class...
(mln::util::site_pair): ...here, into namespace mln::util.
* mln/core/image/line_graph_psite.hh,
* mln/core/site_set/p_complex.hh,
* mln/core/site_set/p_line_graph.hh:
Adjust.
---
milena/ChangeLog | 11 +++
milena/mln/core/image/line_graph_psite.hh | 8 +-
milena/mln/core/site_set/p_complex.hh | 2 +-
milena/mln/core/site_set/p_line_graph.hh | 4 +-
milena/mln/util/site_pair.hh | 135 ++++++++++++++++-------------
5 files changed, 91 insertions(+), 69 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 28c9b28..8aeb1dc 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,16 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Move site_pair into namespace mln::util.
+
+ * mln/util/site_pair.hh (mln::site_pair): Move class...
+ (mln::util::site_pair): ...here, into namespace mln::util.
+ * mln/core/image/line_graph_psite.hh,
+ * mln/core/site_set/p_complex.hh,
+ * mln/core/site_set/p_line_graph.hh:
+ Adjust.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor neighborhoods of complex images.
* mln/core/image/complex_neighborhoods.hh: New.
diff --git a/milena/mln/core/image/line_graph_psite.hh b/milena/mln/core/image/line_graph_psite.hh
index df79d88..4b2e0aa 100644
--- a/milena/mln/core/image/line_graph_psite.hh
+++ b/milena/mln/core/image/line_graph_psite.hh
@@ -56,7 +56,7 @@ namespace mln
/// \arg \p P The type of the site.
template <typename P>
class line_graph_psite
- : public internal::pseudo_site_base_< const site_pair<P>&,
+ : public internal::pseudo_site_base_< const util::site_pair<P>&,
line_graph_psite<P> >
{
typedef line_graph_psite<P> self_;
@@ -95,7 +95,7 @@ namespace mln
/// Proxy manipulators.
/// \{
/// Return the site corresponding to this psite.
- const site_pair<P>& subj_();
+ const util::site_pair<P>& subj_();
/// \}
/// Edge id manipulators.
@@ -131,7 +131,7 @@ namespace mln
/// Update the site corresponding to this psite.
void update_();
// The site corresponding to this psite.
- site_pair<P> p_;
+ util::site_pair<P> p_;
/// \}
private:
@@ -256,7 +256,7 @@ namespace mln
// FIXME: Write or extend a test to exercise this method.
template <typename P>
inline
- const site_pair<P>&
+ const util::site_pair<P>&
line_graph_psite<P>::subj_()
{
return p_;
diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh
index 8f79961..7b5e815 100644
--- a/milena/mln/core/site_set/p_complex.hh
+++ b/milena/mln/core/site_set/p_complex.hh
@@ -94,7 +94,7 @@ namespace mln
dimensions, e.g.
mln_type_list(point2d,
- mln_type_list(site_pair<point2d>,
+ mln_type_list(util::site_pair<point2d>,
mln_type_list(site_set<point2d>, // or site_triplet<point2d>
mln_empty_list)))
diff --git a/milena/mln/core/site_set/p_line_graph.hh b/milena/mln/core/site_set/p_line_graph.hh
index d86cb9d..b9a3ed0 100644
--- a/milena/mln/core/site_set/p_line_graph.hh
+++ b/milena/mln/core/site_set/p_line_graph.hh
@@ -68,10 +68,10 @@ namespace mln
template<typename P>
struct p_line_graph
- : public internal::site_set_base_< site_pair<P>, p_line_graph<P> >
+ : public internal::site_set_base_< util::site_pair<P>, p_line_graph<P> >
{
typedef p_line_graph<P> self_;
- typedef internal::site_set_base_< site_pair<P>, self_ > super_;
+ typedef internal::site_set_base_< util::site_pair<P>, self_ > super_;
typedef util::graph<P> graph;
diff --git a/milena/mln/util/site_pair.hh b/milena/mln/util/site_pair.hh
index efde98d..b9a5611 100644
--- a/milena/mln/util/site_pair.hh
+++ b/milena/mln/util/site_pair.hh
@@ -35,83 +35,94 @@
namespace mln
{
- /* FIXME: The class mln::internal::image_base requires its site
- types to have a `coord' typedef, but util::ord_pair has none.
- Hence this small workaround. Use ord_pair directly as soon as
- image_base is refurbished. */
- template <typename P>
- struct site_pair : public mln::Object< site_pair<P> >
- {
- site_pair();
- site_pair(const P& first, const P& second);
- typedef mln_coord(P) coord;
- util::ord_pair<P> pair_;
- };
- /* FIXME: The proxy mechanism requires operator== and operator<= for
- line_graph_psite to compile (line_graph_psite aggregates a
- site_pair); why? It seems its static assertions do not check the
- right guy(s). IMHO (Roland's), it should look for
- line_graph_psite's operators, not site_pair's. */
- template <typename P>
- bool operator==(const site_pair<P>& lhs, const site_pair<P>& rhs);
+ namespace util
+ {
- template <typename P>
- bool operator< (const site_pair<P>& lhs, const site_pair<P>& rhs);
+ /* FIXME: The class mln::internal::image_base requires its site
+ types to have a `coord' typedef, but util::ord_pair has none.
+ Hence this small workaround. Use ord_pair directly as soon as
+ image_base is refurbished. */
+ template <typename P>
+ struct site_pair : public mln::Object< site_pair<P> >
+ {
+ /* FIXME: We should not need to define this typedef
+ (see. mln::internal::image_base's site `coord' typedef). */
+ typedef mln_coord(P) coord;
- template <typename P>
- bool operator< (const site_pair<P>& lhs, const site_pair<P>& rhs);
+ site_pair();
+ site_pair(const P& first, const P& second);
+ util::ord_pair<P> pair_;
+ };
-# ifndef MLN_INCLUDE_ONLY
+ /* FIXME: The proxy mechanism requires operator== and operator<= for
+ line_graph_psite to compile (note: line_graph_psite aggregates a
+ site_pair); why? It seems its static assertions do not check the
+ right guy(s). IMHO (Roland's), it should look for
+ line_graph_psite's operators, not site_pair's. */
+ template <typename P>
+ bool operator==(const site_pair<P>& lhs, const site_pair<P>& rhs);
- /*---------------.
- | Construction. |
- `---------------*/
+ template <typename P>
+ bool operator< (const site_pair<P>& lhs, const site_pair<P>& rhs);
- template <typename P>
- site_pair<P>::site_pair()
- : pair_(P(), P())
- {
- }
+ template <typename P>
+ bool operator< (const site_pair<P>& lhs, const site_pair<P>& rhs);
- template <typename P>
- site_pair<P>::site_pair(const P& first, const P& second)
- : pair_(first, second)
- {
- }
- /*-------------.
- | Comparison. |
- `-------------*/
- template <typename P>
- inline
- bool
- operator==(const site_pair<P>& lhs, const site_pair<P>& rhs)
- {
- return lhs.pair_ == rhs.pair_;
- }
+# ifndef MLN_INCLUDE_ONLY
- template <typename P>
- inline
- bool
- operator< (const site_pair<P>& lhs, const site_pair<P>& rhs)
- {
- return lhs.pair_ < rhs.pair_;
- }
-
- template <typename P>
- inline
- bool
- operator<=(const site_pair<P>& lhs, const site_pair<P>& rhs)
- {
- return lhs.pair_ <= rhs.pair_;
- }
+ /*---------------.
+ | Construction. |
+ `---------------*/
+
+ template <typename P>
+ site_pair<P>::site_pair()
+ : pair_(P(), P())
+ {
+ }
+
+ template <typename P>
+ site_pair<P>::site_pair(const P& first, const P& second)
+ : pair_(first, second)
+ {
+ }
+
+ /*-------------.
+ | Comparison. |
+ `-------------*/
+
+ template <typename P>
+ inline
+ bool
+ operator==(const site_pair<P>& lhs, const site_pair<P>& rhs)
+ {
+ return lhs.pair_ == rhs.pair_;
+ }
+
+ template <typename P>
+ inline
+ bool
+ operator< (const site_pair<P>& lhs, const site_pair<P>& rhs)
+ {
+ return lhs.pair_ < rhs.pair_;
+ }
+
+ template <typename P>
+ inline
+ bool
+ operator<=(const site_pair<P>& lhs, const site_pair<P>& rhs)
+ {
+ return lhs.pair_ <= rhs.pair_;
+ }
# endif // ! MLN_INCLUDE_ONLY
+ } // end of mln::util
+
} // end of mln
--
1.6.0.1
1
0
* mln/core/image/complex_neighborhoods.hh: New.
Replace...
* mln/core/image/complex_lower_neighborhood.hh,
* mln/core/image/complex_higher_neighborhood.hh,
* mln/core/image/complex_lower_higher_neighborhood.hh:
...these files.
Remove.
* tests/core/image/complex_image.cc: Adjust.
---
milena/ChangeLog | 13 +++++
.../mln/core/image/complex_higher_neighborhood.hh | 53 --------------------
.../mln/core/image/complex_lower_neighborhood.hh | 53 --------------------
...er_neighborhood.hh => complex_neighborhoods.hh} | 38 ++++++++++++--
milena/tests/core/image/complex_image.cc | 10 ++--
5 files changed, 49 insertions(+), 118 deletions(-)
delete mode 100644 milena/mln/core/image/complex_higher_neighborhood.hh
delete mode 100644 milena/mln/core/image/complex_lower_neighborhood.hh
rename milena/mln/core/image/{complex_lower_higher_neighborhood.hh => complex_neighborhoods.hh} (60%)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index aa31232..28c9b28 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,18 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor neighborhoods of complex images.
+
+ * mln/core/image/complex_neighborhoods.hh: New.
+ Replace...
+ * mln/core/image/complex_lower_neighborhood.hh,
+ * mln/core/image/complex_higher_neighborhood.hh,
+ * mln/core/image/complex_lower_higher_neighborhood.hh:
+ ...these files.
+ Remove.
+ * tests/core/image/complex_image.cc: Adjust.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Fix and factor windows of complex images.
* mln/core/image/complex_windows.hh: New.
diff --git a/milena/mln/core/image/complex_higher_neighborhood.hh b/milena/mln/core/image/complex_higher_neighborhood.hh
deleted file mode 100644
index d68051a..0000000
--- a/milena/mln/core/image/complex_higher_neighborhood.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// 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_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
-
-/// \file mln/core/image/complex_higher_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n+1)-faces.
-
-# include <mln/core/internal/complex_neighborhood_base.hh>
-# include <mln/topo/adj_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_higher_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_neighborhood<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_neighborhood.hh b/milena/mln/core/image/complex_lower_neighborhood.hh
deleted file mode 100644
index c7fc882..0000000
--- a/milena/mln/core/image/complex_lower_neighborhood.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// 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_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
-
-/// \file mln/core/image/complex_lower_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n-1)-faces.
-
-# include <mln/core/internal/complex_neighborhood_base.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_neighborhood
- : internal::complex_neighborhood_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_neighborhood<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_NEIGHBORHOOD_HH
diff --git a/milena/mln/core/image/complex_lower_higher_neighborhood.hh b/milena/mln/core/image/complex_neighborhoods.hh
similarity index 60%
rename from milena/mln/core/image/complex_lower_higher_neighborhood.hh
rename to milena/mln/core/image/complex_neighborhoods.hh
index 593982d..174f263 100644
--- a/milena/mln/core/image/complex_lower_higher_neighborhood.hh
+++ b/milena/mln/core/image/complex_neighborhoods.hh
@@ -25,20 +25,46 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
-#ifndef MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#ifndef MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
+# define MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
-/// \file mln/core/image/complex_lower_higher_neighborhood.hh
-/// \brief A neighborhood centered on a n-face of complex returning its
-/// adjacent (n-1)-faces and (n+1)-faces.
+/// \file mln/core/image/complex_neighborhoods.hh
+/// \brief Definitions of some neighborhoods of complex images.
# include <mln/core/internal/complex_neighborhood_base.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/adj_higher_face_iter.hh>
# include <mln/topo/adj_lower_higher_face_iter.hh>
namespace mln
{
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n-1)-faces.
+ template <unsigned D, typename G>
+ struct complex_lower_neighborhood
+ : internal::complex_neighborhood_base< D, G,
+ topo::adj_lower_face_fwd_iter<D>,
+ topo::adj_lower_face_bkd_iter<D>,
+ complex_lower_neighborhood<D, G> >
+ {
+ };
+
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n+1)-faces.
+ template <unsigned D, typename G>
+ struct complex_higher_neighborhood
+ : internal::complex_neighborhood_base< D, G,
+ topo::adj_higher_face_fwd_iter<D>,
+ topo::adj_higher_face_bkd_iter<D>,
+ complex_higher_neighborhood<D, G> >
+ {
+ };
+
+ /// \brief Neighborhood centered on an n-face of complex returning
+ /// its adjacent (n-1)-faces and (n+1)-faces.
template <unsigned D, typename G>
struct complex_lower_higher_neighborhood
: internal::complex_neighborhood_base<
@@ -52,4 +78,4 @@ namespace mln
} // end of namespace mln
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_NEIGHBORHOOD_HH
+#endif // ! MLN_CORE_IMAGE_COMPLEX_NEIGHBORHOODS_HH
diff --git a/milena/tests/core/image/complex_image.cc b/milena/tests/core/image/complex_image.cc
index 4b81713..a2252ad 100644
--- a/milena/tests/core/image/complex_image.cc
+++ b/milena/tests/core/image/complex_image.cc
@@ -37,9 +37,7 @@
#include <mln/core/image/complex_image.hh>
// FIXME: Include these elsewhere? (In complex_image.hh?)
-#include <mln/core/image/complex_lower_neighborhood.hh>
-#include <mln/core/image/complex_higher_neighborhood.hh>
-#include <mln/core/image/complex_lower_higher_neighborhood.hh>
+#include <mln/core/image/complex_neighborhoods.hh>
#include <mln/core/image/complex_neighborhood_piter.hh>
/* FIXME: Split this test (and maybe factor common parts, like the
@@ -215,9 +213,9 @@ int main()
- iterators on N-faces with N in a subset of [0, D];
- etc. */
- // ---------------------------------------- //
- // Iterators on windows and neighborhoods. //
- // ---------------------------------------- //
+ // ---------------------------- //
+ // Iterators on neighborhoods. //
+ // ---------------------------- //
// FIXME: Factor: these three test cases only differ by their
// neighborhoods.
--
1.6.0.1
1
0
* mln/core/image/complex_windows.hh: New.
Replace...
* mln/core/image/complex_lower_window_p.hh,
* mln/core/image/complex_higher_window_p.hh,
* mln/core/image/complex_lower_higher_window_p.hh:
...these files.
Remove.
* mln/core/internal/complex_window_p_base.hh: Fix headers
inclusions.
* tests/morpho/complex_image_morpho.cc: Adjust.
---
milena/ChangeLog | 15 +++
milena/mln/core/image/complex_higher_window_p.hh | 53 ---------
.../core/image/complex_lower_higher_window_p.hh | 54 ---------
milena/mln/core/image/complex_lower_window_p.hh | 53 ---------
milena/mln/core/image/complex_windows.hh | 119 ++++++++++++++++++++
milena/mln/core/internal/complex_window_p_base.hh | 3 +-
milena/tests/morpho/complex_image_morpho.cc | 4 +-
7 files changed, 137 insertions(+), 164 deletions(-)
delete mode 100644 milena/mln/core/image/complex_higher_window_p.hh
delete mode 100644 milena/mln/core/image/complex_lower_higher_window_p.hh
delete mode 100644 milena/mln/core/image/complex_lower_window_p.hh
create mode 100644 milena/mln/core/image/complex_windows.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 09d633d..aa31232 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,20 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Fix and factor windows of complex images.
+
+ * mln/core/image/complex_windows.hh: New.
+ Replace...
+ * mln/core/image/complex_lower_window_p.hh,
+ * mln/core/image/complex_higher_window_p.hh,
+ * mln/core/image/complex_lower_higher_window_p.hh:
+ ...these files.
+ Remove.
+ * mln/core/internal/complex_window_p_base.hh: Fix headers
+ inclusions.
+ * tests/morpho/complex_image_morpho.cc: Adjust.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor concrete windows of complex image.
* mln/core/image/complex_lower_window_p.hh,
diff --git a/milena/mln/core/image/complex_higher_window_p.hh b/milena/mln/core/image/complex_higher_window_p.hh
deleted file mode 100644
index cca6871..0000000
--- a/milena/mln/core/image/complex_higher_window_p.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// 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_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_higher_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n+1)-faces as well as the center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_higher_face_fwd_iter<D>,
- topo::adj_higher_face_bkd_iter<D>,
- complex_higher_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_higher_window_p.hh b/milena/mln/core/image/complex_lower_higher_window_p.hh
deleted file mode 100644
index 7ad62fa..0000000
--- a/milena/mln/core/image/complex_lower_higher_window_p.hh
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// 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_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_lower_higher_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n-1)-faces and (n+1)-faces as well as the
-/// center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_lower_higher_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_higher_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_higher_face_fwd_iter<D>,
- topo::adj_lower_higher_face_bkd_iter<D>,
- complex_lower_higher_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_window_p.hh b/milena/mln/core/image/complex_lower_window_p.hh
deleted file mode 100644
index 7bd3cd1..0000000
--- a/milena/mln/core/image/complex_lower_window_p.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
-//
-// This file is part of the Olena Library. This library is free
-// software; you can redistribute it and/or modify it under the terms
-// 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_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
-# define MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
-
-/// \file mln/core/image/complex_lower_window_p.hh
-/// \brief Definition of a window centered on a n-face of complex
-/// returning its adjacent (n-1)-faces as well as the center n-face.
-
-# include <mln/core/internal/complex_window_p_base.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
-
-
-namespace mln
-{
-
- template <unsigned D, typename G>
- struct complex_lower_window_p
- : internal::complex_window_p_base< D, G,
- topo::adj_lower_face_fwd_iter<D>,
- topo::adj_lower_face_bkd_iter<D>,
- complex_lower_window_p<D, G> >
- {
- };
-
-} // end of namespace mln
-
-#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_windows.hh b/milena/mln/core/image/complex_windows.hh
new file mode 100644
index 0000000..662b528
--- /dev/null
+++ b/milena/mln/core/image/complex_windows.hh
@@ -0,0 +1,119 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// 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_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
+# define MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
+
+/// \file mln/core/image/complex_windows.hh
+/// \brief Definitions of some windows of complex images.
+
+# include <mln/core/internal/complex_window_p_base.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/adj_higher_face_iter.hh>
+# include <mln/topo/adj_lower_higher_face_iter.hh>
+
+
+namespace mln
+{
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n-1)-faces as well as the center n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_face_fwd_iter<D>,
+ topo::adj_lower_face_bkd_iter<D>,
+ complex_lower_window_p<D, G> >
+ {
+ };
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n+1)-faces as well as the center n-face.
+ template <unsigned D, typename G>
+ struct complex_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_higher_face_fwd_iter<D>,
+ topo::adj_higher_face_bkd_iter<D>,
+ complex_higher_window_p<D, G> >
+ {
+ };
+
+ /// \brief Window centered on an n-face of complex returning its
+ /// adjacent (n-1)-faces and (n+1)-faces as well as the center
+ /// n-face.
+ template <unsigned D, typename G>
+ struct complex_lower_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_higher_face_fwd_iter<D>,
+ topo::adj_lower_higher_face_bkd_iter<D>,
+ complex_lower_higher_window_p<D, G> >
+ {
+ };
+
+
+ namespace trait
+ {
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_lower_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_lower_face_fwd_iter<D>,
+ mln::topo::adj_lower_face_bkd_iter<D>,
+ mln::complex_lower_window_p<D, G> >
+ >
+ {
+ };
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_higher_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_higher_face_fwd_iter<D>,
+ mln::topo::adj_higher_face_bkd_iter<D>,
+ mln::complex_higher_window_p<D, G> >
+ >
+ {
+ };
+
+ template <unsigned D, typename G>
+ struct window_< mln::complex_lower_higher_window_p<D, G> >
+ : window_< mln::internal::complex_window_p_base<
+ D, G,
+ mln::topo::adj_lower_higher_face_fwd_iter<D>,
+ mln::topo::adj_lower_higher_face_bkd_iter<D>,
+ mln::complex_lower_higher_window_p<D, G> >
+ >
+ {
+ };
+
+ } // end of namespace mln::trait
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOWS_P_HH
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
index a50d594..3494552 100644
--- a/milena/mln/core/internal/complex_window_p_base.hh
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -36,7 +36,8 @@
# include <mln/core/concept/window.hh>
# include <mln/core/site_set/complex_psite.hh>
-# include <mln/topo/adj_lower_face_iter.hh>
+# include <mln/topo/centered_iter_adapter.hh>
+
// FIXME: Factor with mln::internal::complex_neighborhood_base.
diff --git a/milena/tests/morpho/complex_image_morpho.cc b/milena/tests/morpho/complex_image_morpho.cc
index baf0f68..e3823c7 100644
--- a/milena/tests/morpho/complex_image_morpho.cc
+++ b/milena/tests/morpho/complex_image_morpho.cc
@@ -37,9 +37,7 @@
#include <mln/core/image/complex_image.hh>
// FIXME: Include these elsewhere? (In complex_image.hh?)
-#include <mln/core/image/complex_lower_window_p.hh>
-#include <mln/core/image/complex_higher_window_p.hh>
-#include <mln/core/image/complex_lower_higher_window_p.hh>
+#include <mln/core/image/complex_windows.hh>
#include <mln/core/image/complex_window_piter.hh>
#include <mln/debug/iota.hh>
--
1.6.0.1
1
0
scool r120: Fix tests to reflect the constification of class methods by default
by Maxime van Noppen 17 Oct '08
by Maxime van Noppen 17 Oct '08
17 Oct '08
From: Maxime van Noppen <yabo(a)lrde.epita.fr>
To: transformers-patches(a)lrde.epita.fr, olena-patches(a)lrde.epita.fr
Subject: scool r120: Fix tests to reflect the constification of class methods by default
URL: https://svn.lrde.epita.fr/svn/scool/branches/scool-ng
ChangeLog:
2008-10-17 Maxime van Noppen <yabo(a)lrde.epita.fr>
Fix tests to reflect the constification of class methods by default
* class/c++_ast/method_001.aterm,
* class/c++_ast/method_002.aterm,
* class/c++_ast/method_003.aterm,
* class/c++_ast/method_004.aterm,
* class/c++_ast/method_005.aterm,
* class/c++_src/method_001.cc,
* class/c++_src/method_002.cc,
* class/c++_src/method_003.cc,
* class/c++_src/method_004.cc,
* class/c++_src/method_005.cc,
* function/c++_ast/call_001.aterm,
* function/c++_ast/call_002.aterm,
* function/c++_ast/call_003.aterm,
* function/c++_ast/call_004.aterm,
* function/c++_ast/call_005.aterm,
* function/c++_ast/call_006.aterm,
* function/c++_ast/declaration_001.aterm,
* function/c++_ast/declaration_002.aterm,
* function/c++_ast/declaration_003.aterm,
* function/c++_ast/declaration_004.aterm,
* function/c++_ast/declaration_005.aterm,
* function/c++_ast/declaration_006.aterm,
* function/c++_ast/declaration_007.aterm,
* function/c++_ast/declaration_008.aterm,
* function/c++_ast/definition_001.aterm,
* function/c++_ast/definition_002.aterm,
* function/c++_ast/definition_003.aterm,
* function/c++_ast/definition_004.aterm,
* function/c++_ast/definition_005.aterm,
* function/c++_ast/definition_006.aterm,
* function/c++_ast/definition_007.aterm,
* variable/c++_src/declaration_005.cc,
* misc/c++_src/empty.cc,
* function/c++_ast/parameters_arguments_001.aterm,
* function/c++_ast/parameters_arguments_002.aterm,
* function/c++_ast/parameters_arguments_003.aterm,
* function/c++_ast/parameters_arguments_005.aterm: Here.
* class/c++_src/mutable_1.cc: New.
* class/scool_ast/mutable_1.aterm: New.
* function/c++_build/declaration_001.g++: New.
* function/c++_build/declaration_002.g++: New.
* function/c++_build/declaration_005.g++: New.
* function/c++_build/declaration_006.g++: New.
* function/c++_build/declaration_007.g++: New.
* function/c++_build/declaration_008.g++: New.
* function/c++_build/definition_001.g++: New.
* function/c++_build/definition_003.g++: New.
* function/c++_build/definition_004.g++: New.
* function/c++_build/definition_005.g++: New.
* function/c++_build/definition_006.g++: New.
* function/c++_build/definition_007.g++: New.
* function/c++_build/parameters_arguments_001.g++: New.
* function/c++_build/parameters_arguments_002.g++: New.
* function/c++_build/parameters_arguments_003.g++: New.
* function/c++_build/parameters_arguments_005.g++: New.
* misc/c++_build/empty.g++: New.
* variable/c++_build/declaration_002.g++: New.
* variable/c++_build/declaration_003.g++: New.
* variable/c++_build/declaration_004.g++: New.
* variable/c++_build/mixed_declarations_001.g++: New.
* class/c++_ast/mutable_1.aterm: New.
* class/c++_build/mutable_1.g++: New.
class/c++_ast/method_001.aterm | 2 +-
class/c++_ast/method_002.aterm | 2 +-
class/c++_ast/method_003.aterm | 2 +-
class/c++_ast/method_004.aterm | 2 +-
class/c++_ast/method_005.aterm | 2 +-
class/c++_ast/mutable_1.aterm | 1 +
class/c++_src/method_001.cc | 2 +-
class/c++_src/method_002.cc | 2 +-
class/c++_src/method_003.cc | 4 ++--
class/c++_src/method_004.cc | 4 ++--
class/c++_src/method_005.cc | 4 ++--
class/c++_src/mutable_1.cc | 10 ++++++++++
class/scool_ast/mutable_1.aterm | 1 +
function/c++_ast/call_001.aterm | 2 +-
function/c++_ast/call_002.aterm | 2 +-
function/c++_ast/call_003.aterm | 2 +-
function/c++_ast/call_004.aterm | 2 +-
function/c++_ast/call_005.aterm | 2 +-
function/c++_ast/call_006.aterm | 2 +-
function/c++_ast/declaration_001.aterm | 2 +-
function/c++_ast/declaration_002.aterm | 2 +-
function/c++_ast/declaration_003.aterm | 2 +-
function/c++_ast/declaration_004.aterm | 2 +-
function/c++_ast/declaration_005.aterm | 2 +-
function/c++_ast/declaration_006.aterm | 2 +-
function/c++_ast/declaration_007.aterm | 2 +-
function/c++_ast/declaration_008.aterm | 2 +-
function/c++_ast/definition_001.aterm | 2 +-
function/c++_ast/definition_002.aterm | 2 +-
function/c++_ast/definition_003.aterm | 2 +-
function/c++_ast/definition_004.aterm | 2 +-
function/c++_ast/definition_005.aterm | 2 +-
function/c++_ast/definition_006.aterm | 2 +-
function/c++_ast/definition_007.aterm | 2 +-
function/c++_ast/parameters_arguments_001.aterm | 2 +-
function/c++_ast/parameters_arguments_002.aterm | 2 +-
function/c++_ast/parameters_arguments_003.aterm | 2 +-
function/c++_ast/parameters_arguments_005.aterm | 2 +-
misc/c++_src/empty.cc | 1 +
39 files changed, 51 insertions(+), 38 deletions(-)
Index: branches/scool-ng/tests/class/c++_ast/mutable_1.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/mutable_1.aterm (revision 0)
+++ branches/scool-ng/tests/class/c++_ast/mutable_1.aterm (revision 120)
@@ -0,0 +1 @@
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("foo"),[],[CxxPublic([CxxFun([],CxxType("void"),CxxId("f"),[],None,[CxxExpStm(CxxAssign(CxxId("x"),CxxInt("42")))]),CxxDecl(CxxType("int"),CxxId("x"))])])])
Index: branches/scool-ng/tests/class/c++_ast/method_001.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/method_001.aterm (revision 119)
+++ branches/scool-ng/tests/class/c++_ast/method_001.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])])])
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])])])
Index: branches/scool-ng/tests/class/c++_ast/method_002.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/method_002.aterm (revision 119)
+++ branches/scool-ng/tests/class/c++_ast/method_002.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])])])
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])])])
Index: branches/scool-ng/tests/class/c++_ast/method_003.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/method_003.aterm (revision 119)
+++ branches/scool-ng/tests/class/c++_ast/method_003.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))]),CxxFun([],CxxType("int"),CxxId("another_test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("42")))]),CxxFun([],CxxType("int"),CxxId("another_test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
Index: branches/scool-ng/tests/class/c++_ast/method_004.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/method_004.aterm (revision 119)
+++ branches/scool-ng/tests/class/c++_ast/method_004.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))]),CxxFun([],CxxType("int"),CxxId("another_test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("42")))]),CxxFun([],CxxType("int"),CxxId("another_test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
Index: branches/scool-ng/tests/class/c++_ast/method_005.aterm
===================================================================
--- branches/scool-ng/tests/class/c++_ast/method_005.aterm (revision 119)
+++ branches/scool-ng/tests/class/c++_ast/method_005.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))])]),CxxPrivate([CxxFun([],CxxType("int"),CxxId("another_test"),[],[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
+CxxProgram([CxxClassDecl([(CxxType("typename"),"Exact")],CxxId("Foo"),[],[CxxPublic([CxxFun([],CxxType("int"),CxxId("test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("42")))])]),CxxPrivate([CxxFun([],CxxType("int"),CxxId("another_test"),[],Const,[CxxExpStm(CxxKeyword("return",CxxInt("51")))])])])])
Index: branches/scool-ng/tests/class/c++_src/method_001.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/method_001.cc (revision 119)
+++ branches/scool-ng/tests/class/c++_src/method_001.cc (revision 120)
@@ -2,7 +2,7 @@
class Foo
{
public:
- int test()
+ int test() const
{
return 42;
}
Index: branches/scool-ng/tests/class/c++_src/method_002.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/method_002.cc (revision 119)
+++ branches/scool-ng/tests/class/c++_src/method_002.cc (revision 120)
@@ -2,7 +2,7 @@
class Foo
{
public:
- int test()
+ int test() const
{
return 42;
}
Index: branches/scool-ng/tests/class/c++_src/method_003.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/method_003.cc (revision 119)
+++ branches/scool-ng/tests/class/c++_src/method_003.cc (revision 120)
@@ -2,11 +2,11 @@
class Foo
{
public:
- int test()
+ int test() const
{
return 42;
}
- int another_test()
+ int another_test() const
{
return 51;
}
Index: branches/scool-ng/tests/class/c++_src/method_004.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/method_004.cc (revision 119)
+++ branches/scool-ng/tests/class/c++_src/method_004.cc (revision 120)
@@ -2,11 +2,11 @@
class Foo
{
public:
- int test()
+ int test() const
{
return 42;
}
- int another_test()
+ int another_test() const
{
return 51;
}
Index: branches/scool-ng/tests/class/c++_src/method_005.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/method_005.cc (revision 119)
+++ branches/scool-ng/tests/class/c++_src/method_005.cc (revision 120)
@@ -2,12 +2,12 @@
class Foo
{
public:
- int test()
+ int test() const
{
return 42;
}
private:
- int another_test()
+ int another_test() const
{
return 51;
}
Index: branches/scool-ng/tests/class/c++_src/mutable_1.cc
===================================================================
--- branches/scool-ng/tests/class/c++_src/mutable_1.cc (revision 0)
+++ branches/scool-ng/tests/class/c++_src/mutable_1.cc (revision 120)
@@ -0,0 +1,10 @@
+template < typename Exact >
+class foo
+{
+ public:
+ void f()
+ {
+ x = 42;
+ }
+ int x;
+};
Index: branches/scool-ng/tests/class/scool_ast/mutable_1.aterm
===================================================================
--- branches/scool-ng/tests/class/scool_ast/mutable_1.aterm (revision 0)
+++ branches/scool-ng/tests/class/scool_ast/mutable_1.aterm (revision 120)
@@ -0,0 +1 @@
+Program([ClassDefinition(None,Identifier("foo"),None,ClassBlock([AccessBlock(Public,[FunctionDefinition(Some("mutable"),Identifier("f"),FunctionType(None,ArgumentsDeclaration([]),SimpleType("void")),FunctionBlock([ExpressionStatement(Assign(Identifier("x"),Integer("42")))])),SimpleDeclaration(Some("var"),Identifier("x"),SimpleType("int"),None)])]))])
Index: branches/scool-ng/tests/class/c++_build/mutable_1.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_ast/definition_001.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_001.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_001.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("answer"),[],[])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("answer"),[],None,[])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_004.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_004.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_004.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),[]),CxxFun([],CxxType("float"),CxxId("foo"),[(CxxType("int"),CxxId("arg1"))]),CxxFun([],CxxType("char"),CxxId("foo"),[(CxxConstType(CxxRefType(CxxType("toto"))),CxxId("arg1")),(CxxRefType(CxxType("double")),CxxId("arg2"))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),None,[]),CxxFun([],CxxType("float"),CxxId("foo"),None,[(CxxType("int"),CxxId("arg1"))]),CxxFun([],CxxType("char"),CxxId("foo"),None,[(CxxConstType(CxxRefType(CxxType("toto"))),CxxId("arg1")),(CxxRefType(CxxType("double")),CxxId("arg2"))])])
Index: branches/scool-ng/tests/function/c++_ast/parameters_arguments_001.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/parameters_arguments_001.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/parameters_arguments_001.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("T"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("T"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],None,[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
Index: branches/scool-ng/tests/function/c++_ast/definition_002.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_002.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_002.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("answer"),[],[CxxDecl(CxxConstType(CxxType("int")),CxxId("i"))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("answer"),[],None,[CxxDecl(CxxConstType(CxxType("int")),CxxId("i"))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_005.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_005.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_005.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("foo"),[])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("foo"),None,[])])
Index: branches/scool-ng/tests/function/c++_ast/parameters_arguments_002.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/parameters_arguments_002.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/parameters_arguments_002.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],None,[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_006.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_006.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_006.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("foo"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("foo"),None,[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))])])
Index: branches/scool-ng/tests/function/c++_ast/definition_003.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_003.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_003.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])
+CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],None,[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])
Index: branches/scool-ng/tests/function/c++_ast/parameters_arguments_003.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/parameters_arguments_003.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/parameters_arguments_003.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T"))],CxxType("void"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a"))],None,[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_007.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_007.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_007.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T")),(CxxType("typename"),CxxId("S"))],CxxType("void"),CxxId("foo"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a")),(CxxConstType(CxxRefType(CxxType("S"))),CxxId("b"))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T")),(CxxType("typename"),CxxId("S"))],CxxType("void"),CxxId("foo"),None,[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a")),(CxxConstType(CxxRefType(CxxType("S"))),CxxId("b"))])])
Index: branches/scool-ng/tests/function/c++_ast/definition_004.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_004.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_004.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],[CxxDecl(CxxConstType(CxxType("int")),CxxId("i"),CxxInt("42")),CxxExpStm(CxxKeyword("return",CxxId("i")))])])
+CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],None,[CxxDecl(CxxConstType(CxxType("int")),CxxId("i"),CxxInt("42")),CxxExpStm(CxxKeyword("return",CxxId("i")))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_008.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_008.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_008.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("bool"),CxxId("B"))],CxxType("void"),CxxId("foo"),[])])
+CxxProgram([CxxFun([(CxxType("bool"),CxxId("B"))],CxxType("void"),CxxId("foo"),None,[])])
Index: branches/scool-ng/tests/function/c++_ast/definition_005.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_005.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_005.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])
+CxxProgram([CxxFun([],CxxType("int"),CxxId("answer"),[],None,[CxxExpStm(CxxKeyword("return",CxxInt("42")))])])
Index: branches/scool-ng/tests/function/c++_ast/parameters_arguments_005.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/parameters_arguments_005.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/parameters_arguments_005.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([(CxxType("typename"),CxxId("T")),(CxxType("typename"),CxxId("U"))],CxxType("T"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a")),(CxxConstType(CxxRefType(CxxType("U"))),CxxId("b"))],[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
+CxxProgram([CxxFun([(CxxType("typename"),CxxId("T")),(CxxType("typename"),CxxId("U"))],CxxType("T"),CxxId("f"),[(CxxConstType(CxxRefType(CxxType("T"))),CxxId("a")),(CxxConstType(CxxRefType(CxxType("U"))),CxxId("b"))],None,[CxxExpStm(CxxKeyword("return",CxxId("a")))])])
Index: branches/scool-ng/tests/function/c++_ast/definition_006.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_006.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_006.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("int"),CxxId("sum"),[(CxxType("int"),CxxId("a")),(CxxType("int"),CxxId("b"))],[CxxExpStm(CxxKeyword("return",CxxSum(CxxId("a"),CxxId("b"))))])])
+CxxProgram([CxxFun([],CxxType("int"),CxxId("sum"),[(CxxType("int"),CxxId("a")),(CxxType("int"),CxxId("b"))],None,[CxxExpStm(CxxKeyword("return",CxxSum(CxxId("a"),CxxId("b"))))])])
Index: branches/scool-ng/tests/function/c++_ast/definition_007.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/definition_007.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/definition_007.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("int"),CxxId("sum"),[(CxxType("int"),CxxId("a")),(CxxType("int"),CxxId("b"))],[CxxExpStm(CxxKeyword("return",CxxSum(CxxId("a"),CxxId("b"))))])])
+CxxProgram([CxxFun([],CxxType("int"),CxxId("sum"),[(CxxType("int"),CxxId("a")),(CxxType("int"),CxxId("b"))],None,[CxxExpStm(CxxKeyword("return",CxxSum(CxxId("a"),CxxId("b"))))])])
Index: branches/scool-ng/tests/function/c++_ast/call_001.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_001.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_001.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([],CxxId("foo"),[]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([],CxxId("foo"),[]))])])
Index: branches/scool-ng/tests/function/c++_ast/call_002.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_002.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_002.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([],CxxId("foo"),[CxxInt("42")]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([],CxxId("foo"),[CxxInt("42")]))])])
Index: branches/scool-ng/tests/function/c++_ast/call_003.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_003.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_003.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([],CxxId("foo"),["bar",CxxInt("42")]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([],CxxId("foo"),["bar",CxxInt("42")]))])])
Index: branches/scool-ng/tests/function/c++_ast/call_004.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_004.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_004.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([CxxType("int")],CxxId("foo"),[]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([CxxType("int")],CxxId("foo"),[]))])])
Index: branches/scool-ng/tests/function/c++_ast/call_005.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_005.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_005.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([CxxInt("42")],CxxId("foo"),[]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([CxxInt("42")],CxxId("foo"),[]))])])
Index: branches/scool-ng/tests/function/c++_ast/call_006.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/call_006.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/call_006.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],[CxxExpStm(CxxFunCall([CxxType("int"),CxxInt("42")],CxxId("foo"),[CxxInt("42")]))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("doit"),[],None,[CxxExpStm(CxxFunCall([CxxType("int"),CxxInt("42")],CxxId("foo"),[CxxInt("42")]))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_001.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_001.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_001.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),[])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),None,[])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_002.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_002.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_002.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),[(CxxType("int"),CxxId("a"))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),None,[(CxxType("int"),CxxId("a"))])])
Index: branches/scool-ng/tests/function/c++_ast/declaration_003.aterm
===================================================================
--- branches/scool-ng/tests/function/c++_ast/declaration_003.aterm (revision 119)
+++ branches/scool-ng/tests/function/c++_ast/declaration_003.aterm (revision 120)
@@ -1 +1 @@
-CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),[(CxxType("int"),CxxId("a")),(CxxConstType(CxxRefType(CxxType("bar"))),CxxId("b"))])])
+CxxProgram([CxxFun([],CxxType("void"),CxxId("foo"),None,[(CxxType("int"),CxxId("a")),(CxxConstType(CxxRefType(CxxType("bar"))),CxxId("b"))])])
Index: branches/scool-ng/tests/function/c++_build/declaration_001.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/declaration_002.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/parameters_arguments_001.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_001.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/parameters_arguments_002.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/declaration_005.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/parameters_arguments_003.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_003.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/declaration_006.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_004.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/declaration_007.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/parameters_arguments_005.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_005.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/declaration_008.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_006.g++
===================================================================
Index: branches/scool-ng/tests/function/c++_build/definition_007.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_src/declaration_005.cc
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_002.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_003.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/declaration_004.g++
===================================================================
Index: branches/scool-ng/tests/variable/c++_build/mixed_declarations_001.g++
===================================================================
Index: branches/scool-ng/tests/misc/c++_src/empty.cc
===================================================================
--- branches/scool-ng/tests/misc/c++_src/empty.cc (revision 119)
+++ branches/scool-ng/tests/misc/c++_src/empty.cc (revision 120)
@@ -0,0 +1 @@
+
Index: branches/scool-ng/tests/misc/c++_build/empty.g++
===================================================================
--
yabo
1
0
---
ChangeLog | 249 -----------------------------------
milena/ChangeLog | 322 +++++++++++++++++++++++++++++++++++++++-------
milena/sandbox/ChangeLog | 14 ++
3 files changed, 291 insertions(+), 294 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7faee30..a94185c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,3 @@
-2008-10-16 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
-
- Fix some morpho operators.
-
- * milena/tests/morpho/erosion.cc: Fix typo.
- * milena/mln/core/routine/ops.hh (todo): New.
- * milena/mln/morpho/erosion.spe.hh (octagon2d): Fix.
- (hline2d, vline2d): Fix dispatch.
-
2008-10-15 Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac: Configure milena/tests/io/off/Makefile.
@@ -19,246 +10,6 @@
Fix compilation error. It could not resolve the correct namespace
path.
-2008-16-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Update tutorial.
- * milena/doc/tutorial/samples/ima2d-1.tex,
- * milena/doc/tutorial/samples/ima2d-3.tex,
- * milena/doc/tutorial/samples/paste-call-1.tex,
- * milena/doc/tutorial/samples/point-1.tex:
- Add new sample code.
-
- * milena/doc/tutorial/tutorial.tex:
- Mainly update image chapter.
- Cleanup source.
-
-2008-15-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- * milena/mln/doc/tutorial/samples/box2d-1.tex,
- * milena/mln/doc/tutorial/samples/box2d-2.tex,
- * milena/mln/doc/tutorial/samples/domain-display-1.tex,
- * milena/mln/doc/tutorial/samples/domain-display-out-1.tex,
- * milena/mln/doc/tutorial/samples/fill-call-1.tex,
- * milena/mln/doc/tutorial/samples/fill-part-1.tex,
- * milena/mln/doc/tutorial/samples/fill-part-2.tex,
- * milena/mln/doc/tutorial/samples/fill-part-3.tex,
- * milena/mln/doc/tutorial/samples/fill.tex,
- * milena/mln/doc/tutorial/samples/forall-piter-1.tex,
- * milena/mln/doc/tutorial/samples/fun-p2b-1.tex,
- * milena/mln/doc/tutorial/samples/fun-p2v-1.tex,
- * milena/mln/doc/tutorial/samples/graph-output-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-2.tex,
- * milena/mln/doc/tutorial/samples/ima2d-3.tex,
- * milena/mln/doc/tutorial/samples/ima2d-4.tex,
- * milena/mln/doc/tutorial/samples/ima2d-5.tex,
- * milena/mln/doc/tutorial/samples/ima2d-6-clone.tex,
- * milena/mln/doc/tutorial/samples/ima2d-decl-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-decl-2.tex,
- * milena/mln/doc/tutorial/samples/ima2d-display-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-display-2.tex,
- * milena/mln/doc/tutorial/samples/ima2d-display-output-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-display-output-2.tex,
- * milena/mln/doc/tutorial/samples/ima2d-restricted-1.tex,
- * milena/mln/doc/tutorial/samples/ima2d-restricted-2.tex,
- * milena/mln/doc/tutorial/samples/ima2d-restricted-3.tex,
- * milena/mln/doc/tutorial/samples/ima2d-restricted-display-1.tex,
- * milena/mln/doc/tutorial/samples/mln_var-1.tex,
- * milena/mln/doc/tutorial/samples/mln_var-2.tex,
- * milena/mln/doc/tutorial/samples/mln_var-3.tex,
- * milena/mln/doc/tutorial/samples/parray-append.tex,
- * milena/mln/doc/tutorial/samples/parray-display-1.tex,
- * milena/mln/doc/tutorial/samples/paste-call-1.tex,
- * milena/mln/doc/tutorial/samples/paste.tex,
- * milena/mln/doc/tutorial/samples/point-1.tex,
- * milena/mln/doc/tutorial/samples/predicate-1.tex:
- Move sample code from the tutorial to these files.
-
- * milena/mln/doc/tutorial/tutorial.tex: various update.
-
-
-2008-15-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Update the prototype of labeling::compute().
- * milena/mln/labeling/compute.hh: change the return type to an
- util::array.
-
- * milena/sandbox/scribo/demat.hh,
- * milena/tests/labeling/compute.cc: update according the new
- prototype.
-
-2008-15-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Remove the useless '_' postfix in all the accumulators.
- * milena/doc/examples/tuto_bis.cc,
- * milena/doc/tutorial/examples/accu.cc,
- * milena/mln/accu/bbox.hh,
- * milena/mln/accu/count.hh,
- * milena/mln/accu/count_adjacent_vertices.hh,
- * milena/mln/accu/height.hh,
- * milena/mln/accu/histo.hh,
- * milena/mln/accu/max_h.hh,
- * milena/mln/accu/mean.hh,
- * milena/mln/accu/median_alt.hh,
- * milena/mln/accu/median_h.hh,
- * milena/mln/accu/nil.hh,
- * milena/mln/accu/p.hh,
- * milena/mln/accu/rank.hh,
- * milena/mln/accu/rank_bool.hh,
- * milena/mln/accu/rank_high_quant.hh,
- * milena/mln/accu/sum.hh,
- * milena/mln/accu/tuple.hh,
- * milena/mln/accu/v.hh,
- * milena/mln/accu/volume.hh,
- * milena/mln/canvas/morpho/algebraic_union_find.hh,
- * milena/mln/estim/mean.hh,
- * milena/mln/estim/sum.hh,
- * milena/mln/make/voronoi.hh,
- * milena/mln/morpho/closing_area.hh,
- * milena/mln/morpho/closing_area_on_vertices.hh,
- * milena/mln/morpho/closing_height.hh,
- * milena/mln/morpho/closing_volume.hh,
- * milena/mln/morpho/erosion.spe.hh,
- * milena/mln/morpho/opening_area.hh,
- * milena/mln/morpho/opening_area_on_vertices.hh,
- * milena/mln/morpho/opening_height.hh,
- * milena/mln/morpho/opening_volume.hh,
- * milena/mln/morpho/rank_filter.hh,
- * milena/tests/accu/all_accus.cc,
- * milena/tests/accu/count.cc,
- * milena/tests/accu/nil.cc,
- * milena/tests/accu/pair.cc,
- * milena/tests/accu/rank.cc,
- * milena/tests/accu/tuple.cc,
- * milena/tests/labeling/compute.cc:
- Update.
-
-
-2008-15-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Update accus to make them work with the new q_result typedef.
- * milena/mln/accu/bbox.hh,
- * milena/mln/accu/histo.hh,
- * milena/mln/accu/max.hh,
- * milena/mln/accu/max_h.hh,
- * milena/mln/accu/mean.hh,
- * milena/mln/accu/median_alt.hh,
- * milena/mln/accu/median_h.hh,
- * milena/mln/accu/min_h.hh,
- * milena/mln/accu/nil.hh,
- * milena/mln/accu/p.hh,
- * milena/mln/accu/rank.hh,
- * milena/mln/accu/rank_bool.hh,
- * milena/mln/accu/rank_high_quant.hh,
- * milena/mln/accu/sum.hh,
- * milena/mln/accu/tuple.hh,
- * milena/mln/accu/v.hh:
- Remove "result" typedef.
- Pass the qualified type as parameter to internal::base<>.
-
-2008-13-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- * milena/sandbox/scribo/remove_tables.cc:
- New small example to remove table borders in a document such as a
- bill.
-
-2008-10-07 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Fix most of the doxygen warnings.
- * milena/mln/arith/min.hh,
- * milena/mln/arith/plus.hh,
- * milena/mln/core/concept/doc/point_iterator.hh,
- * milena/mln/core/concept/point_site.hh,
- * milena/mln/core/dpsites_piter.hh,
- * milena/mln/core/faces_psite.hh,
- * milena/mln/core/image/bgraph_image.hh,
- * milena/mln/core/image/bgraph_psite.hh,
- * milena/mln/core/image/complex_higher_neighborhood.hh,
- * milena/mln/core/image/complex_higher_window_p.hh,
- * milena/mln/core/image/complex_image.hh,
- * milena/mln/core/image/complex_lower_higher_neighborhood.hh,
- * milena/mln/core/image/complex_lower_higher_window_p.hh,
- * milena/mln/core/image/complex_lower_neighborhood.hh,
- * milena/mln/core/image/complex_lower_window_p.hh,
- * milena/mln/core/image/decorated_image.hh,
- * milena/mln/core/image/graph_image.hh,
- * milena/mln/core/image/graph_psite.hh,
- * milena/mln/core/image/line_graph_image.hh,
- * milena/mln/core/image/line_graph_psite.hh,
- * milena/mln/core/image/obased_rle_image.hh,
- * milena/mln/core/image/value_enc_image.hh,
- * milena/mln/core/routine/clone.hh,
- * milena/mln/core/site_set/attic/p_complex_faces_piter.hh,
- * milena/mln/core/site_set/attic/p_faces_piter.hh,
- * milena/mln/core/site_set/complex_psite.hh,
- * milena/mln/core/site_set/p_bgraph.hh,
- * milena/mln/core/site_set/p_bgraph_piter.hh,
- * milena/mln/core/site_set/p_complex.hh,
- * milena/mln/core/site_set/p_faces.hh,
- * milena/mln/core/site_set/p_graph.hh,
- * milena/mln/core/site_set/p_line_graph.hh,
- * milena/mln/core/window.hh,
- * milena/mln/display/color_pretty.hh,
- * milena/mln/fun/c.hh,
- * milena/mln/fun/x2x/geom/composed.hh,
- * milena/mln/fun/x2x/geom/rotation.hh,
- * milena/mln/fun/x2x/geom/translation.hh,
- * milena/mln/geom/resize.hh,
- * milena/mln/geom/seeds2tiling.hh,
- * milena/mln/geom/seeds2tiling_roundness.hh,
- * milena/mln/level/fill_with_image.hh,
- * milena/mln/level/fill_with_value.hh,
- * milena/mln/level/paste.hh,
- * milena/mln/linear/sobel.hh,
- * milena/mln/neighb/image.hh,
- * milena/mln/pw/image.hh,
- * milena/mln/topo/attic/faces_iter.hh,
- * milena/mln/topo/complex.hh,
- * milena/mln/topo/complex_iterators.hh,
- * milena/mln/topo/internal/complex_relative_iterator_base.hh,
- * milena/mln/topo/internal/complex_relative_iterator_sequence.hh,
- * milena/mln/topo/internal/complex_set_iterator_base.hh,
- * milena/mln/topo/n_faces_set.hh,
- * milena/mln/util/branch_iter.hh,
- * milena/mln/util/branch_iter_ind.hh,
- * milena/mln/util/greater_point.hh,
- * milena/mln/util/greater_psite.hh,
- * milena/mln/util/internal/boost_graph.hh,
- * milena/mln/util/internal/graph_edge.hh,
- * milena/mln/util/internal/graph_edge_impl.hh,
- * milena/mln/util/internal/graph_edge_psite.hh,
- * milena/mln/util/internal/graph_vertex_impl.hh,
- * milena/mln/win/cuboid3d.hh,
- * milena/mln/win/multiple.hh,
- * milena/tests/core/site_set/p_vertices.cc,
- * milena/tests/extension/fill.cc,
- * milena/tests/morpho/complex_image_morpho.cc:
- Cleanup up doxygen comments.
-
- * milena/doc/Doxyfile.in:
- Add new predefined macros.
-
-
-2008-10-03 Guillaume Lazzara <z(a)lrde.epita.fr>
-
- Various small fixes.
- * milena/mln/algebra/vec.hh: add missing header.
-
- * milena/mln/core/image/obased_rle_image.hh,
- * milena/mln/core/image/rle_image.hh: Use pruns.
-
- * milena/mln/core/image/obased_rle_image.hh,
- * milena/mln/core/image/t_image.hh: add missing init_ function.
-
- * milena/mln/core/image/tr_image.hh,
- * milena/tests/core/alias/point1d.cc,
- * milena/tests/core/alias/point2d.cc: cleanup.
-
- * milena/tests/core/image/Makefile.am: Disable known broken test
- such as graph related tests.
-
- * milena/tests/core/image/tr_image.cc: make it compile.
-
2008-09-24 Roland Levillain <roland(a)lrde.epita.fr>
* configure.ac: Configure milena/tests/topo/Makefile.
diff --git a/milena/ChangeLog b/milena/ChangeLog
index cc3b10a..09d633d 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -28,6 +28,15 @@
* mln/core/internal/complex_neighborhood_base.hh: New.
+2008-10-16 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
+
+ Fix some morpho operators.
+
+ * tests/morpho/erosion.cc: Fix typo.
+ * mln/core/routine/ops.hh (todo): New.
+ * mln/morpho/erosion.spe.hh (octagon2d): Fix.
+ (hline2d, vline2d): Fix dispatch.
+
2008-10-16 Roland Levillain <roland(a)lrde.epita.fr>
Exercise mln::io::load on OFF file (with no color data).
@@ -207,6 +216,73 @@
* mln/core/def/coordf.hh: New.
+2008-16-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update tutorial.
+ * doc/tutorial/samples/ima2d-1.tex,
+ * doc/tutorial/samples/ima2d-3.tex,
+ * doc/tutorial/samples/paste-call-1.tex,
+ * doc/tutorial/samples/point-1.tex:
+ Add new sample code.
+
+ * doc/tutorial/tutorial.tex:
+ Mainly update image chapter.
+ Cleanup source.
+
+2008-15-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * mln/doc/tutorial/samples/box2d-1.tex,
+ * mln/doc/tutorial/samples/box2d-2.tex,
+ * mln/doc/tutorial/samples/domain-display-1.tex,
+ * mln/doc/tutorial/samples/domain-display-out-1.tex,
+ * mln/doc/tutorial/samples/fill-call-1.tex,
+ * mln/doc/tutorial/samples/fill-part-1.tex,
+ * mln/doc/tutorial/samples/fill-part-2.tex,
+ * mln/doc/tutorial/samples/fill-part-3.tex,
+ * mln/doc/tutorial/samples/fill.tex,
+ * mln/doc/tutorial/samples/forall-piter-1.tex,
+ * mln/doc/tutorial/samples/fun-p2b-1.tex,
+ * mln/doc/tutorial/samples/fun-p2v-1.tex,
+ * mln/doc/tutorial/samples/graph-output-1.tex,
+ * mln/doc/tutorial/samples/ima2d-1.tex,
+ * mln/doc/tutorial/samples/ima2d-2.tex,
+ * mln/doc/tutorial/samples/ima2d-3.tex,
+ * mln/doc/tutorial/samples/ima2d-4.tex,
+ * mln/doc/tutorial/samples/ima2d-5.tex,
+ * mln/doc/tutorial/samples/ima2d-6-clone.tex,
+ * mln/doc/tutorial/samples/ima2d-decl-1.tex,
+ * mln/doc/tutorial/samples/ima2d-decl-2.tex,
+ * mln/doc/tutorial/samples/ima2d-display-1.tex,
+ * mln/doc/tutorial/samples/ima2d-display-2.tex,
+ * mln/doc/tutorial/samples/ima2d-display-output-1.tex,
+ * mln/doc/tutorial/samples/ima2d-display-output-2.tex,
+ * mln/doc/tutorial/samples/ima2d-restricted-1.tex,
+ * mln/doc/tutorial/samples/ima2d-restricted-2.tex,
+ * mln/doc/tutorial/samples/ima2d-restricted-3.tex,
+ * mln/doc/tutorial/samples/ima2d-restricted-display-1.tex,
+ * mln/doc/tutorial/samples/mln_var-1.tex,
+ * mln/doc/tutorial/samples/mln_var-2.tex,
+ * mln/doc/tutorial/samples/mln_var-3.tex,
+ * mln/doc/tutorial/samples/parray-append.tex,
+ * mln/doc/tutorial/samples/parray-display-1.tex,
+ * mln/doc/tutorial/samples/paste-call-1.tex,
+ * mln/doc/tutorial/samples/paste.tex,
+ * mln/doc/tutorial/samples/point-1.tex,
+ * mln/doc/tutorial/samples/predicate-1.tex:
+ Move sample code from the tutorial to these files.
+
+ * mln/doc/tutorial/tutorial.tex: various update.
+
+2008-10-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update the prototype of labeling::compute().
+ * mln/labeling/compute.hh: change the return type to an
+ util::array.
+
+ * sandbox/scribo/demat.hh,
+ * tests/labeling/compute.cc: update according the new
+ prototype.
+
2008-10-15 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Make morpho meyer_wst practicable.
@@ -227,6 +303,52 @@
* mln/convert/to_image.hh: Replace suspicous use of size_t by T.
Now return an image1d<T> instead of image1d<std::size_t>
+2008-10-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Remove the useless '_' postfix in all the accumulators.
+ * doc/examples/tuto_bis.cc,
+ * doc/tutorial/examples/accu.cc,
+ * mln/accu/bbox.hh,
+ * mln/accu/count.hh,
+ * mln/accu/count_adjacent_vertices.hh,
+ * mln/accu/height.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/median_h.hh,
+ * mln/accu/nil.hh,
+ * mln/accu/p.hh,
+ * mln/accu/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/v.hh,
+ * mln/accu/volume.hh,
+ * mln/canvas/morpho/algebraic_union_find.hh,
+ * mln/estim/mean.hh,
+ * mln/estim/sum.hh,
+ * mln/make/voronoi.hh,
+ * mln/morpho/closing_area.hh,
+ * mln/morpho/closing_area_on_vertices.hh,
+ * mln/morpho/closing_height.hh,
+ * mln/morpho/closing_volume.hh,
+ * mln/morpho/erosion.spe.hh,
+ * mln/morpho/opening_area.hh,
+ * mln/morpho/opening_area_on_vertices.hh,
+ * mln/morpho/opening_height.hh,
+ * mln/morpho/opening_volume.hh,
+ * mln/morpho/rank_filter.hh,
+ * tests/accu/all_accus.cc,
+ * tests/accu/count.cc,
+ * tests/accu/nil.cc,
+ * tests/accu/pair.cc,
+ * tests/accu/rank.cc,
+ * tests/accu/tuple.cc,
+ * tests/labeling/compute.cc:
+ Update.
+
2008-10-15 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
Remove the useless '_' postfix in some accumulators.
@@ -258,6 +380,28 @@
* doc/examples/tuto_bis.cc,
* mln/debug/println.spe.hh: Update.
+2008-10-15 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Update accus to make them work with the new q_result typedef.
+ * mln/accu/bbox.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/max.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/median_h.hh,
+ * mln/accu/min_h.hh,
+ * mln/accu/nil.hh,
+ * mln/accu/p.hh,
+ * mln/accu/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/v.hh:
+ Remove "result" typedef.
+ Pass the qualified type as parameter to internal::base<>.
+
2008-10-15 Nicolas Ballas <ballas(a)lrde.epita.fr>
Fix a bug in the fill_with_value dispatch.
@@ -294,16 +438,8 @@
2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
- Use labeling::compute for Scribo.
- * milena/sandbox/scribo/remove_tables.hh: split in...
- * milena/sandbox/scribo/demat.hh,
- * milena/sandbox/scribo/main.cc: ...these two files.
- Update the code in order to use labeling::compute.
-
-2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
-
Fix labeling::compute return type.
- * milena/mln/labeling/compute.hh: Fix many compilation errors
+ * mln/labeling/compute.hh: Fix many compilation errors
while taking directly the result type of an accumulator as a template
parameter for p_array<>.
Use mlc_unqualif.
@@ -311,60 +447,60 @@
2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Add meta-accumulator for accu::bbox.
- * milena/mln/accu/bbox.hh: add missing meta-accumulator.
+ * mln/accu/bbox.hh: add missing meta-accumulator.
2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Add is_valid() in the accumulator concept and move meta-accumulators
in meta namespace.
- * milena/mln/accu/count.hh,
- * milena/mln/accu/height.hh,
- * milena/mln/accu/histo.hh,
- * milena/mln/accu/max.hh,
- * milena/mln/accu/max_h.hh,
- * milena/mln/accu/mean.hh,
- * milena/mln/accu/median_alt.hh,
- * milena/mln/accu/min.hh,
- * milena/mln/accu/min_h.hh,
- * milena/mln/accu/nil.hh,
- * milena/mln/accu/p.hh,
- * milena/mln/accu/pair.hh,
- * milena/mln/accu/rank.hh,
- * milena/mln/accu/rank_bool.hh,
- * milena/mln/accu/rank_high_quant.hh,
- * milena/mln/accu/sum.hh,
- * milena/mln/accu/tuple.hh,
- * milena/mln/accu/v.hh,
- * milena/mln/accu/volume.hh:
+ * mln/accu/count.hh,
+ * mln/accu/height.hh,
+ * mln/accu/histo.hh,
+ * mln/accu/max.hh,
+ * mln/accu/max_h.hh,
+ * mln/accu/mean.hh,
+ * mln/accu/median_alt.hh,
+ * mln/accu/min.hh,
+ * mln/accu/min_h.hh,
+ * mln/accu/nil.hh,
+ * mln/accu/p.hh,
+ * mln/accu/pair.hh,
+ * mln/accu/rank.hh,
+ * mln/accu/rank_bool.hh,
+ * mln/accu/rank_high_quant.hh,
+ * mln/accu/sum.hh,
+ * mln/accu/tuple.hh,
+ * mln/accu/v.hh,
+ * mln/accu/volume.hh:
Add is_valid() and move meta-accumulators in meta namespace if needed.
- * milena/mln/core/concept/accumulator.hh:
+ * mln/core/concept/accumulator.hh:
Add is_valid() static test.
- * milena/tests/accu/all_accus.cc,
- * milena/tests/accu/max.cc,
- * milena/tests/accu/mean.cc,
- * milena/tests/accu/min.cc,
- * milena/tests/accu/min_max.cc,
- * milena/tests/accu/nil.cc:
+ * tests/accu/all_accus.cc,
+ * tests/accu/max.cc,
+ * tests/accu/mean.cc,
+ * tests/accu/min.cc,
+ * tests/accu/min_max.cc,
+ * tests/accu/nil.cc:
Fix tests.
- * milena/mln/morpho/gradient_elementary.hh: Fix compilation.
+ * mln/morpho/gradient_elementary.hh: Fix compilation.
2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Add labeling::compute.
- * milena/mln/labeling/compute.hh: do it.
- * milena/tests/labeling/Makefile.am,
- * milena/tests/labeling/compute.cc: Add the proper test.
+ * mln/labeling/compute.hh: do it.
+ * tests/labeling/Makefile.am,
+ * tests/labeling/compute.cc: Add the proper test.
2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
Use geom::bbox instead of bbox().
- * milena/mln/geom/max_col.hh,
- * milena/mln/geom/max_row.hh,
- * milena/mln/geom/min_col.hh,
- * milena/mln/geom/min_col.hh: Use geom::bbox().
+ * mln/geom/max_col.hh,
+ * mln/geom/max_row.hh,
+ * mln/geom/min_col.hh,
+ * mln/geom/min_col.hh: Use geom::bbox().
2008-10-14 Thierry Geraud <thierry.geraud(a)lrde.epita.fr>
@@ -544,6 +680,82 @@
* tests/timer.hh: New. Tool to bench tests.
+2008-10-07 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Fix most of the doxygen warnings.
+ * mln/arith/min.hh,
+ * mln/arith/plus.hh,
+ * mln/core/concept/doc/point_iterator.hh,
+ * mln/core/concept/point_site.hh,
+ * mln/core/dpsites_piter.hh,
+ * mln/core/faces_psite.hh,
+ * mln/core/image/bgraph_image.hh,
+ * mln/core/image/bgraph_psite.hh,
+ * mln/core/image/complex_higher_neighborhood.hh,
+ * mln/core/image/complex_higher_window_p.hh,
+ * mln/core/image/complex_image.hh,
+ * mln/core/image/complex_lower_higher_neighborhood.hh,
+ * mln/core/image/complex_lower_higher_window_p.hh,
+ * mln/core/image/complex_lower_neighborhood.hh,
+ * mln/core/image/complex_lower_window_p.hh,
+ * mln/core/image/decorated_image.hh,
+ * mln/core/image/graph_image.hh,
+ * mln/core/image/graph_psite.hh,
+ * mln/core/image/line_graph_image.hh,
+ * mln/core/image/line_graph_psite.hh,
+ * mln/core/image/obased_rle_image.hh,
+ * mln/core/image/value_enc_image.hh,
+ * mln/core/routine/clone.hh,
+ * mln/core/site_set/attic/p_complex_faces_piter.hh,
+ * mln/core/site_set/attic/p_faces_piter.hh,
+ * mln/core/site_set/complex_psite.hh,
+ * mln/core/site_set/p_bgraph.hh,
+ * mln/core/site_set/p_bgraph_piter.hh,
+ * mln/core/site_set/p_complex.hh,
+ * mln/core/site_set/p_faces.hh,
+ * mln/core/site_set/p_graph.hh,
+ * mln/core/site_set/p_line_graph.hh,
+ * mln/core/window.hh,
+ * mln/display/color_pretty.hh,
+ * mln/fun/c.hh,
+ * mln/fun/x2x/geom/composed.hh,
+ * mln/fun/x2x/geom/rotation.hh,
+ * mln/fun/x2x/geom/translation.hh,
+ * mln/geom/resize.hh,
+ * mln/geom/seeds2tiling.hh,
+ * mln/geom/seeds2tiling_roundness.hh,
+ * mln/level/fill_with_image.hh,
+ * mln/level/fill_with_value.hh,
+ * mln/level/paste.hh,
+ * mln/linear/sobel.hh,
+ * mln/neighb/image.hh,
+ * mln/pw/image.hh,
+ * mln/topo/attic/faces_iter.hh,
+ * mln/topo/complex.hh,
+ * mln/topo/complex_iterators.hh,
+ * mln/topo/internal/complex_relative_iterator_base.hh,
+ * mln/topo/internal/complex_relative_iterator_sequence.hh,
+ * mln/topo/internal/complex_set_iterator_base.hh,
+ * mln/topo/n_faces_set.hh,
+ * mln/util/branch_iter.hh,
+ * mln/util/branch_iter_ind.hh,
+ * mln/util/greater_point.hh,
+ * mln/util/greater_psite.hh,
+ * mln/util/internal/boost_graph.hh,
+ * mln/util/internal/graph_edge.hh,
+ * mln/util/internal/graph_edge_impl.hh,
+ * mln/util/internal/graph_edge_psite.hh,
+ * mln/util/internal/graph_vertex_impl.hh,
+ * mln/win/cuboid3d.hh,
+ * mln/win/multiple.hh,
+ * tests/core/site_set/p_vertices.cc,
+ * tests/extension/fill.cc,
+ * tests/morpho/complex_image_morpho.cc:
+ Cleanup up doxygen comments.
+
+ * doc/Doxyfile.in:
+ Add new predefined macros.
+
2008-10-07 Nicolas Ballas <ballas(a)lrde.epita.fr>
Add documentation about the image properties.
@@ -840,8 +1052,28 @@
2008-10-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Various small fixes.
+ * mln/algebra/vec.hh: add missing header.
+
+ * mln/core/image/obased_rle_image.hh,
+ * mln/core/image/rle_image.hh: Use pruns.
+
+ * mln/core/image/obased_rle_image.hh,
+ * mln/core/image/t_image.hh: add missing init_ function.
+
+ * mln/core/image/tr_image.hh,
+ * tests/core/alias/point1d.cc,
+ * tests/core/alias/point2d.cc: cleanup.
+
+ * tests/core/image/Makefile.am: Disable known broken test
+ such as graph related tests.
+
+ * tests/core/image/tr_image.cc: make it compile.
+
+2008-10-03 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Update tutorial..
- * milena/doc/tutorial/tutorial.tex:
+ * doc/tutorial/tutorial.tex:
- Add a new section about sites
- Add new subsections about image domain and values.
- Talk about operator '/' used to create sub images.
diff --git a/milena/sandbox/ChangeLog b/milena/sandbox/ChangeLog
index 6dc40af..00cf46e 100644
--- a/milena/sandbox/ChangeLog
+++ b/milena/sandbox/ChangeLog
@@ -6,6 +6,14 @@
* classif/plotscript: Basic plotting script.
* classif/chiche.pgm: Revamp chiche.
+2008-10-14 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ Use labeling::compute for Scribo.
+ * scribo/remove_tables.hh: split in...
+ * scribo/demat.hh,
+ * scribo/main.cc: ...these two files.
+ Update the code in order to use labeling::compute.
+
2008-10-14 Ugo Jardonnet <ugo.jardonnet(a)lrde.epita.fr>
INIM Bootstrap Classification.
@@ -28,6 +36,12 @@
* classif/lena.ppm: New.
* classif/scoolNBR.ppm: New.
+2008-10-13 Guillaume Lazzara <z(a)lrde.epita.fr>
+
+ * scribo/remove_tables.cc:
+ New small example to remove table borders in a document such as a
+ bill.
+
2008-10-13 Alexandre Abraham <abraham(a)lrde.epita.fr>
Add different types of function and tests.
--
1.6.0.1
1
0
* mln/core/image/complex_lower_window_p.hh,
* mln/core/image/complex_higher_window_p.hh,
* mln/core/image/complex_lower_higher_window_p.hh:
Factor using mln::internal::complex_window_p_base.
---
milena/ChangeLog | 9 ++
milena/mln/core/image/complex_higher_window_p.hh | 105 +------------------
.../core/image/complex_lower_higher_window_p.hh | 105 +------------------
milena/mln/core/image/complex_lower_window_p.hh | 105 +------------------
4 files changed, 27 insertions(+), 297 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index ae50733..cc3b10a 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Factor concrete windows of complex image.
+
+ * mln/core/image/complex_lower_window_p.hh,
+ * mln/core/image/complex_higher_window_p.hh,
+ * mln/core/image/complex_lower_higher_window_p.hh:
+ Factor using mln::internal::complex_window_p_base.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Add a factored implementation of window of complex image.
* mln/core/internal/complex_window_p_base.hh: New.
diff --git a/milena/mln/core/image/complex_higher_window_p.hh b/milena/mln/core/image/complex_higher_window_p.hh
index b043ce9..cca6871 100644
--- a/milena/mln/core/image/complex_higher_window_p.hh
+++ b/milena/mln/core/image/complex_higher_window_p.hh
@@ -32,115 +32,22 @@
/// \brief Definition of a window centered on a n-face of complex
/// returning its adjacent (n+1)-faces as well as the center n-face.
-# include <mln/core/concept/window.hh>
-
-# include <mln/core/site_set/complex_psite.hh>
-
-# include <mln/topo/centered_iter_adapter.hh>
+# include <mln/core/internal/complex_window_p_base.hh>
# include <mln/topo/adj_higher_face_iter.hh>
namespace mln
{
- // Forward declarations.
- template <unsigned D, typename G> class complex_higher_window_p;
- template <typename I, typename G, typename W> class complex_window_fwd_piter;
- template <typename I, typename G, typename W> class complex_window_bkd_piter;
-
-
- namespace trait
- {
-
- template <unsigned D, typename G>
- struct window_< mln::complex_higher_window_p<D,G> >
- {
- typedef trait::window::size::unknown size;
- typedef trait::window::support::irregular support;
- typedef trait::window::definition::varying definition;
- };
-
- } // end of namespace mln::trait
-
- /// \brief Window centered on a n-face of complex returning its
- /// adjacent (n+1)-faces as well as the center n-face.
template <unsigned D, typename G>
- class complex_higher_window_p
- : public Window< complex_higher_window_p<D, G> >
+ struct complex_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_higher_face_fwd_iter<D>,
+ topo::adj_higher_face_bkd_iter<D>,
+ complex_higher_window_p<D, G> >
{
- typedef complex_higher_window_p<D, G> self_;
- /// The complex iterators on the <em>adjacent</em> faces only
- /// (without the center point).
- /// \{
- typedef topo::adj_higher_face_fwd_iter<D> adj_fwd_iter_;
- typedef topo::adj_higher_face_bkd_iter<D> adj_bkd_iter_;
- /// \}
-
- public:
- /// The associated complex iterators.
- /// \{
- typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter;
- typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter;
- /// \}
-
- public:
- /// Associated types.
- /// \{
- /// The type of psite corresponding to the window.
- typedef complex_psite<D, G> psite;
- /// The type of site corresponding to the window.
- typedef mln_site(psite) site;
-
- // FIXME: This is a dummy value.
- typedef void dpsite;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the ordering of vertices.
- typedef
- complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the reverse ordering of vertices.
- typedef
- complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter;
-
- /// The default qiter type.
- typedef fwd_qiter qiter;
- /// \}
-
- public:
- /// Services.
- /// \{
- /* FIXME: mln::morpho::dilation requires these method from models
- of concept Window, but Window does not list them in its
- requirements. Who's guilty: morpho::dilation or Window? */
- /// Is this window empty? (Always returns \c false).
- bool is_empty() const;
- /// Is this window centered? (Always returns \c true).
- bool is_centered() const;
- /// \}
};
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- template <unsigned D, typename G>
- bool
- complex_higher_window_p<D, G>::is_empty() const
- {
- return false;
- }
-
- template <unsigned D, typename G>
- bool
- complex_higher_window_p<D, G>::is_centered() const
- {
- return true;
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
} // end of namespace mln
#endif // ! MLN_CORE_IMAGE_COMPLEX_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_higher_window_p.hh b/milena/mln/core/image/complex_lower_higher_window_p.hh
index f44a7c7..7ad62fa 100644
--- a/milena/mln/core/image/complex_lower_higher_window_p.hh
+++ b/milena/mln/core/image/complex_lower_higher_window_p.hh
@@ -33,115 +33,22 @@
/// returning its adjacent (n-1)-faces and (n+1)-faces as well as the
/// center n-face.
-# include <mln/core/concept/window.hh>
-
-# include <mln/core/site_set/complex_psite.hh>
-
-# include <mln/topo/centered_iter_adapter.hh>
+# include <mln/core/internal/complex_window_p_base.hh>
# include <mln/topo/adj_lower_higher_face_iter.hh>
namespace mln
{
- // Forward declarations.
- template <unsigned D, typename G> class complex_lower_higher_window_p;
- template <typename I, typename G, typename W> class complex_window_fwd_piter;
- template <typename I, typename G, typename W> class complex_window_bkd_piter;
-
-
- namespace trait
- {
-
- template <unsigned D, typename G>
- struct window_< mln::complex_lower_higher_window_p<D,G> >
- {
- typedef trait::window::size::unknown size;
- typedef trait::window::support::irregular support;
- typedef trait::window::definition::varying definition;
- };
-
- } // end of namespace mln::trait
-
- /// \brief Window centered on a n-face of complex returning its
- /// adjacent (n-1)-faces as well as the center n-face.
template <unsigned D, typename G>
- class complex_lower_higher_window_p
- : public Window< complex_lower_higher_window_p<D, G> >
+ struct complex_lower_higher_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_higher_face_fwd_iter<D>,
+ topo::adj_lower_higher_face_bkd_iter<D>,
+ complex_lower_higher_window_p<D, G> >
{
- typedef complex_lower_higher_window_p<D, G> self_;
- /// The complex iterators on the <em>adjacent</em> faces only
- /// (without the center point).
- /// \{
- typedef topo::adj_lower_higher_face_fwd_iter<D> adj_fwd_iter_;
- typedef topo::adj_lower_higher_face_bkd_iter<D> adj_bkd_iter_;
- /// \}
-
- public:
- /// The associated complex iterators.
- /// \{
- typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter;
- typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter;
- /// \}
-
- public:
- /// Associated types.
- /// \{
- /// The type of psite corresponding to the window.
- typedef complex_psite<D, G> psite;
- /// The type of site corresponding to the window.
- typedef mln_site(psite) site;
-
- // FIXME: This is a dummy value.
- typedef void dpsite;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the ordering of vertices.
- typedef
- complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the reverse ordering of vertices.
- typedef
- complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter;
-
- /// The default qiter type.
- typedef fwd_qiter qiter;
- /// \}
-
- public:
- /// Services.
- /// \{
- /* FIXME: mln::morpho::dilation requires these method from models
- of concept Window, but Window does not list them in its
- requirements. Who's guilty: morpho::dilation or Window? */
- /// Is this window empty? (Always returns \c false).
- bool is_empty() const;
- /// Is this window centered? (Always returns \c true).
- bool is_centered() const;
- /// \}
};
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- template <unsigned D, typename G>
- bool
- complex_lower_higher_window_p<D, G>::is_empty() const
- {
- return false;
- }
-
- template <unsigned D, typename G>
- bool
- complex_lower_higher_window_p<D, G>::is_centered() const
- {
- return true;
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
} // end of namespace mln
#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_HIGHER_WINDOW_P_HH
diff --git a/milena/mln/core/image/complex_lower_window_p.hh b/milena/mln/core/image/complex_lower_window_p.hh
index 1a50d8f..7bd3cd1 100644
--- a/milena/mln/core/image/complex_lower_window_p.hh
+++ b/milena/mln/core/image/complex_lower_window_p.hh
@@ -32,115 +32,22 @@
/// \brief Definition of a window centered on a n-face of complex
/// returning its adjacent (n-1)-faces as well as the center n-face.
-# include <mln/core/concept/window.hh>
-
-# include <mln/core/site_set/complex_psite.hh>
-
-# include <mln/topo/centered_iter_adapter.hh>
+# include <mln/core/internal/complex_window_p_base.hh>
# include <mln/topo/adj_lower_face_iter.hh>
namespace mln
{
- // Forward declarations.
- template <unsigned D, typename G> class complex_lower_window_p;
- template <typename I, typename G, typename W> class complex_window_fwd_piter;
- template <typename I, typename G, typename W> class complex_window_bkd_piter;
-
-
- namespace trait
- {
-
- template <unsigned D, typename G>
- struct window_< mln::complex_lower_window_p<D,G> >
- {
- typedef trait::window::size::unknown size;
- typedef trait::window::support::irregular support;
- typedef trait::window::definition::varying definition;
- };
-
- } // end of namespace mln::trait
-
- /// \brief Window centered on a n-face of complex returning its
- /// adjacent (n-1)-faces as well as the center n-face.
template <unsigned D, typename G>
- class complex_lower_window_p
- : public Window< complex_lower_window_p<D, G> >
+ struct complex_lower_window_p
+ : internal::complex_window_p_base< D, G,
+ topo::adj_lower_face_fwd_iter<D>,
+ topo::adj_lower_face_bkd_iter<D>,
+ complex_lower_window_p<D, G> >
{
- typedef complex_lower_window_p<D, G> self_;
- /// The complex iterators on the <em>adjacent</em> faces only
- /// (without the center point).
- /// \{
- typedef topo::adj_lower_face_fwd_iter<D> adj_fwd_iter_;
- typedef topo::adj_lower_face_bkd_iter<D> adj_bkd_iter_;
- /// \}
-
- public:
- /// The associated complex iterators.
- /// \{
- typedef topo::centered_fwd_iter_adapter<D, adj_fwd_iter_> complex_fwd_iter;
- typedef topo::centered_bkd_iter_adapter<D, adj_bkd_iter_> complex_bkd_iter;
- /// \}
-
- public:
- /// Associated types.
- /// \{
- /// The type of psite corresponding to the window.
- typedef complex_psite<D, G> psite;
- /// The type of site corresponding to the window.
- typedef mln_site(psite) site;
-
- // FIXME: This is a dummy value.
- typedef void dpsite;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the ordering of vertices.
- typedef
- complex_window_fwd_piter<complex_fwd_iter, G, self_> fwd_qiter;
-
- /// \brief Site_Iterator type to browse the psites of the window
- /// w.r.t. the reverse ordering of vertices.
- typedef
- complex_window_bkd_piter<complex_bkd_iter, G, self_> bkd_qiter;
-
- /// The default qiter type.
- typedef fwd_qiter qiter;
- /// \}
-
- public:
- /// Services.
- /// \{
- /* FIXME: mln::morpho::dilation requires these method from models
- of concept Window, but Window does not list them in its
- requirements. Who's guilty: morpho::dilation or Window? */
- /// Is this window empty? (Always returns \c false).
- bool is_empty() const;
- /// Is this window centered? (Always returns \c true).
- bool is_centered() const;
- /// \}
};
-
-
-# ifndef MLN_INCLUDE_ONLY
-
- template <unsigned D, typename G>
- bool
- complex_lower_window_p<D, G>::is_empty() const
- {
- return false;
- }
-
- template <unsigned D, typename G>
- bool
- complex_lower_window_p<D, G>::is_centered() const
- {
- return true;
- }
-
-# endif // ! MLN_INCLUDE_ONLY
-
} // end of namespace mln
#endif // ! MLN_CORE_IMAGE_COMPLEX_LOWER_WINDOW_P_HH
--
1.6.0.1
1
0
17 Oct '08
* mln/core/internal/complex_window_p_base.hh: New.
---
milena/ChangeLog | 6 +
milena/mln/core/internal/complex_window_p_base.hh | 166 +++++++++++++++++++++
2 files changed, 172 insertions(+), 0 deletions(-)
create mode 100644 milena/mln/core/internal/complex_window_p_base.hh
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 1a4fe48..ae50733 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,11 @@
2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+ Add a factored implementation of window of complex image.
+
+ * mln/core/internal/complex_window_p_base.hh: New.
+
+2008-10-17 Roland Levillain <roland(a)lrde.epita.fr>
+
Factor concrete neighborhoods of complex image.
* mln/core/image/complex_lower_neighborhood.hh,
diff --git a/milena/mln/core/internal/complex_window_p_base.hh b/milena/mln/core/internal/complex_window_p_base.hh
new file mode 100644
index 0000000..a50d594
--- /dev/null
+++ b/milena/mln/core/internal/complex_window_p_base.hh
@@ -0,0 +1,166 @@
+// Copyright (C) 2008 EPITA Research and Development Laboratory (LRDE)
+//
+// This file is part of the Olena Library. This library is free
+// software; you can redistribute it and/or modify it under the terms
+// 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_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
+# define MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
+
+/// \file mln/core/image/complex_window_p_base.hh
+/// \brief Definition of a generic window centered on the face
+/// of a complex, based on a pair of (forward and backward) complex
+/// iterators. The center (site) is part of the window.
+
+# include <mln/core/concept/window.hh>
+# include <mln/core/site_set/complex_psite.hh>
+
+# include <mln/topo/adj_lower_face_iter.hh>
+
+// FIXME: Factor with mln::internal::complex_neighborhood_base.
+
+
+namespace mln
+{
+ // Forward declarations.
+ template <typename I, typename G, typename W>
+ class complex_window_fwd_piter;
+ template <typename I, typename G, typename W>
+ class complex_window_bkd_piter;
+
+ namespace internal
+ {
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_window_p_base;
+ }
+
+
+ namespace trait
+ {
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ struct window_< mln::internal::complex_window_p_base<D, G, F, B, E> >
+ {
+ typedef trait::window::size::unknown size;
+ typedef trait::window::support::irregular support;
+ typedef trait::window::definition::varying definition;
+ };
+
+ } // end of namespace mln::trait
+
+
+ namespace internal
+ {
+ /** \brief Generic window centered on the face of a complex, based
+ on an pair of (forward and backward) complex iterators. The
+ center (site) is part of the window.
+
+ \tparam D The dimension of the complex.
+ \tparam G The geometry functor of the complex.
+ \tparam F The underlying forward iterator.
+ \tparam B The underlying backward iterator.
+ \tparam E The exact type. */
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ class complex_window_p_base : public Window<E>
+ {
+ /// The complex iterators <em>on the adjacent faces only</em>
+ /// (without the center point).
+ /// \{
+ typedef F adj_only_fwd_iter_;
+ typedef B adj_only_bkd_iter_;
+ /// \}
+
+ public:
+ /// The associated complex iterators.
+ /// \{
+ typedef topo::centered_fwd_iter_adapter<D, adj_only_fwd_iter_>
+ complex_fwd_iter;
+
+ typedef topo::centered_bkd_iter_adapter<D, adj_only_bkd_iter_>
+ complex_bkd_iter;
+ /// \}
+
+ public:
+ /// Associated types.
+ /// \{
+ /// The type of psite corresponding to the window.
+ typedef complex_psite<D, G> psite;
+ /// The type of site corresponding to the window.
+ typedef mln_site(psite) site;
+
+ // FIXME: This is a dummy value.
+ typedef void dpsite;
+
+ /// \brief Site_Iterator type to browse the psites of the window
+ /// w.r.t. the ordering of vertices.
+ typedef
+ complex_window_fwd_piter<complex_fwd_iter, G, E> fwd_qiter;
+
+ /// \brief Site_Iterator type to browse the psites of the window
+ /// w.r.t. the reverse ordering of vertices.
+ typedef
+ complex_window_bkd_piter<complex_bkd_iter, G, E> bkd_qiter;
+
+ /// The default qiter type.
+ typedef fwd_qiter qiter;
+ /// \}
+
+ public:
+ /// Services.
+ /// \{
+ /* FIXME: mln::morpho::dilation requires these method from models
+ of concept Window, but Window does not list them in its
+ requirements. Who's guilty: morpho::dilation or Window? */
+ /// Is this window empty? (Always returns \c false).
+ bool is_empty() const;
+ /// Is this window centered? (Always returns \c true).
+ bool is_centered() const;
+ /// \}
+ };
+
+
+
+# ifndef MLN_INCLUDE_ONLY
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ bool
+ complex_window_p_base<D, G, F, B, E>::is_empty() const
+ {
+ return false;
+ }
+
+ template <unsigned D, typename G, typename F, typename B, typename E>
+ bool
+ complex_window_p_base<D, G, F, B, E>::is_centered() const
+ {
+ return true;
+ }
+
+# endif // ! MLN_INCLUDE_ONLY
+
+ } // end of namespace mln::internal
+
+} // end of namespace mln
+
+#endif // ! MLN_CORE_IMAGE_COMPLEX_WINDOW_P_BASE_HH
--
1.6.0.1
1
0