* mln/world/kn/hqueue.hh: Rename is_empty and is_not_empty to
is_empty_at and is_not_empty_at.
* mln/world/kn/compute_tree_of_shapes.hh: Update usage of hqueue.
---
milena/ChangeLog | 9 +++++++++
milena/mln/util/hqueue.hh | 12 ++++++------
milena/mln/world/kn/compute_tree_of_shapes.hh | 14 +++++++-------
3 files changed, 22 insertions(+), 13 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index 656968b..b0e2312 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,14 @@
2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Rename methods in world::kn::hqueue.
+
+ * mln/world/kn/hqueue.hh: Rename is_empty and is_not_empty to
+ is_empty_at and is_not_empty_at.
+
+ * mln/world/kn/compute_tree_of_shapes.hh: Update usage of hqueue.
+
+2012-10-29 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add value::is_degenerated.
* mln/value/is_degenerated.hh,
diff --git a/milena/mln/util/hqueue.hh b/milena/mln/util/hqueue.hh
index 6d535cf..9485827 100644
--- a/milena/mln/util/hqueue.hh
+++ b/milena/mln/util/hqueue.hh
@@ -53,8 +53,8 @@ namespace mln
unsigned size() const;
- bool is_empty(const P& bucket) const;
- bool is_not_empty(const P& bucket) const;
+ bool is_empty_at(const P& bucket) const;
+ bool is_not_empty_at(const P& bucket) const;
// const std::queue<T>& operator[](const P& bucket) const;
@@ -103,16 +103,16 @@ namespace mln
template <typename T, typename P>
bool
- hqueue<T,P>::is_empty(const P& bucket) const
+ hqueue<T,P>::is_empty_at(const P& bucket) const
{
return v_[inter_.index_of(bucket)].empty() == 0;
}
template <typename T, typename P>
bool
- hqueue<T,P>::is_not_empty(const P& bucket) const
+ hqueue<T,P>::is_not_empty_at(const P& bucket) const
{
- return ! is_empty(bucket);
+ return ! is_empty_at(bucket);
}
// template <typename T, typename P>
@@ -134,7 +134,7 @@ namespace mln
T
hqueue<T,P>::pop(const P& bucket)
{
- mln_precondition(!is_empty(bucket));
+ mln_precondition(!is_empty_at(bucket));
mln_precondition(bucket < v_.size());
T front = v_[bucket].front();
v_[bucket].pop();
diff --git a/milena/mln/world/kn/compute_tree_of_shapes.hh
b/milena/mln/world/kn/compute_tree_of_shapes.hh
index 1596618..1778073 100644
--- a/milena/mln/world/kn/compute_tree_of_shapes.hh
+++ b/milena/mln/world/kn/compute_tree_of_shapes.hh
@@ -239,7 +239,7 @@ namespace mln
for (; l_ < inter_.last(); value::inc(l_))
{
- if (q.is_not_empty(l_))
+ if (q.is_not_empty_at(l_))
{
found = true;
return l_;
@@ -248,7 +248,7 @@ namespace mln
// Avoid overflow on last element.
if (l_ == inter_.last())
- if (q.is_not_empty(l_))
+ if (q.is_not_empty_at(l_))
{
found = true;
return l_;
@@ -265,7 +265,7 @@ namespace mln
EV l_ = lcur;
for (; l_ > inter_.first(); value::dec(l_))
- if (q.is_not_empty(l_))
+ if (q.is_not_empty_at(l_))
{
found = true;
return l_;
@@ -273,7 +273,7 @@ namespace mln
// Avoid overflow on first element.
if (l_ == inter_.first())
- if (q.is_not_empty(l_))
+ if (q.is_not_empty_at(l_))
{
found = true;
return l_;
@@ -326,10 +326,10 @@ namespace mln
compute_tree_of_shapes_t<I>::priority_pop(q_type& q)
// modify q, and sometimes l
{
- if (q.is_empty(lcur))
+ if (q.is_empty_at(lcur))
{
EV lcur_ = level_next_to_lcur(q); // such as q[lcur_] is not empty
- if (q.is_empty(lcur_))
+ if (q.is_empty_at(lcur_))
std::abort();
lcur = lcur_;
}
@@ -385,7 +385,7 @@ namespace mln
i = i + 1;
done(p) = true;
- if (q.is_empty(lcur))
+ if (q.is_empty_at(lcur))
{
std::cout << "sort: done with level " << lcur <<
std::endl;
dsp.show(done);
--
1.7.2.5
Show replies by date