15 #ifndef CORE_OPERATION_BOUND_SPACE_OP_H_
16 #define CORE_OPERATION_BOUND_SPACE_OP_H_
32 if (mode == Param::BoundSpaceMode::kClosed) {
34 for (
int i = 0; i < 3; i++) {
38 }
else if (pos[i] >= rb) {
46 }
else if (mode == Param::BoundSpaceMode::kTorus) {
47 auto length = rb - lb;
48 for (
auto& el : pos) {
50 auto d = std::abs(lb - el);
52 d = std::fmod(d, length);
56 auto d = std::abs(el - rb);
58 d = std::fmod(d, length);
74 if (param->bound_space) {
83 #endif // CORE_OPERATION_BOUND_SPACE_OP_H_