Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/gsomix/shogun
Browse files Browse the repository at this point in the history
  • Loading branch information
lisitsyn committed Jul 26, 2011
2 parents 08e35cf + 72b9f6c commit e0df385
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/shogun/lib/FibonacciHeap.cpp
Expand Up @@ -149,6 +149,19 @@ void CFibonacciHeap::clear()
num_trees = 0;
}

int32_t CFibonacciHeap::get_key(int32_t index, float64_t &ret_key)
{
if(index > max_num_nodes || index < 0)
return -1;
if(nodes[index]->index == -1)
return -1;

int32_t result = nodes[index]->index;
ret_key = nodes[index]->key;

return result;
}

void CFibonacciHeap::decrease_key(int32_t index, float64_t key)
{
FibonacciHeapNode* parent;
Expand Down
5 changes: 5 additions & 0 deletions src/shogun/lib/FibonacciHeap.h
Expand Up @@ -100,6 +100,11 @@ class CFibonacciHeap: public CSGObject
*/
void clear();

/** Returns key by index.
* @return -1 if not valid
*/
int32_t get_key(int32_t index, float64_t &ret_key);

/**
*/
void decrease_key(int32_t index, float64_t key);
Expand Down

0 comments on commit e0df385

Please sign in to comment.