LRE
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
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
List overview
Download
Olena-patches
October 2008
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
olena-patches@lrde.epita.fr
14 participants
373 discussions
Start a n
N
ew thread
(no subject)
by z@plasma.lrde.epita.fr
16 years, 2 months
1
0
0
0
(no subject)
by z@plasma.lrde.epita.fr
16 years, 2 months
1
0
0
0
(no subject)
by z@plasma.lrde.epita.fr
16 years, 2 months
1
0
0
0
(no subject)
by z@plasma.lrde.epita.fr
16 years, 2 months
1
0
0
0
(no subject)
by z@plasma.lrde.epita.fr
16 years, 2 months
1
0
0
0
2695: Add missing methods in graph related classes.
by Guillaume Lazzara
* mln/core/site_set/p_vertices.hh: Add missing operator()(unsigned). * mln/util/graph.hh: Add missing has_v(util::vertex) and has_e(util::edge). Fix is_subgraph_of(). * mln/util/internal/graph_vertex_psite.hh, * mln/util/internal/graph_edge_psite.hh: Add a missing constructor. * mln/util/internal/graph_psite_base.hh: Add missing graph() and site_set() methods. --- milena/ChangeLog | 16 ++++++ milena/mln/core/site_set/p_vertices.hh | 17 +++++- milena/mln/util/graph.hh | 28 +++++++++- milena/mln/util/internal/graph_edge_psite.hh | 10 +++- milena/mln/util/internal/graph_psite_base.hh | 70 ++++++++++++++++++++---- milena/mln/util/internal/graph_vertex_psite.hh | 10 +++- 6 files changed, 132 insertions(+), 19 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 048b97a..26dca4b 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -14,6 +14,22 @@ 2008-10-27 Guillaume Lazzara <z(a)lrde.epita.fr> + Add missing methods in graph related classes. + + * mln/core/site_set/p_vertices.hh: Add missing operator()(unsigned). + + * mln/util/graph.hh: Add missing has_v(util::vertex) and + has_e(util::edge). + Fix is_subgraph_of(). + + * mln/util/internal/graph_vertex_psite.hh, + * mln/util/internal/graph_edge_psite.hh: Add a missing constructor. + + * mln/util/internal/graph_psite_base.hh: Add missing graph() and + site_set() methods. + +2008-10-27 Guillaume Lazzara <z(a)lrde.epita.fr> + Fix assertion failures on Mac. * mln/core/contract.hh: Cast expression to bool. diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh index a54b62a..cbae9fd 100644 --- a/milena/mln/core/site_set/p_vertices.hh +++ b/milena/mln/core/site_set/p_vertices.hh @@ -69,9 +69,11 @@ namespace mln typedef p_vertices<G, F> self_; typedef internal::site_set_base_< typename F::result, self_ > super_; + public: + + /// Type of the graph this site set is based on. typedef G graph_t; - public: /// \brief Construct a graph psite set from a graph of points. /// \{ p_vertices(); @@ -128,6 +130,7 @@ namespace mln /// \{ const mln_result(F)& operator()(const psite& p) const; const mln_result(F)& operator()(const util::vertex<G>& p) const; + const mln_result(F)& operator()(unsigned id_v) const; /// \} /// Accessors. @@ -266,9 +269,17 @@ namespace mln const mln_result(F)& p_vertices<G, F>::operator()(const util::vertex<G>& v) const { - std::cout << v.id() << std::endl; mln_precondition(g_->has_v(v)); - return f_(v.id()); + return (*this)(v.id()); + } + + template <typename G, typename F> + inline + const mln_result(F)& + p_vertices<G, F>::operator()(unsigned id_v) const + { + mln_precondition(g_->has_v(id_v)); + return f_(id_v); } template <typename G, typename F> diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh index 1cafb19..236edd2 100644 --- a/milena/mln/util/graph.hh +++ b/milena/mln/util/graph.hh @@ -152,6 +152,10 @@ namespace mln /// Check whether a vertex id \p id_v exists in the graph. bool has_v(unsigned id_v) const; + /// Check whether an edge \p v exists in the graph. + template <typename G> + bool has_v(const util::vertex<G>& v) const; + /// Return the number of adjacent edges of vertex \p id_v. size_t v_nmax_nbh_edges(unsigned id_v) const; @@ -185,6 +189,10 @@ namespace mln /// Return whether \p id_e is in the graph. bool has_e(unsigned id_e) const; + /// Return whether \p e is in the graph. + template <typename G> + bool has_e(const util::edge<G>& e) const; + /// Return the first vertex associated to the edge \p id_e. unsigned v1(unsigned id_e) const; @@ -199,7 +207,7 @@ namespace mln unsigned e_ith_nbh_edge(unsigned id_e, unsigned i) const; /// Return whether this graph is a subgraph - /// Return always false here. + /// Return true if g and *this have the same graph_id. template <typename G2> bool is_subgraph_of(const G2& g) const; /// \} @@ -277,6 +285,14 @@ namespace mln return id_v < data_->vertices_.size(); } + template <typename G> + inline + bool + graph::has_v(const util::vertex<G>& v) const + { + return v.graph().is_subgraph_of(*this) && has_v(v.id()); + } + inline size_t graph::v_nmax_nbh_edges(unsigned id_v) const @@ -368,6 +384,14 @@ namespace mln return id_e < data_->edges_.size(); } + template <typename G> + inline + bool + graph::has_e(const util::edge<G>& e) const + { + return e.graph().is_subgraph_of(*this) && has_e(e.id()); + } + inline unsigned graph::v1(unsigned id_e) const @@ -412,7 +436,7 @@ namespace mln bool graph::is_subgraph_of(const G2& g) const { - return &g == this; + return g.graph_id() == this->graph_id(); } } // end of namespace mln::util diff --git a/milena/mln/util/internal/graph_edge_psite.hh b/milena/mln/util/internal/graph_edge_psite.hh index 3861af6..05ad74f 100644 --- a/milena/mln/util/internal/graph_edge_psite.hh +++ b/milena/mln/util/internal/graph_edge_psite.hh @@ -69,6 +69,7 @@ namespace mln /// \{ edge_psite(); edge_psite(const target_t& t); + edge_psite(const target_t& t, unsigned); /// \} /// Accessors @@ -104,8 +105,15 @@ namespace mln template <typename G, typename F> inline edge_psite<G, F>::edge_psite(const target_t& t) + : super_(t) + { + } + + template <typename G, typename F> + inline + edge_psite<G, F>::edge_psite(const target_t& t, unsigned id) + : super_(id) { - this->change_target(t); } template <typename G, typename F> diff --git a/milena/mln/util/internal/graph_psite_base.hh b/milena/mln/util/internal/graph_psite_base.hh index 5a73135..38431a8 100644 --- a/milena/mln/util/internal/graph_psite_base.hh +++ b/milena/mln/util/internal/graph_psite_base.hh @@ -51,6 +51,7 @@ namespace mln public internal::proxy_impl<const P&, E> { typedef Pseudo_Site< graph_psite_base<V, P, S, E> > super; + typedef typename S::graph_t graph_t; public: /// Associated types. @@ -59,15 +60,6 @@ namespace mln typedef S target; /// \} - - /// Constructors. - /// \{ - graph_psite_base(); - /// \p t A site set. - /// \sa p_vertices, p_edges. - graph_psite_base(const target& t); - /// \} - /// Setters. /// \{ /// Change the targe site set. @@ -80,6 +72,12 @@ namespace mln /// Return the target (the site set). const target* target_() const; // Hook to the target. + /// Return the site set (the target). + const target& site_set() const; + + /// Return the graph associated to the target of this psite. + const graph_t& graph() const; + /// Check whether it is valid. bool is_valid() const; /// Invalidate this psite. @@ -96,12 +94,28 @@ namespace mln /// \} protected: + /// Constructors. + /// \{ + graph_psite_base(); + /// \p t A site set. + /// \sa p_vertices, p_edges. + graph_psite_base(const target& t); + /// \p t A site set. + /// \sa p_vertices, p_edges. + /// \p id The id of the element associated to this psite. + graph_psite_base(const target& t, unsigned id); + /// \} + mlc_const(target)* t_; V v_; }; } // end of namespace internal + template <typename V, typename P, typename S, typename E> + std::ostream& + operator<<(std::ostream& ostr, internal::graph_psite_base<V, P, S, E>& p); + } // end of namespace mln @@ -130,6 +144,15 @@ namespace mln template <typename V, typename P, typename S, typename E> inline + graph_psite_base<V, P, S, E>::graph_psite_base(const target& t, unsigned id) + : t_(0) + { + change_target(t); + update_id(id); + } + + template <typename V, typename P, typename S, typename E> + inline void graph_psite_base<V, P, S, E>::change_target(const target& new_target) { @@ -145,14 +168,30 @@ namespace mln v_.update_id(id); } - template <typename V, typename P, typename S, typename E> + template <typename v, typename p, typename s, typename e> inline - const typename graph_psite_base<V, P, S, E>::target* - graph_psite_base<V, P, S, E>::target_() const + const typename graph_psite_base<v, p, s, e>::target* + graph_psite_base<v, p, s, e>::target_() const { return t_; } + template <typename v, typename p, typename s, typename e> + inline + const typename graph_psite_base<v, p, s, e>::target& + graph_psite_base<v, p, s, e>::site_set() const + { + return *t_; + } + + template <typename v, typename p, typename s, typename e> + inline + const typename graph_psite_base<v, p, s, e>::graph_t& + graph_psite_base<v, p, s, e>::graph() const + { + return t_->graph(); + } + template <typename V, typename P, typename S, typename E> inline bool @@ -188,6 +227,13 @@ namespace mln } // end of namespace internal + template <typename V, typename P, typename S, typename E> + std::ostream& + operator<<(std::ostream& ostr, internal::graph_psite_base<V, P, S, E>& p) + { + return ostr << p.subj_(); + } + } // end of namespace mln # endif // !MLN_INCLUDE_ONLY diff --git a/milena/mln/util/internal/graph_vertex_psite.hh b/milena/mln/util/internal/graph_vertex_psite.hh index 3db903c..5f233e2 100644 --- a/milena/mln/util/internal/graph_vertex_psite.hh +++ b/milena/mln/util/internal/graph_vertex_psite.hh @@ -64,6 +64,7 @@ namespace mln vertex_psite(); vertex_psite(const target_t& t); + vertex_psite(const target_t& t, unsigned id); const vertex_t& v() const; @@ -93,8 +94,15 @@ namespace mln template <typename G, typename F> inline vertex_psite<G, F>::vertex_psite(const target_t& t) + : super_(t) + { + } + + template <typename G, typename F> + inline + vertex_psite<G, F>::vertex_psite(const target_t& t, unsigned i) + : super_(t, i) { - this->change_target(t); } template <typename G, typename F> -- 1.5.6.5
16 years, 2 months
1
0
0
0
2694: Fix assertion failures on Mac.
by Guillaume Lazzara
* mln/core/contract.hh: Cast expression to bool. --- milena/ChangeLog | 6 ++++++ milena/mln/core/contract.hh | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index aa7d3fa..048b97a 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -12,6 +12,12 @@ * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. +2008-10-27 Guillaume Lazzara <z(a)lrde.epita.fr> + + Fix assertion failures on Mac. + + * mln/core/contract.hh: Cast expression to bool. + 2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> Use a more explicit name for the method used to retrieve the graph diff --git a/milena/mln/core/contract.hh b/milena/mln/core/contract.hh index e7a1a3b..5d03057 100644 --- a/milena/mln/core/contract.hh +++ b/milena/mln/core/contract.hh @@ -46,16 +46,16 @@ #endif /// Assertion. -# define mln_assertion(expr) assert(expr) +# define mln_assertion(expr) assert((bool)(expr)) /// Invariant. -# define mln_invariant(expr) assert(expr) +# define mln_invariant(expr) assert((bool)(expr)) /// Precondition. -# define mln_precondition(expr) assert(expr) +# define mln_precondition(expr) assert((bool)(expr)) /// Postcondition. -# define mln_postcondition(expr) assert(expr) +# define mln_postcondition(expr) assert((bool)(expr)) namespace mln -- 1.5.6.5
16 years, 2 months
1
0
0
0
2693: Use a more explicit name for the method used to retrieve the graph pointer.
by Guillaume Lazzara
* mln/core/site_set/p_edges.hh, * mln/core/site_set/p_graph_piter.hh, * mln/core/site_set/p_vertices.hh, * mln/util/internal/graph_edge.hh, * mln/util/internal/graph_iter.hh, * mln/util/internal/graph_nbh_iter.hh, * mln/util/internal/graph_nbh_iter_base.hh, * mln/util/internal/graph_psite_base.hh, * mln/util/internal/graph_vertex.hh: Change the method name from g() to graph() and update method calls. --- milena/ChangeLog | 16 ++++++++ milena/mln/core/site_set/p_edges.hh | 6 +- milena/mln/core/site_set/p_graph_piter.hh | 2 +- milena/mln/core/site_set/p_vertices.hh | 47 +++++++++++++++++++--- milena/mln/util/internal/graph_edge.hh | 10 ++-- milena/mln/util/internal/graph_iter.hh | 4 +- milena/mln/util/internal/graph_nbh_iter.hh | 12 +++--- milena/mln/util/internal/graph_nbh_iter_base.hh | 4 +- milena/mln/util/internal/graph_psite_base.hh | 2 +- milena/mln/util/internal/graph_vertex.hh | 10 ++-- 10 files changed, 81 insertions(+), 32 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 4535ac6..aa7d3fa 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -14,6 +14,22 @@ 2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Use a more explicit name for the method used to retrieve the graph + pointer. + + * mln/core/site_set/p_edges.hh, + * mln/core/site_set/p_graph_piter.hh, + * mln/core/site_set/p_vertices.hh, + * mln/util/internal/graph_edge.hh, + * mln/util/internal/graph_iter.hh, + * mln/util/internal/graph_nbh_iter.hh, + * mln/util/internal/graph_nbh_iter_base.hh, + * mln/util/internal/graph_psite_base.hh, + * mln/util/internal/graph_vertex.hh: + Change the method name from g() to graph() and update method calls. + +2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Various small Fixes and cleanup. * mln/util/internal/graph_edge.hh, diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh index 16d7c45..6a62f8b 100644 --- a/milena/mln/core/site_set/p_edges.hh +++ b/milena/mln/core/site_set/p_edges.hh @@ -116,7 +116,7 @@ namespace mln /// Accessors. /// \{ /// Return the graph associated to this site set - const graph_t& g() const; + const graph_t& graph() const; /// Return the mapping function. F function() const; /// \} @@ -207,7 +207,7 @@ namespace mln p_edges<G, F>::has(const util::edge<G2>& e) const { mln_precondition(is_valid()); - return e.g().is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); + return e.graph().is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); } template <typename G, typename F> @@ -223,7 +223,7 @@ namespace mln template <typename G, typename F> inline const typename p_edges<G, F>::graph_t& - p_edges<G, F>::g() const + p_edges<G, F>::graph() const { mln_precondition(is_valid()); return *g_; diff --git a/milena/mln/core/site_set/p_graph_piter.hh b/milena/mln/core/site_set/p_graph_piter.hh index da5ae3d..886be0d 100644 --- a/milena/mln/core/site_set/p_graph_piter.hh +++ b/milena/mln/core/site_set/p_graph_piter.hh @@ -111,7 +111,7 @@ namespace mln template <typename S, typename I> inline p_graph_piter<S,I>::p_graph_piter(const S& pv) - : iter_(pv.g()) + : iter_(pv.graph()) { this->change_target(pv); mln_postcondition(!this->is_valid()); diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh index 371c581..a54b62a 100644 --- a/milena/mln/core/site_set/p_vertices.hh +++ b/milena/mln/core/site_set/p_vertices.hh @@ -73,12 +73,13 @@ namespace mln public: /// \brief Construct a graph psite set from a graph of points. - /// + /// \{ + p_vertices(); + /// \param gr The graph upon which the graph psite set is built. - /// - /// \a gr is \em copied internally, so that the graph psite set is - /// still valid after the initial graph has been removed. + /// \param f the function which maps a vertex to a site. p_vertices(const graph_t& gr, const F& f); + /// \} /// Associated types. /// \{ @@ -123,10 +124,16 @@ namespace mln // FIXME: Dummy. std::size_t memory_size() const; + /// Return the value associated to an element of this site set. + /// \{ + const mln_result(F)& operator()(const psite& p) const; + const mln_result(F)& operator()(const util::vertex<G>& p) const; + /// \} + /// Accessors. /// \{ /// Return the graph associated to this site set (const version) - const graph_t& g() const; + const graph_t& graph() const; /// Return the association function. F function() const; /// \} @@ -167,6 +174,13 @@ namespace mln template <typename G, typename F> inline + p_vertices<G, F>::p_vertices() + : f_(0) + { + } + + template <typename G, typename F> + inline p_vertices<G, F>::p_vertices(const graph_t& g, const F& f) : g_ (&g), f_(f) { @@ -222,7 +236,7 @@ namespace mln mln_precondition(is_valid()); return // Check whether P is compatible with this psite set. - (p.g() == *g_) && + (p.graph() == *g_) && // Check that the vertex id of P belongs to the range of valid // vertex ids. (p.is_valid()); @@ -240,8 +254,27 @@ namespace mln template <typename G, typename F> inline + const mln_result(F)& + p_vertices<G, F>::operator()(const psite& p) const + { + mln_precondition(g_.has(p.v())); + return (*this)(p.v().id()); + } + + template <typename G, typename F> + inline + const mln_result(F)& + p_vertices<G, F>::operator()(const util::vertex<G>& v) const + { + std::cout << v.id() << std::endl; + mln_precondition(g_->has_v(v)); + return f_(v.id()); + } + + template <typename G, typename F> + inline const typename p_vertices<G, F>::graph_t& - p_vertices<G, F>::g() const + p_vertices<G, F>::graph() const { mln_precondition(is_valid()); return *g_; diff --git a/milena/mln/util/internal/graph_edge.hh b/milena/mln/util/internal/graph_edge.hh index 510bfd9..06e39d4 100644 --- a/milena/mln/util/internal/graph_edge.hh +++ b/milena/mln/util/internal/graph_edge.hh @@ -74,7 +74,7 @@ namespace mln void update_id(unsigned id); /// Return a reference to the graph holding this edge. - const graph_t& g() const; + const graph_t& graph() const; /// Set g_ with \p g; void change_graph(const graph_t& g); @@ -129,7 +129,7 @@ namespace mln struct subject_impl< const util::edge<G>, E > { unsigned id() const; - const mlc_const(G)& g() const; + const mlc_const(G)& graph() const; unsigned v_other(unsigned id_v) const; bool is_valid() const; unsigned v1() const; @@ -208,7 +208,7 @@ namespace mln template <typename G> inline const typename edge<G>::graph_t& - edge<G>::g() const + edge<G>::graph() const { return g_; } @@ -329,9 +329,9 @@ namespace mln template <typename G, typename E> inline const mlc_const(G)& - subject_impl< const util::edge<G>, E >::g() const + subject_impl< const util::edge<G>, E >::graph() const { - return exact_().get_subject().g(); + return exact_().get_subject().graph(); } template <typename G, typename E> diff --git a/milena/mln/util/internal/graph_iter.hh b/milena/mln/util/internal/graph_iter.hh index ab62582..dfd1333 100644 --- a/milena/mln/util/internal/graph_iter.hh +++ b/milena/mln/util/internal/graph_iter.hh @@ -207,7 +207,7 @@ namespace mln unsigned vertex_bkd_iterator<G>::start_id_() const { - return p_.g().v_nmax() - 1; + return p_.graph().v_nmax() - 1; } template <typename G> @@ -277,7 +277,7 @@ namespace mln unsigned edge_bkd_iterator<G>::start_id_() const { - return p_.g().e_nmax() - 1; + return p_.graph().e_nmax() - 1; } template <typename G> diff --git a/milena/mln/util/internal/graph_nbh_iter.hh b/milena/mln/util/internal/graph_nbh_iter.hh index 5edecef..9b7aa3a 100644 --- a/milena/mln/util/internal/graph_nbh_iter.hh +++ b/milena/mln/util/internal/graph_nbh_iter.hh @@ -314,7 +314,7 @@ namespace mln void vertex_nbh_vertex_fwd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().v_nmax(); + this->i_ = this->p_.graph().v_nmax(); } template <typename G> @@ -367,7 +367,7 @@ namespace mln void vertex_nbh_vertex_bkd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().v_nmax(); + this->i_ = this->p_.graph().v_nmax(); } template <typename G> @@ -420,7 +420,7 @@ namespace mln void vertex_nbh_edge_fwd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().e_nmax(); + this->i_ = this->p_.graph().e_nmax(); } template <typename G> @@ -472,7 +472,7 @@ namespace mln void vertex_nbh_edge_bkd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().e_nmax(); + this->i_ = this->p_.graph().e_nmax(); } template <typename G> @@ -526,7 +526,7 @@ namespace mln void edge_nbh_edge_fwd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().e_nmax(); + this->i_ = this->p_.graph().e_nmax(); } template <typename G> @@ -588,7 +588,7 @@ namespace mln void edge_nbh_edge_bkd_iterator<G>::invalidate_() { - this->i_ = this->p_.g().e_nmax(); + this->i_ = this->p_.graph().e_nmax(); } template <typename G> diff --git a/milena/mln/util/internal/graph_nbh_iter_base.hh b/milena/mln/util/internal/graph_nbh_iter_base.hh index 8cfcdd6..14950a1 100644 --- a/milena/mln/util/internal/graph_nbh_iter_base.hh +++ b/milena/mln/util/internal/graph_nbh_iter_base.hh @@ -90,9 +90,9 @@ namespace mln template <typename C2> inline nbh_iterator_base<G, C, P, E>::nbh_iterator_base(const C2& c) - : p_(c.g()), i_(0) + : p_(c.graph()), i_(0) { - //FIXME: Check if typeof(e.g()) == G + //FIXME: Check if typeof(c.graph()) == G center_at(c); } diff --git a/milena/mln/util/internal/graph_psite_base.hh b/milena/mln/util/internal/graph_psite_base.hh index fa0fb80..5a73135 100644 --- a/milena/mln/util/internal/graph_psite_base.hh +++ b/milena/mln/util/internal/graph_psite_base.hh @@ -134,7 +134,7 @@ namespace mln graph_psite_base<V, P, S, E>::change_target(const target& new_target) { t_ = &new_target; - v_.change_graph(new_target.g()); + v_.change_graph(new_target.graph()); } template <typename V, typename P, typename S, typename E> diff --git a/milena/mln/util/internal/graph_vertex.hh b/milena/mln/util/internal/graph_vertex.hh index 61b589f..2de8dde 100644 --- a/milena/mln/util/internal/graph_vertex.hh +++ b/milena/mln/util/internal/graph_vertex.hh @@ -82,7 +82,7 @@ namespace mln void update_id(unsigned id); /// Returns the graph pointer this vertex belongs to. - const graph_t& g() const; + const graph_t& graph() const; /// Returns vertex id. unsigned id() const; @@ -113,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)& graph() const; unsigned id() const; unsigned other(unsigned id_e) const; @@ -275,7 +275,7 @@ namespace mln template<typename G> inline const typename vertex<G>::graph_t& - vertex<G>::g() const + vertex<G>::graph() const { return g_; } @@ -312,9 +312,9 @@ namespace mln template <typename G, typename E> inline const mlc_const(G)& - subject_impl< const util::vertex<G>, E >::g() const + subject_impl< const util::vertex<G>, E >::graph() const { - return exact_().get_subject().g(); + return exact_().get_subject().graph(); } template <typename G, typename E> -- 1.5.6.5
16 years, 2 months
1
0
0
0
2692: Various small Fixes and cleanup.
by Guillaume Lazzara
* mln/util/internal/graph_edge.hh, * mln/util/internal/graph_base.hh, * mln/core/site_set/p_edges.hh, * mln/core/site_set/p_vertices.hh: fix compilation issues. * mln/fun/i2v/array.hh, * mln/pw/image.hh, * mln/core/site_set/p_graph_piter.hh: cleanup. * mln/util/internal/graph_vertex_psite.hh, * mln/util/graph.hh: fix wrong include. * tests/core/site_set/pset_if.cc: use geom::nsites() instead of estim::nsites(). --- milena/ChangeLog | 19 +++ milena/mln/core/site_set/p_edges.hh | 2 +- milena/mln/core/site_set/p_graph_piter.hh | 140 +----------------------- milena/mln/core/site_set/p_vertices.hh | 6 +- milena/mln/fun/i2v/array.hh | 2 +- milena/mln/pw/image.hh | 2 +- milena/mln/util/graph.hh | 3 +- milena/mln/util/internal/graph_base.hh | 23 +++- milena/mln/util/internal/graph_edge.hh | 2 +- milena/mln/util/internal/graph_vertex_psite.hh | 1 + milena/tests/core/site_set/pset_if.cc | 4 +- 11 files changed, 49 insertions(+), 155 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index b0a73d6..4535ac6 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -14,6 +14,25 @@ 2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Various small Fixes and cleanup. + + * mln/util/internal/graph_edge.hh, + * mln/util/internal/graph_base.hh, + * mln/core/site_set/p_edges.hh, + * mln/core/site_set/p_vertices.hh: fix compilation issues. + + * mln/fun/i2v/array.hh, + * mln/pw/image.hh, + * mln/core/site_set/p_graph_piter.hh: cleanup. + + * mln/util/internal/graph_vertex_psite.hh, + * mln/util/graph.hh: fix wrong include. + + * tests/core/site_set/pset_if.cc: use geom::nsites() instead of + estim::nsites(). + +2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + Change return type of Site_set::nsites() from unsigned to std:size_t. * mln/core/concept/box.hh, diff --git a/milena/mln/core/site_set/p_edges.hh b/milena/mln/core/site_set/p_edges.hh index 3c94998..16d7c45 100644 --- a/milena/mln/core/site_set/p_edges.hh +++ b/milena/mln/core/site_set/p_edges.hh @@ -207,7 +207,7 @@ namespace mln p_edges<G, F>::has(const util::edge<G2>& e) const { mln_precondition(is_valid()); - return e.g()->is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); + return e.g().is_subgraph_of(*g_) && g_->has(e) && e.is_valid(); } template <typename G, typename F> diff --git a/milena/mln/core/site_set/p_graph_piter.hh b/milena/mln/core/site_set/p_graph_piter.hh index 2a235c5..da5ae3d 100644 --- a/milena/mln/core/site_set/p_graph_piter.hh +++ b/milena/mln/core/site_set/p_graph_piter.hh @@ -35,10 +35,6 @@ //# include <mln/core/site_set/p_graph.hh> //# include <mln/core/image/graph_psite.hh> -/* FIXME: Iterators on p_graph and p_line_graph share common code. - Factor as much as possible. */ - - namespace mln { // Fwd decls. @@ -49,7 +45,7 @@ namespace mln | p_graph_piter<S,I>. | `------------------------*/ - /// \brief Forward iterator on point sites of a mln::S. + /// \brief Generic iterator on point sites of a mln::S. template <typename S, typename I> class p_graph_piter : public internal::site_set_iterator_base< S, @@ -99,66 +95,11 @@ namespace mln operator<<(std::ostream& ostr, const p_graph_piter<S,I>& p); - /*------------------------. - | p_graph_bkd_piter_<S,I>. | - `------------------------*/ - - /// \brief Backward iterator on point sites of a mln::S. -/* template <typename S, typename I> - class p_graph_bkd_piter_ - : public internal::site_set_iterator_base< S, - p_graph_bkd_piter_<S,I> > - { - typedef p_graph_bkd_piter_<S,I> self_; - typedef internal::site_set_iterator_base< S, self_ > super_; - typedef I iter; - - public: - /// Construction and assignment. - /// \{ - p_graph_bkd_piter_(); - p_graph_bkd_piter_(const S& pv); - /// \} - - /// Manipulation. - /// \{ - /// Test if the iterator is valid. - bool is_valid_() const; - /// Invalidate the iterator. - void invalidate_(); - - /// Start an iteration. - void start_(); - /// Go to the next point. - void next_(); - /// \} - - private: - /// Update the psite corresponding to this iterator. - void update_(); - - private: - /// The psite corresponding to this iterator. - using super_::p_; - - /// The underlying vertex iterator. - iter iter_; - }; - - - /// Print an mln::p_graph_bkd_piter_<S,I>. - template <typename S, typename I> - inline - std::ostream& - operator<<(std::ostream& ostr, const p_graph_bkd_piter_<S,I>& p); -*/ - - # ifndef MLN_INCLUDE_ONLY - /*------------------------. + /*---------------------. | p_graph_piter<S,I>. | - `------------------------*/ + `---------------------*/ template <typename S, typename I> inline @@ -232,81 +173,6 @@ namespace mln return ostr << p.unproxy_(); } - - /*------------------------. - | p_graph_bkd_piter_<S,I>. | - `------------------------*/ - -/* template <typename S, typename I> - inline - p_graph_bkd_piter_<S,I>::p_graph_bkd_piter_() - { - mln_postcondition(!this->is_valid()); - } - - template <typename S, typename I> - inline - p_graph_bkd_piter_<S,I>::p_graph_bkd_piter_(const S& pv) - : iter_(pv.g()) - { - this->change_target(pv); - mln_postcondition(!this->is_valid()); - } - - template <typename S, typename I> - inline - bool - p_graph_bkd_piter_<S,I>::is_valid_() const - { - return p_.is_valid(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::invalidate_() - { - p_.invalidate(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::start_() - { - iter_.start(); - if (this->is_valid()) - update_(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::next_() - { - iter_.next(); - if (this->is_valid()) - update_(); - } - - template <typename S, typename I> - inline - void - p_graph_bkd_piter_<S,I>::update_() - { - mln_precondition(this->is_valid()); - // Update psite_. - p_.update_id(iter_.id()); - } - - template <typename S, typename I> - inline - std::ostream& - operator<<(std::ostream& ostr, const p_graph_bkd_piter_<S,I>& p) - { - return ostr << p.unproxy_(); - } -*/ # endif // ! MLN_INCLUDE_ONLY } // end of mln diff --git a/milena/mln/core/site_set/p_vertices.hh b/milena/mln/core/site_set/p_vertices.hh index 461bd51..371c581 100644 --- a/milena/mln/core/site_set/p_vertices.hh +++ b/milena/mln/core/site_set/p_vertices.hh @@ -222,7 +222,7 @@ namespace mln mln_precondition(is_valid()); return // Check whether P is compatible with this psite set. - (p.g() == g_) && + (p.g() == *g_) && // Check that the vertex id of P belongs to the range of valid // vertex ids. (p.is_valid()); @@ -259,10 +259,6 @@ namespace mln bool operator==(const p_vertices<G, F>& lhs, const p_vertices<G, F>& rhs) { - /* FIXME: We should not rely on pointer equality here, as graph - will soon become shells using (shared) tracked pointers to - actual data. So, delegate the equality test to the graphs - themselves. */ return (*lhs.g_) == (*rhs.g_); } diff --git a/milena/mln/fun/i2v/array.hh b/milena/mln/fun/i2v/array.hh index 3fb026c..219be8a 100644 --- a/milena/mln/fun/i2v/array.hh +++ b/milena/mln/fun/i2v/array.hh @@ -62,7 +62,7 @@ namespace mln T operator()(unsigned i) const; T& operator()(unsigned i); - + private: std::vector<T> v_; }; diff --git a/milena/mln/pw/image.hh b/milena/mln/pw/image.hh index 624fc11..ba07d40 100644 --- a/milena/mln/pw/image.hh +++ b/milena/mln/pw/image.hh @@ -259,7 +259,7 @@ namespace mln template <typename F, typename S> inline mln_result(F) - image<F,S>::operator()(const mln_psite(S)& p) const + image<F,S>::operator()(const mln_psite(S)& p) const { mln_precondition(this->data_->pset_.has(p)); return this->data_->f_(p); diff --git a/milena/mln/util/graph.hh b/milena/mln/util/graph.hh index aecb8e9..1cafb19 100644 --- a/milena/mln/util/graph.hh +++ b/milena/mln/util/graph.hh @@ -33,7 +33,7 @@ # include <mln/util/internal/graph_base.hh> # include <mln/util/internal/graph_iter.hh> -# include <mln/util/internal/graph_nbh_iter_base.hh> +# include <mln/util/internal/graph_nbh_iter.hh> # include <mln/util/ord_pair.hh> namespace mln @@ -210,7 +210,6 @@ namespace mln } // end of namespace mln - # ifndef MLN_INCLUDE_ONLY namespace mln diff --git a/milena/mln/util/internal/graph_base.hh b/milena/mln/util/internal/graph_base.hh index d98c6ff..2937258 100644 --- a/milena/mln/util/internal/graph_base.hh +++ b/milena/mln/util/internal/graph_base.hh @@ -125,8 +125,14 @@ namespace mln }; } // end of namespace mln::util::internal + } // End of namespace mln::util + template <typename E> + bool + operator==(const util::internal::graph_base<E>& lhs, + const util::internal::graph_base<E>& rhs); + # ifndef MLN_INCLUDE_ONLY namespace util @@ -186,7 +192,7 @@ namespace mln bool graph_base<E>::has(const util::vertex<E>& v) const { - return has_v(v.id()); + return exact(this)->has_v(v.id()); } /*--------------. @@ -198,7 +204,7 @@ namespace mln bool graph_base<E>::has(const util::edge<E>& e) const { - return has_e(e.id()); + return exact(this)->has_e(e.id()); } /*--------. @@ -216,15 +222,14 @@ namespace mln for (unsigned v = 0; v < g->v_nmax(); ++v) { ostr << "vertex: " << v << std::endl << " -- adjacent vertices: "; - for (int n = 0; n < g->v_nmax_nbh_vertices(v); ++n) + for (unsigned 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 (int i = 0; i < g->e_nmax(); ++i) + for (unsigned i = 0; i < g->e_nmax(); ++i) ostr << "edge " << i << ": (" << g->v1(i) << ", " << g->v2(i) << " )" @@ -237,6 +242,14 @@ namespace mln # endif // ! MLN_INCLUDE_ONLY + template <typename E> + inline + bool + operator==(const util::internal::graph_base<E>& lhs, + const util::internal::graph_base<E>& rhs) + { + return lhs.graph_id() == rhs.graph_id(); + } } // end of namespace mln diff --git a/milena/mln/util/internal/graph_edge.hh b/milena/mln/util/internal/graph_edge.hh index 42d0e62..510bfd9 100644 --- a/milena/mln/util/internal/graph_edge.hh +++ b/milena/mln/util/internal/graph_edge.hh @@ -170,7 +170,7 @@ namespace mln template <typename G> inline edge<G>::edge() - : g_(0), id_(0) + : id_(0) { } diff --git a/milena/mln/util/internal/graph_vertex_psite.hh b/milena/mln/util/internal/graph_vertex_psite.hh index b0b57cd..3db903c 100644 --- a/milena/mln/util/internal/graph_vertex_psite.hh +++ b/milena/mln/util/internal/graph_vertex_psite.hh @@ -30,6 +30,7 @@ # include <mln/core/concept/pseudo_site.hh> # include <mln/util/internal/graph_psite_base.hh> +# include <mln/util/internal/graph_vertex.hh> namespace mln { diff --git a/milena/tests/core/site_set/pset_if.cc b/milena/tests/core/site_set/pset_if.cc index b4a9469..9918f56 100644 --- a/milena/tests/core/site_set/pset_if.cc +++ b/milena/tests/core/site_set/pset_if.cc @@ -36,7 +36,7 @@ #include <mln/fun/p2b/chess.hh> #include <mln/convert/to_image.hh> #include <mln/convert/to_p_set.hh> -#include <mln/estim/nsites.hh> +#include <mln/geom/nsites.hh> int main() @@ -44,7 +44,7 @@ int main() using namespace mln; box2d box_8x8 = make::box2d(8, 8); - mln_assertion(estim::nsites((box_8x8 | fun::p2b::chess)) == 32); + mln_assertion(geom::nsites((box_8x8 | fun::p2b::chess)) == 32); { p_set<point2d> s = convert::to_p_set(box_8x8 | fun::p2b::chess); -- 1.5.6.5
16 years, 2 months
1
0
0
0
2691: Change return type of Site_set::nsites() from unsigned to std:size_t.
by Guillaume Lazzara
* mln/core/concept/box.hh, * mln/core/concept/site_set.hh, * mln/core/site_set/p_array.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_image.hh, * mln/core/site_set/p_key.hh, * mln/core/site_set/p_line2d.hh, * mln/core/site_set/p_line_graph.hh, * mln/core/site_set/p_priority.hh, * mln/core/site_set/p_queue.hh, * mln/core/site_set/p_queue_fast.hh, * mln/core/site_set/p_run.hh, * mln/core/site_set/p_set.hh: Update declarations. --- milena/ChangeLog | 21 +++++++++++++++++++++ milena/mln/core/concept/box.hh | 6 +++--- milena/mln/core/concept/site_set.hh | 3 +-- milena/mln/core/site_set/p_array.hh | 4 ++-- milena/mln/core/site_set/p_complex.hh | 4 ++-- milena/mln/core/site_set/p_faces.hh | 4 ++-- milena/mln/core/site_set/p_graph.hh | 4 ++-- milena/mln/core/site_set/p_image.hh | 6 +++--- milena/mln/core/site_set/p_key.hh | 6 +++--- milena/mln/core/site_set/p_line2d.hh | 4 ++-- milena/mln/core/site_set/p_line_graph.hh | 4 ++-- milena/mln/core/site_set/p_priority.hh | 6 +++--- milena/mln/core/site_set/p_queue.hh | 4 ++-- milena/mln/core/site_set/p_queue_fast.hh | 4 ++-- milena/mln/core/site_set/p_run.hh | 6 +++--- milena/mln/core/site_set/p_set.hh | 4 ++-- 16 files changed, 55 insertions(+), 35 deletions(-) diff --git a/milena/ChangeLog b/milena/ChangeLog index 2c1de6a..b0a73d6 100644 --- a/milena/ChangeLog +++ b/milena/ChangeLog @@ -12,6 +12,27 @@ * mln/level/transform.hh, * mln/level/paste.hh: Rename routines. +2008-10-26 Guillaume Lazzara <z(a)lrde.epita.fr> + + Change return type of Site_set::nsites() from unsigned to std:size_t. + + * mln/core/concept/box.hh, + * mln/core/concept/site_set.hh, + * mln/core/site_set/p_array.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_image.hh, + * mln/core/site_set/p_key.hh, + * mln/core/site_set/p_line2d.hh, + * mln/core/site_set/p_line_graph.hh, + * mln/core/site_set/p_priority.hh, + * mln/core/site_set/p_queue.hh, + * mln/core/site_set/p_queue_fast.hh, + * mln/core/site_set/p_run.hh, + * mln/core/site_set/p_set.hh: + Update declarations. + 2008-10-24 Roland Levillain <roland(a)lrde.epita.fr> Fix mln::level::stretch w.r.t. the initialization. diff --git a/milena/mln/core/concept/box.hh b/milena/mln/core/concept/box.hh index 607372e..aabb8a7 100644 --- a/milena/mln/core/concept/box.hh +++ b/milena/mln/core/concept/box.hh @@ -82,7 +82,7 @@ namespace mln * * \warning This method is final for all box classes. */ - unsigned nsites() const; + std::size_t nsites() const; protected: Box(); @@ -157,12 +157,12 @@ namespace mln template <typename E> inline - unsigned + std::size_t Box<E>::nsites() const { if (! exact(this)->is_valid()) return 0; - unsigned count = 1; + std::size_t count = 1; typedef mln_site(E) P; // Helps g++-3.3.5. for (unsigned i = 0; i < P::dim; ++i) count *= exact(this)->len(i); diff --git a/milena/mln/core/concept/site_set.hh b/milena/mln/core/concept/site_set.hh index 40b288e..dff5a11 100644 --- a/milena/mln/core/concept/site_set.hh +++ b/milena/mln/core/concept/site_set.hh @@ -186,8 +186,7 @@ namespace mln { static void run() { - // FIXME: Return type should be std::size_t. - unsigned (E::*m)() const = & E::nsites; + std::size_t (E::*m)() const = & E::nsites; m = 0; } }; diff --git a/milena/mln/core/site_set/p_array.hh b/milena/mln/core/site_set/p_array.hh index 7e0a95b..31fa521 100644 --- a/milena/mln/core/site_set/p_array.hh +++ b/milena/mln/core/site_set/p_array.hh @@ -125,7 +125,7 @@ namespace mln void change(const psite& p, const P& new_p); /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Append a point \p p. @@ -383,7 +383,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_array<P>::nsites() const { return vect_.size(); diff --git a/milena/mln/core/site_set/p_complex.hh b/milena/mln/core/site_set/p_complex.hh index 7b5e815..5f5c656 100644 --- a/milena/mln/core/site_set/p_complex.hh +++ b/milena/mln/core/site_set/p_complex.hh @@ -149,7 +149,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -236,7 +236,7 @@ namespace mln template <unsigned D, typename G> inline - unsigned + std::size_t p_complex<D, G>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_faces.hh b/milena/mln/core/site_set/p_faces.hh index 0d79798..5827ad4 100644 --- a/milena/mln/core/site_set/p_faces.hh +++ b/milena/mln/core/site_set/p_faces.hh @@ -120,7 +120,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of faces in the complex. std::size_t nfaces() const; @@ -212,7 +212,7 @@ namespace mln template <unsigned N, unsigned D, typename P> inline - unsigned + std::size_t p_faces<N, D, P>::nsites() const { return nfaces(); diff --git a/milena/mln/core/site_set/p_graph.hh b/milena/mln/core/site_set/p_graph.hh index b530152..6146d6f 100644 --- a/milena/mln/core/site_set/p_graph.hh +++ b/milena/mln/core/site_set/p_graph.hh @@ -104,7 +104,7 @@ namespace mln /// Required by the mln::Point_Set concept. /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -208,7 +208,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_graph<P>::nsites() const { return nvertices(); diff --git a/milena/mln/core/site_set/p_image.hh b/milena/mln/core/site_set/p_image.hh index 930de2e..b3d9511 100644 --- a/milena/mln/core/site_set/p_image.hh +++ b/milena/mln/core/site_set/p_image.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -149,7 +149,7 @@ namespace mln private: I ima_; - unsigned nsites_; + std::size_t nsites_; }; @@ -198,7 +198,7 @@ namespace mln template <typename I> inline - unsigned + std::size_t p_image<I>::nsites() const { return nsites_; diff --git a/milena/mln/core/site_set/p_key.hh b/milena/mln/core/site_set/p_key.hh index 4b416be..7b294b9 100644 --- a/milena/mln/core/site_set/p_key.hh +++ b/milena/mln/core/site_set/p_key.hh @@ -115,7 +115,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln k_t k_; // Number of sites. - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -245,7 +245,7 @@ namespace mln template <typename K, typename P> inline - unsigned + std::size_t p_key<K,P>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_line2d.hh b/milena/mln/core/site_set/p_line2d.hh index 9ad9549..262c2f0 100644 --- a/milena/mln/core/site_set/p_line2d.hh +++ b/milena/mln/core/site_set/p_line2d.hh @@ -112,7 +112,7 @@ namespace mln /// Give the number of points. - unsigned nsites() const; + std::size_t nsites() const; /// Give the point that begins the line. const point2d& begin() const; @@ -252,7 +252,7 @@ namespace mln } inline - unsigned + std::size_t p_line2d::nsites() const { return arr_.nsites(); diff --git a/milena/mln/core/site_set/p_line_graph.hh b/milena/mln/core/site_set/p_line_graph.hh index b9a3ed0..0cd6680 100644 --- a/milena/mln/core/site_set/p_line_graph.hh +++ b/milena/mln/core/site_set/p_line_graph.hh @@ -109,7 +109,7 @@ namespace mln /// `known'.) /* FIXME: Return type should be std::size_t (see mln/core/concept/site_set.hh). */ - unsigned nsites() const; + std::size_t nsites() const; /// Return The number of vertices in the graph. std::size_t nvertices() const; @@ -196,7 +196,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_line_graph<P>::nsites() const { return nedges(); diff --git a/milena/mln/core/site_set/p_priority.hh b/milena/mln/core/site_set/p_priority.hh index 147dece..3a630cf 100644 --- a/milena/mln/core/site_set/p_priority.hh +++ b/milena/mln/core/site_set/p_priority.hh @@ -114,7 +114,7 @@ namespace mln bool is_valid() const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push in the queue with \p priority the element \p e. @@ -181,7 +181,7 @@ namespace mln util::set<P> p_; q_type_ q_; - unsigned n_; + std::size_t n_; // Run invariance tests and return the result. bool run_() const; @@ -225,7 +225,7 @@ namespace mln template <typename P, typename Q> inline - unsigned + std::size_t p_priority<P,Q>::nsites() const { mln_invariant(run_()); diff --git a/milena/mln/core/site_set/p_queue.hh b/milena/mln/core/site_set/p_queue.hh index babc994..8692f57 100644 --- a/milena/mln/core/site_set/p_queue.hh +++ b/milena/mln/core/site_set/p_queue.hh @@ -108,7 +108,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -195,7 +195,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue<P>::nsites() const { return q_.size(); diff --git a/milena/mln/core/site_set/p_queue_fast.hh b/milena/mln/core/site_set/p_queue_fast.hh index 199edc4..54f8146 100644 --- a/milena/mln/core/site_set/p_queue_fast.hh +++ b/milena/mln/core/site_set/p_queue_fast.hh @@ -110,7 +110,7 @@ namespace mln bool compute_has(const P& p) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Push a site \p p in the queue. @@ -236,7 +236,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_queue_fast<P>::nsites() const { mln_invariant(end_ >= begin_); diff --git a/milena/mln/core/site_set/p_run.hh b/milena/mln/core/site_set/p_run.hh index 21644eb..f618d89 100644 --- a/milena/mln/core/site_set/p_run.hh +++ b/milena/mln/core/site_set/p_run.hh @@ -128,7 +128,7 @@ namespace mln bool has_index(unsigned short i) const; /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Give the length of the run. unsigned short length() const; @@ -162,7 +162,7 @@ namespace mln P start_; /// The length of the run. - unsigned short len_; + std::size_t len_; }; @@ -307,7 +307,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_run<P>::nsites() const { mln_precondition(is_valid()); diff --git a/milena/mln/core/site_set/p_set.hh b/milena/mln/core/site_set/p_set.hh index 817d56b..041b4a2 100644 --- a/milena/mln/core/site_set/p_set.hh +++ b/milena/mln/core/site_set/p_set.hh @@ -107,7 +107,7 @@ namespace mln /// Give the number of sites. - unsigned nsites() const; + std::size_t nsites() const; /// Insertion element associated type. @@ -192,7 +192,7 @@ namespace mln template <typename P> inline - unsigned + std::size_t p_set<P>::nsites() const { return s_.nelements(); -- 1.5.6.5
16 years, 2 months
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
38
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Results per page:
10
25
50
100
200