Skip to content

Commit

Permalink
Remove boost
Browse files Browse the repository at this point in the history
  • Loading branch information
Jean-Romain committed Jul 17, 2024
1 parent a0726e8 commit 0f43c49
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/LASlib/lasfilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
#include <map>
#include <set>
#include <unordered_set>
#include <boost/functional/hash.hpp>

#include <R_ext/Random.h> /* RNG interface */

Expand All @@ -47,6 +46,18 @@ using namespace std;
typedef multimap<I64,F64> my_I64_F64_map;
typedef set<I64> my_I64_set;

struct ArrayHash
{
std::size_t operator()(const std::array<int, 3>& arr) const {
std::size_t seed = 0;
for (int32_t val : arr) {
seed ^= std::hash<int32_t>{}(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
return seed;
}
};


class LAScriterionAnd : public LAScriterion
{
public:
Expand Down Expand Up @@ -1585,7 +1596,7 @@ class LAScriterionThinWithVoxel : public LAScriterion
double xoffset;
double yoffset;
double zoffset;
std::unordered_set<Array, boost::hash<Array> > dynamic_registry;
std::unordered_set<Array, ArrayHash> dynamic_registry;
};

class LAScriterionThinPulsesWithTime : public LAScriterion
Expand Down

0 comments on commit 0f43c49

Please sign in to comment.