MCPcopy Create free account
hub / github.com/LAStools/LAStools / filter

Method filter

LASlib/src/lasfilter.cpp:1746–1751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1744 inline const CHAR* name() const { return "keep_random_fraction"; };
1745 inline I32 get_command(CHAR* string) const { return sprintf(string, "-%s %g ", name(), fraction); };
1746 inline BOOL filter(const LASpoint* point)
1747 {
1748 srand(seed);
1749 seed = rand();
1750 return ((F32)seed / (F32)RAND_MAX) > fraction;
1751 };
1752 void reset() { seed = requested_seed; };
1753 LAScriterionKeepRandomFraction(F32 fraction) { requested_seed = seed = 0; this->fraction = fraction; };
1754 LAScriterionKeepRandomFraction(U32 seed, F32 fraction) { requested_seed = this->seed = seed; this->fraction = fraction; };

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected