| 402 | } |
| 403 | |
| 404 | static inline direction cross(direction a, direction b) { |
| 405 | if (a == b) meep::abort("bug - cross expects different directions"); |
| 406 | bool dcyl = a >= R || b >= R; |
| 407 | if (a >= R) a = direction(a - 3); |
| 408 | if (b >= R) b = direction(b - 3); |
| 409 | direction c = direction((3 + 2 * a - b) % 3); |
| 410 | if (dcyl && c < Z) return direction(c + 3); |
| 411 | return c; |
| 412 | } |
| 413 | |
| 414 | /* Call this whenever we modify the structure_chunk (fields_chunk::s) to |
| 415 | implement copy-on-write semantics. See also structure::changing_chunks. */ |
no test coverage detected