Skip to content

Commit

Permalink
radix heap key float->dbl requires roundf -> round
Browse files Browse the repository at this point in the history
  • Loading branch information
mpadge committed Oct 30, 2017
1 parent 841f317 commit dae65dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/heaps/radixheap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void RadixHeap::insert(unsigned int item, double k)
RadixHeapNode *newNode = new RadixHeapNode;
newNode->item = static_cast <int> (item); // MP explicit conversion for radix
// MP radix only works for int keys, so k is rounded:
newNode->key = static_cast <int> (roundf (k));
newNode->key = static_cast <int> (round (k));
nodes[item] = newNode;
placeNode(nBuckets,newNode);
itemCount++;
Expand All @@ -70,7 +70,7 @@ void RadixHeap::decreaseKey(unsigned int item, double k)
node = nodes[item];
removeNode(node);
// MP radix only works for int keys, so k is rounded:
node->key = static_cast <int> (roundf (k));
node->key = static_cast <int> (round (k));
placeNode (static_cast <unsigned int> (node->bucket), node);
#ifdef RADIXHEAP_DEBUG
Rcpp::Rcout << "performed decrease-key (" << k << ") on item " << node->item << std::endl;
Expand Down

0 comments on commit dae65dc

Please sign in to comment.