* Same, but subscripts are assumed 0-based, and use a scale array * instead of raw dimension data (see mda_get_prod to create scale array) */
| 48 | * instead of raw dimension data (see mda_get_prod to create scale array) |
| 49 | */ |
| 50 | int |
| 51 | ArrayGetOffset0(int n, const int *tup, const int *scale) |
| 52 | { |
| 53 | int i, |
| 54 | lin = 0; |
| 55 | |
| 56 | for (i = 0; i < n; i++) |
| 57 | lin += tup[i] * scale[i]; |
| 58 | return lin; |
| 59 | } |
| 60 | |
| 61 | /* |
| 62 | * Convert array dimensions into number of elements |