Compute an X x Y x Z grid to have 'num' grid cells, only gives a nice grid for numbers with even factors since we don't search for factors of the number, we just try dividing by two
| 26 | // only gives a nice grid for numbers with even factors since |
| 27 | // we don't search for factors of the number, we just try dividing by two |
| 28 | vec3i computeGrid(int num) |
| 29 | { |
| 30 | vec3i grid(1); |
| 31 | int axis = 0; |
| 32 | int divisor = 0; |
| 33 | while (computeDivisor(num, divisor)) { |
| 34 | grid[axis] *= divisor; |
| 35 | num /= divisor; |
| 36 | axis = (axis + 1) % 3; |
| 37 | } |
| 38 | if (num != 1) { |
| 39 | grid[axis] *= num; |
| 40 | } |
| 41 | return grid; |
| 42 | } |
| 43 | |
| 44 | MPIDistribBase::MPIDistribBase() |
| 45 | { |
no test coverage detected