Commit 1181a392 authored by Thierry Geraud's avatar Thierry Geraud
Browse files

Rename pset_if as p_if and remove Q at end of priority_Q.

	* mln/core/site_set/pset_if.hh,
	* mln/core/pset_if_piter.hh: Rename as...
	* mln/core/site_set/p_if.hh,
	* mln/core/site_set/p_if_piter.hh: ...these.
	* mln/core/site_set/p_priority_queue.hh: Rename as...
	* mln/core/site_set/p_priority.hh: ...this.
	
	* tests/core/p_priority_queue.cc,
	* tests/core/p_priority_queue_fast_with_array.cc,
	* tests/core/pset_if.cc,
	* tests/core/p_priority_queue_fast.cc,
	* tests/convert/to_image.cc,
	* doc/tutorial/examples/image_if.cc,
	* doc/tutorial/examples/p_queue.cc,
	* mln/core/site_set/p_image.hh,
	* mln/core/image/image_if.hh,
	* mln/core/internal/image_if_base.hh,
	* mln/draw/label.hh,
	* mln/geom/seeds2tiling_roundness.hh,
	* mln/morpho/meyer_wst.hh,
	* sandbox/pellegrin/set/test/p_priority_queue_fast.cc,
	* sandbox/pellegrin/set/test/p_priority_queue.cc,
	* sandbox/pellegrin/set/test/pset_if.cc,
	* sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc,
	* sandbox/pellegrin/set/trait/point_set.hh,
	* sandbox/pellegrin/set/core/p_priority_queue_fast.hh,
	* sandbox/pellegrin/set/core/pset_if.hh,
	* sandbox/pellegrin/set/core/concept/point_set.hh,
	* sandbox/pellegrin/set/core/p_priority_queue.hh,
	* sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh,
	* sandbox/garrigues/level_set.hh,
	* sandbox/garrigues/fllt/fllt.hh: Update.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/branches/cleanup-2008@2176 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 4f0f6730
2008-09-04 Thierry Geraud <thierry.geraud@lrde.epita.fr>
Rename pset_if as p_if and remove Q at end of priority_Q.
* mln/core/site_set/pset_if.hh,
* mln/core/pset_if_piter.hh: Rename as...
* mln/core/site_set/p_if.hh,
* mln/core/site_set/p_if_piter.hh: ...these.
* mln/core/site_set/p_priority_queue.hh: Rename as...
* mln/core/site_set/p_priority.hh: ...this.
* tests/core/p_priority_queue.cc,
* tests/core/p_priority_queue_fast_with_array.cc,
* tests/core/pset_if.cc,
* tests/core/p_priority_queue_fast.cc,
* tests/convert/to_image.cc,
* doc/tutorial/examples/image_if.cc,
* doc/tutorial/examples/p_queue.cc,
* mln/core/site_set/p_image.hh,
* mln/core/image/image_if.hh,
* mln/core/internal/image_if_base.hh,
* mln/draw/label.hh,
* mln/geom/seeds2tiling_roundness.hh,
* mln/morpho/meyer_wst.hh,
* sandbox/pellegrin/set/test/p_priority_queue_fast.cc,
* sandbox/pellegrin/set/test/p_priority_queue.cc,
* sandbox/pellegrin/set/test/pset_if.cc,
* sandbox/pellegrin/set/test/p_priority_queue_fast_with_array.cc,
* sandbox/pellegrin/set/trait/point_set.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast.hh,
* sandbox/pellegrin/set/core/pset_if.hh,
* sandbox/pellegrin/set/core/concept/point_set.hh,
* sandbox/pellegrin/set/core/p_priority_queue.hh,
* sandbox/pellegrin/set/core/p_priority_queue_fast_with_array.hh,
* sandbox/garrigues/level_set.hh,
* sandbox/garrigues/fllt/fllt.hh: Update.
2008-09-04 Thierry Geraud <thierry.geraud@lrde.epita.fr>
 
Remove some obsolete files in mln/core/.
......
......@@ -71,7 +71,7 @@ int main()
trait::image::print(ima_);
std::cout << std::endl;
typedef pset_if<box2d, fun::p2b::chess_t> S;
typedef p_if<box2d, fun::p2b::chess_t> S;
ch_target(mln_fwd_piter_(S)(), ima_.domain());
// mln_VAR(ima_e, extend(ima_, pw::value(ima)));
......
......@@ -4,7 +4,7 @@
# include <mln/debug/println.hh>
# include <mln/level/fill.hh>
# include <mln/core/site_set/p_priority_queue.hh>
# include <mln/core/site_set/p_priority.hh>
......
......@@ -37,7 +37,7 @@
*/
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/site_set/p_if.hh>
# include <mln/pw/all.hh>
......@@ -58,7 +58,7 @@ namespace mln
data(I& ima, const F& f);
I ima_;
pset_if<mln_pset(I), F> pset_;
p_if<mln_pset(I), F> pset_;
};
} // end of namespace mln::internal
......@@ -90,7 +90,7 @@ namespace mln
*/
template <typename I, typename F>
struct image_if : public internal::image_domain_morpher< I,
pset_if<mln_pset(I), F>,
p_if<mln_pset(I), F>,
image_if<I, F> >
{
/// Skeleton.
......@@ -105,7 +105,7 @@ namespace mln
void init_(I& ima, const F& f);
/// Give the definition domain.
const pset_if<mln_pset(I), F>& domain() const;
const p_if<mln_pset(I), F>& domain() const;
/// Const promotion via conversion.
operator image_if<const I, F>() const;
......@@ -193,7 +193,7 @@ namespace mln
template <typename I, typename F>
inline
const pset_if<mln_pset(I), F>&
const p_if<mln_pset(I), F>&
image_if<I,F>::domain() const
{
mln_precondition(this->has_data());
......
......@@ -34,7 +34,7 @@
*/
# include <mln/core/internal/image_domain_morpher.hh>
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/site_set/p_if.hh>
# include <mln/pw/all.hh>
# include <mln/value/interval.hh>
......@@ -57,7 +57,7 @@ namespace mln
data_(I& ima, const F& f);
I ima_;
pset_if<mln_pset(I), F> pset_;
p_if<mln_pset(I), F> pset_;
};
} // end of namespace mln::internal
......@@ -99,11 +99,11 @@ namespace mln
*
*/
template <typename I, typename F, typename E>
struct image_if_base_ : public internal::image_domain_morpher< I, pset_if<mln_pset(I),F>, E >
struct image_if_base_ : public internal::image_domain_morpher< I, p_if<mln_pset(I),F>, E >
{
/// Give the definition domain.
const pset_if<mln_pset(I), F>& domain() const;
const p_if<mln_pset(I), F>& domain() const;
void init_(I& ima, const F& f);
......@@ -186,7 +186,7 @@ namespace mln
template <typename I, typename F, typename E>
inline
const pset_if<mln_pset(I), F>&
const p_if<mln_pset(I), F>&
image_if_base_<I,F,E>::domain() const
{
return this->data_->pset_;
......
......@@ -25,10 +25,10 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_CORE_SITE_SET_PSET_IF_HH
# define MLN_CORE_SITE_SET_PSET_IF_HH
#ifndef MLN_CORE_SITE_SET_P_IF_HH
# define MLN_CORE_SITE_SET_P_IF_HH
/*! \file mln/core/site_set/pset_if.hh
/*! \file mln/core/site_set/p_if.hh
*
* \brief Definition of the restriction of a point set w.r.t. a predicate.
*
......@@ -43,15 +43,15 @@ namespace mln
{
// Fwd decls.
template <typename S, typename F> struct pset_if;
template <typename Pi, typename S, typename F> struct pset_if_piter_;
template <typename S, typename F> struct p_if;
template <typename Pi, typename S, typename F> struct p_if_piter_;
namespace trait
{
template <typename S, typename F>
struct site_set_< pset_if<S,F> >
struct site_set_< p_if<S,F> >
{
typedef trait::site_set::nsites::unknown nsites;
typedef trait::site_set::bbox::unknown bbox;
......@@ -69,7 +69,7 @@ namespace mln
* \return A subset of points.
*/
template <typename S, typename F>
pset_if<S, F>
p_if<S, F>
operator | (const Site_Set<S>& pset, const Function_p2b<F>& f);
......@@ -80,9 +80,9 @@ namespace mln
* from point to Boolean.
*/
template <typename S, typename F>
class pset_if : public internal::site_set_base_< mln_psite(S), pset_if<S,F> >
class p_if : public internal::site_set_base_< mln_psite(S), p_if<S,F> >
{
typedef pset_if<S,F> self_;
typedef p_if<S,F> self_;
typedef internal::site_set_base_<mln_psite(S), self_> super_;
public:
......@@ -94,20 +94,20 @@ namespace mln
typedef mln_psite(S) psite;
/// Forward Site_Iterator associated type.
typedef pset_if_piter_<mln_fwd_piter(S), S, F> fwd_piter;
typedef p_if_piter_<mln_fwd_piter(S), S, F> fwd_piter;
/// Backward Site_Iterator associated type.
typedef pset_if_piter_<mln_bkd_piter(S), S, F> bkd_piter;
typedef p_if_piter_<mln_bkd_piter(S), S, F> bkd_piter;
/// Site_Iterator associated type.
typedef fwd_piter piter;
/// Constructor with a point set \p pset and a predicate \p f.
pset_if(const S& pset, const F& f);
p_if(const S& pset, const F& f);
/// Constructor without argument.
pset_if();
p_if();
/// Test if this site set is valid.
......@@ -143,20 +143,20 @@ namespace mln
template <typename S, typename F>
inline
pset_if<S, F>
p_if<S, F>
operator | (const Site_Set<S>& pset, const Function_p2b<F>& f)
{
pset_if<S, F> tmp(exact(pset), exact(f));
p_if<S, F> tmp(exact(pset), exact(f));
return tmp;
}
// pset_if<S,F>
// p_if<S,F>
template <typename S, typename F>
inline
bool
pset_if<S,F>::has(const psite& p) const
p_if<S,F>::has(const psite& p) const
{
return pset_.has(p) && f_(p);
}
......@@ -164,7 +164,7 @@ namespace mln
template <typename S, typename F>
inline
bool
pset_if<S,F>::is_valid() const
p_if<S,F>::is_valid() const
{
return pset_.is_valid();
}
......@@ -172,7 +172,7 @@ namespace mln
template <typename S, typename F>
inline
const S&
pset_if<S,F>::overset() const
p_if<S,F>::overset() const
{
return pset_;
}
......@@ -180,14 +180,14 @@ namespace mln
template <typename S, typename F>
inline
bool
pset_if<S,F>::pred(const psite& p) const
p_if<S,F>::pred(const psite& p) const
{
return f_(p);
}
template <typename S, typename F>
inline
pset_if<S,F>::pset_if(const S& pset, const F& f)
p_if<S,F>::p_if(const S& pset, const F& f)
: pset_(pset),
f_(f)
{
......@@ -195,14 +195,14 @@ namespace mln
template <typename S, typename F>
inline
pset_if<S,F>::pset_if()
p_if<S,F>::p_if()
{
}
template <typename S, typename F>
inline
const F&
pset_if<S,F>::predicate() const
p_if<S,F>::predicate() const
{
return f_;
}
......@@ -210,7 +210,7 @@ namespace mln
template <typename S, typename F>
inline
std::size_t
pset_if<S,F>::memory_size() const
p_if<S,F>::memory_size() const
{
return pset_.memory_size() + sizeof(f_);
}
......@@ -221,8 +221,8 @@ namespace mln
# include <mln/core/pset_if_piter.hh>
# include <mln/core/p_if_piter.hh>
#endif // ! MLN_CORE_SITE_SET_PSET_IF_HH
#endif // ! MLN_CORE_SITE_SET_P_IF_HH
......@@ -25,16 +25,16 @@
// reasons why the executable file might be covered by the GNU General
// Public License.
#ifndef MLN_CORE_SITE_SET_PSET_IF_PITER_HH
# define MLN_CORE_SITE_SET_PSET_IF_PITER_HH
#ifndef MLN_CORE_SITE_SET_P_IF_PITER_HH
# define MLN_CORE_SITE_SET_P_IF_PITER_HH
/*! \file mln/core/pset_if_piter.hh
/*! \file mln/core/p_if_piter.hh
*
* \brief Definition of iterators on pset_if<S,F>.
* \brief Definition of iterators on p_if<S,F>.
*/
# include <mln/core/internal/piter_adaptor.hh>
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/site_set/p_if.hh>
namespace mln
......@@ -46,19 +46,19 @@ namespace mln
* Parameter \c S is a site set type; parameter F is a function
* from point to Boolean.
*
* \see mln::pset_if
* \see mln::p_if
*/
template <typename Pi, typename S, typename F>
struct pset_if_piter_
struct p_if_piter_
: public internal::piter_adaptor_< Pi, // Adaptee.
pset_if<S,F>, // Site_Set.
pset_if_piter_<Pi,S,F> > // Exact.
p_if<S,F>, // Site_Set.
p_if_piter_<Pi,S,F> > // Exact.
{
/// Constructor without argument.
pset_if_piter_();
p_if_piter_();
/// Constructor from a site set.
pset_if_piter_(const pset_if<S,F>& s);
p_if_piter_(const p_if<S,F>& s);
/// Start an iteration.
void start_();
......@@ -67,11 +67,11 @@ namespace mln
void next_();
/// Change the set site targeted by pi_.
void pi_change_target_(const pset_if<S,F>& s);
void pi_change_target_(const p_if<S,F>& s);
private:
typedef pset_if_piter_<Pi,S,F> self_;
typedef internal::piter_adaptor_<Pi, pset_if<S,F>, self_> super_;
typedef p_if_piter_<Pi,S,F> self_;
typedef internal::piter_adaptor_<Pi, p_if<S,F>, self_> super_;
protected:
using super_::s_;
......@@ -84,13 +84,13 @@ namespace mln
template <typename Pi, typename S, typename F>
inline
pset_if_piter_<Pi,S,F>::pset_if_piter_()
p_if_piter_<Pi,S,F>::p_if_piter_()
{
}
template <typename Pi, typename S, typename F>
inline
pset_if_piter_<Pi,S,F>::pset_if_piter_(const pset_if<S,F>& s)
p_if_piter_<Pi,S,F>::p_if_piter_(const p_if<S,F>& s)
{
this->change_target(s);
}
......@@ -98,7 +98,7 @@ namespace mln
template <typename Pi, typename S, typename F>
inline
void
pset_if_piter_<Pi,S,F>::start_()
p_if_piter_<Pi,S,F>::start_()
{
pi_.start();
while (pi_.is_valid() && ! s_->pred(pi_))
......@@ -108,7 +108,7 @@ namespace mln
template <typename Pi, typename S, typename F>
inline
void
pset_if_piter_<Pi,S,F>::next_()
p_if_piter_<Pi,S,F>::next_()
{
do
pi_.next();
......@@ -118,7 +118,7 @@ namespace mln
template <typename Pi, typename S, typename F>
inline
void
pset_if_piter_<Pi,S,F>::pi_change_target_(const pset_if<S,F>& s)
p_if_piter_<Pi,S,F>::pi_change_target_(const p_if<S,F>& s)
{
pi_.change_target(s.overset());
}
......@@ -128,4 +128,4 @@ namespace mln
} // end of namespace mln
#endif // ! MLN_CORE_SITE_SET_PSET_IF_PITER_HH
#endif // ! MLN_CORE_SITE_SET_P_IF_PITER_HH
......@@ -37,7 +37,7 @@
* \todo Add an init method (deferred initialization).
*/
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/site_set/p_if.hh>
# include <mln/fun/ops.hh>
# include <mln/pw/value.hh>
# include <mln/pw/cst.hh>
......@@ -76,7 +76,7 @@ namespace mln
public:
/// Equivalent site_set type.
typedef pset_if<S_, F_> S;
typedef p_if<S_, F_> S;
/// Conversion towards the equivalent site set.
operator S() const;
......
......@@ -77,7 +77,7 @@ namespace mln
{
typedef mln_value(I) V;
typedef mln_ch_value(I, value::rgb8) O;
typedef const mln::pset_if<mln_pset(I), mln::fun::eq_p2b_expr_<mln::pw::value_<I>, mln::pw::cst_<V> > > F;
typedef const mln::p_if<mln_pset(I), mln::fun::eq_p2b_expr_<mln::pw::value_<I>, mln::pw::cst_<V> > > F;
I in = exact(input);
mln_precondition(in.has_data());
......
......@@ -37,7 +37,7 @@
# include <mln/core/concept/neighborhood.hh>
# include <mln/core/p_priority_queue_fast.hh>
# include <mln/core/p_priority_fast.hh>
# include <mln/core/routine/clone.hh>
# include <mln/accu/mean.hh>
# include <mln/estim/min_max.hh>
......@@ -86,7 +86,7 @@ namespace mln
I& ima = exact(ima_);
image2d<unsigned> dist = geom::chamfer(ima, w_win, max);
I out = clone(ima_);
p_priority_queue_fast<mln_psite(I), unsigned> q;
p_priority_fast<mln_psite(I), unsigned> q;
// Init.
{
......
......@@ -120,7 +120,7 @@ namespace mln
// Ordered queue.
/* FIXME: Milena probably already provides an ordered queue
facility via the mln::p_priority_queue class. Try to use it
facility via the mln::p_priority class. Try to use it
instead, and get rid of mln/util/greater_psite.hh. */
typedef
std::priority_queue< psite, std::vector<psite>, util::greater_psite<I> >
......
......@@ -39,8 +39,8 @@
# include <mln/core/site_set/p_set.hh>
# include <mln/core/image/inplace.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/pset_if_piter.hh>
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/p_if_piter.hh>
# include <mln/core/site_set/p_if.hh>
# include <mln/core/image/sub_image.hh>
# include <mln/core/image/image_if.hh>
# include <mln/core/routine/clone.hh>
......
......@@ -46,8 +46,8 @@
# include <mln/core/image/inplace.hh>
# include <mln/core/alias/neighb2d.hh>
# include <mln/core/clock_neighb2d.hh>
# include <mln/core/pset_if_piter.hh>
# include <mln/core/site_set/pset_if.hh>
# include <mln/core/p_if_piter.hh>
# include <mln/core/site_set/p_if.hh>
# include <mln/core/image/sub_image.hh>
# include <mln/core/image/image_if.hh>
# include <mln/core/routine/clone.hh>
......
......@@ -33,7 +33,7 @@
* \brief Definition of the concept of mln::Point_Set.
*
* \todo Think about adding an 'insert' method (not so easy because of
* pset_if...)
* p_if...)
*/
# include <mln/core/concept/point_site.hh>
......
......@@ -28,7 +28,7 @@
#ifndef MLN_CORE_SITE_SET_P_PRIORITY_QUEUE_HH
# define MLN_CORE_SITE_SET_P_PRIORITY_QUEUE_HH
/*! \file mln/core/site_set/p_priority_queue.hh
/*! \file mln/core/site_set/p_priority.hh
*
* \brief Definition of a point set class based on p_queue with
* priority features.
......@@ -51,7 +51,7 @@ namespace mln
{
// Fwd decls.
template <typename P, typename T> struct p_priority_queue;
template <typename P, typename T> struct p_priority;
template <typename P> struct p_array_fwd_piter_;
template <typename P> struct p_array_bkd_piter_;
......@@ -59,8 +59,8 @@ namespace mln
{
template <typename P, typename T>
struct point_set_< p_priority_queue<P, T> >
: public default_point_set_< p_priority_queue<P, T> >
struct point_set_< p_priority<P, T> >
: public default_point_set_< p_priority<P, T> >
{
typedef trait::point_set::arity::unique arity;
typedef trait::point_set::has_speed::slow has_speed;
......@@ -78,7 +78,7 @@ namespace mln
* a call to npoints() when this container is multiple.
*/
template <typename P, typename T>
class p_priority_queue : public internal::point_set_base_< P, p_priority_queue<P, T> >
class p_priority : public internal::point_set_base_< P, p_priority<P, T> >
{
public:
......@@ -89,7 +89,7 @@ namespace mln
typedef p_array_bkd_piter_<P> bkd_piter;
/// Constructor.
p_priority_queue();
p_priority();
/// Test is \p p belongs to this point set.
bool has(const P& p) const;
......@@ -104,10 +104,10 @@ namespace mln
const box_<P>& bbox() const;
/// Push force a point \p p in the queue.
p_priority_queue<P, T>& push_force(const P& p, T prio = 0);
p_priority<P, T>& push_force(const P& p, T prio = 0);
/// Push a point \p p in the queue.
p_priority_queue<P, T>& push(const P& p, T prio = 0);
p_priority<P, T>& push(const P& p, T prio = 0);
/// Pop (remove) the front point \p p from the queue; \p p is the
/// least recently inserted point.
......@@ -151,7 +151,7 @@ namespace mln
template <typename P, typename T>
inline
p_priority_queue<P, T>::p_priority_queue()
p_priority<P, T>::p_priority()
{
vect_needs_update_ = false;
bb_needs_update_ = false;
......@@ -160,7 +160,7 @@ namespace mln
template <typename P, typename T>
inline
void
p_priority_queue<P, T>::vect_update_() const
p_priority<P, T>::vect_update_() const
{
vect_.clear();
vect_.reserve(npoints());
......@@ -176,7 +176,7 @@ namespace mln
template <typename P, typename T>
inline
void
p_priority_queue<P, T>::bb_update_() const
p_priority<P, T>::bb_update_() const
{
bb_.init();
......@@ -192,7 +192,7 @@ namespace mln
template <typename P, typename T>
inline
bool
p_priority_queue<P, T>::has(const P& p) const
p_priority<P, T>::has(const P& p) const
{
typename std::map<T, p_queue<P> >::const_iterator it = q_.begin ();
......@@ -205,7 +205,7 @@ namespace mln
template <typename P, typename T>
inline
bool
p_priority_queue<P, T>::is_empty() const
p_priority<P, T>::is_empty() const
{
typename std::map<T, p_queue<P> >::const_iterator it = q_.begin ();
......@@ -218,7 +218,7 @@ namespace mln
template <typename P, typename T>
inline