Skip to content

Commit

Permalink
Typos, warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewB330 committed Jan 26, 2019
1 parent d8f95a2 commit bbbfda3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dsu.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <vector>

/**
* Disjoin-set-union data structure
* Disjoint-set-union data structure
*/
class DSU {

Expand Down
2 changes: 1 addition & 1 deletion emst.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class KdTreeSolver : public EmstSolver<DIM> {
public:
KdTreeSolver(std::vector<Point<DIM>> & points) :num_points(points.size()) {
dsu.reset(num_points);
tree = KdTree<DIM>(points, floor(log2(num_points)) - 2);
tree = KdTree<DIM>(points, static_cast<size_t>(floor(log2(num_points)) - 1));
is_fully_connected.assign(tree.get_maximal_id() + 1, false);
solve();
// todo: clear containers
Expand Down
4 changes: 2 additions & 2 deletions tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct KdTree {
// Implementation

template<size_t DIM>
KdTree<DIM>::KdTree<DIM>() {}
KdTree<DIM>::KdTree() {}

template<size_t DIM>
KdTree<DIM>::KdTree(const std::vector<Point<DIM>> & points, size_t max_height) {
Expand Down Expand Up @@ -121,7 +121,7 @@ void KdTree<DIM>::build(size_t node_id, size_t start, size_t size, size_t remain
return a[biggest] < b[biggest];
});

// recursively call build for two part
// recursively call build for two parts
build(node_id * 2, start, size / 2, remaining_height - 1);
build(node_id * 2 + 1, start + size / 2, (size + 1) / 2, remaining_height - 1);
}

0 comments on commit bbbfda3

Please sign in to comment.