Mimic np.round as in voxel generator in spconv implementation
| 43 | |
| 44 | // Mimic np.round as in voxel generator in spconv implementation |
| 45 | int32_t npRound(float x) |
| 46 | { |
| 47 | // half way round to nearest-even |
| 48 | int32_t x2 = lround(x * 2.0F); |
| 49 | if (x != static_cast<int32_t>(x) && x2 == x * 2.0F) |
| 50 | { |
| 51 | return lround(x / 2.0F + 0.5F) * 2; |
| 52 | } |
| 53 | return lround(x + 0.5F); |
| 54 | } |
| 55 | |
| 56 | VoxelGeneratorPlugin::VoxelGeneratorPlugin(int32_t maxVoxels, int32_t maxPoints, int32_t voxelFeatures, float xMin, |
| 57 | float xMax, float yMin, float yMax, float zMin, float zMax, float pillarX, float pillarY, float pillarZ) |
no test coverage detected