* From products of whole-array dimensions and spans of a sub-array, * compute offset distances needed to step through subarray within array * * We assume caller has validated dimensions, so overflow is impossible */
| 172 | * We assume caller has validated dimensions, so overflow is impossible |
| 173 | */ |
| 174 | void |
| 175 | mda_get_offset_values(int n, int *dist, const int *prod, const int *span) |
| 176 | { |
| 177 | int i, |
| 178 | j; |
| 179 | |
| 180 | dist[n - 1] = 0; |
| 181 | for (j = n - 2; j >= 0; j--) |
| 182 | { |
| 183 | dist[j] = prod[j] - 1; |
| 184 | for (i = j + 1; i < n; i++) |
| 185 | dist[j] -= (span[i] - 1) * prod[i]; |
| 186 | } |
| 187 | } |
| 188 | |
| 189 | /* |
| 190 | * Generates the tuple that is lexicographically one greater than the current |
no outgoing calls
no test coverage detected