MCPcopy Create free account
hub / github.com/NanoComp/meep / increment

Function increment

src/array_slice.cpp:514–521  ·  view source on GitHub ↗

/ 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. */ /

Source from the content-addressed store, hash-verified

512/* that brings the multiindex to all zeros. */
513/**********************************************************************/
514bool 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)

Callers 1

collapse_arrayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected