/ increment a multi-index in which n_i runs over*/ the range 0 <= n_i < nMax_i. return true if this is the increment */ that brings the multiindex to all zeros. */ /
| 512 | /* that brings the multiindex to all zeros. */ |
| 513 | /**********************************************************************/ |
| 514 | bool increment(size_t *n, size_t *nMax, int rank) { |
| 515 | for (rank--; rank >= 0; rank--) |
| 516 | if (++n[rank] < nMax[rank]) |
| 517 | return false; |
| 518 | else |
| 519 | n[rank] = 0; |
| 520 | return true; |
| 521 | } |
| 522 | |
| 523 | // get the dimensions of reduced arrays (i.e., arrays collapsed along empty dimensions of original |
| 524 | // volume) |