* mln/util/soft_heap.hh: rename take() as push().
* tests/util/soft_heap.cc: update test.
---
milena/ChangeLog | 8 ++++++++
milena/mln/util/soft_heap.hh | 10 ++++------
milena/tests/util/soft_heap.cc | 2 +-
3 files changed, 13 insertions(+), 7 deletions(-)
diff --git a/milena/ChangeLog b/milena/ChangeLog
index daed173..8201593 100644
--- a/milena/ChangeLog
+++ b/milena/ChangeLog
@@ -1,5 +1,13 @@
2009-01-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+ Improve soft heap interface.
+
+ * mln/util/soft_heap.hh: rename take() as push().
+
+ * tests/util/soft_heap.cc: update test.
+
+2009-01-19 Guillaume Lazzara <z(a)lrde.epita.fr>
+
Add implementation of Fibonacci heap.
* headers.mk: add a new header to distribution.
diff --git a/milena/mln/util/soft_heap.hh b/milena/mln/util/soft_heap.hh
index 144110f..bff9d11 100644
--- a/milena/mln/util/soft_heap.hh
+++ b/milena/mln/util/soft_heap.hh
@@ -197,13 +197,11 @@ namespace mln
/// Add a new element \p element.
void push(const T& element);
- /// Insert a site \p p (equivalent as 'push').
- void insert(const T& p);
/// Merge \p sh with this heap.
/// Be ware that after this call, \p sh will be empty. This heap will
/// hold the elements which were part of \p sh.
- void take(soft_heap<T,R>& sh);
+ void push(soft_heap<T,R>& sh);
/// Returns the element with the lowest priority and remove it from the
/// heap.
@@ -227,14 +225,14 @@ namespace mln
/// Reset the heap to an empty heap. Do *NOT* delete element which may
/// have been inserted.
- /// \sa take
+ /// \sa push
void soft_clear_();
private:
/// Merge a node \p q to this heap.
- /// \sa take
+ /// \sa push
void meld(node<T,R> *q);
/// Update suffix_min pointer according to the new values inserted in
@@ -655,7 +653,7 @@ namespace mln
template <typename T, typename R>
inline
void
- soft_heap<T,R>::take(soft_heap<T,R>& psh)
+ soft_heap<T,R>::push(soft_heap<T,R>& psh)
{
head<T,R> *head = psh.head_hook_();
while (head != 0)
diff --git a/milena/tests/util/soft_heap.cc b/milena/tests/util/soft_heap.cc
index d2bffcc..9ab1d8b 100644
--- a/milena/tests/util/soft_heap.cc
+++ b/milena/tests/util/soft_heap.cc
@@ -60,7 +60,7 @@ int main()
fh2.push(p[i]);
// Merge fh in fh2.
- fh2.take(fh);
+ fh2.push(fh);
// fh2 now holds both its elements and fh's.
unsigned i = 0;
--
1.5.6.5